Skip to content

Commit

Permalink
fixed merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MAlshaik committed Apr 13, 2023
2 parents 1cb20f6 + db9a7b4 commit 9fcee08
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
Binary file not shown.
3 changes: 2 additions & 1 deletion Frontend/templates/Frontend/video-editing.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<link rel="stylesheet" href="{% static 'css/video-editing.css' %}"/>
<link rel="stylesheet" href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css'/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/FileSaver.min.js"></script>

<title>Transcript-Editing</title>
</head>
Expand Down Expand Up @@ -50,7 +51,7 @@
<button id="edit-transcript", onclick="editTranscript()">Edit</button>
<button id="download-transcript", onclick="downloadTranscript()">Download</button>
<button id="save-transcript", onclick="saveTranscript()">Save</button>
<button id="delete-transcript", onclick="deleteTranscript()">delete</button>
<button id="delete-transcript", onclick="deleteTranscript()">Delete</button>
</div>

<div class="transcript-container">
Expand Down
Binary file not shown.
2 changes: 2 additions & 0 deletions static/js/generate-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ function startCut(){
}

function endCut(){

console.log(video.currentTime);

timelineTimestamps["timestamps"][0].push(video.currentTime);
cutVideo(id, timelineTimestamps);

Expand Down
22 changes: 20 additions & 2 deletions static/js/transcript-editing.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,26 @@ function deleteTranscript() {
});
}

function downloadTranscript(){
console.log("downloading transcript");
async function downloadTranscript(){
console.log("downloading video");

var data = new FormData();
data.append('id', id);

var videoUrl = await makeRequest("/api/get/", data);
var filename = "video.mp4";

console.log("Download URL:")
console.log(videoUrl);
console.log(videoUrl["url"]);

var xhr = new XMLHttpRequest();
xhr.responseType = "blob";
xhr.onload = function() {
saveAs(xhr.response, filename);
};
xhr.open("GET", videoUrl["url"]);
xhr.send();
}


9 changes: 8 additions & 1 deletion transcription/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,14 @@ def cut_files(request):
for cut in cuts:
print(f"Current timestamp: {cut}")

clip = clip.cutout(cut[0] - total_removed, cut[1] - total_removed)
# clip = clip.cutout(cut[0] - total_removed, cut[1] - total_removed)

duration = clip.duration

first_clip = clip.subclip(0, cut[0] - total_removed)
second_clip = clip.subclip(cut[1] - total_removed, duration)

clip = moviepy.editor.concatenate_videoclips([first_clip, second_clip])

total_removed += cut[1] - cut[0]

Expand Down

0 comments on commit 9fcee08

Please sign in to comment.