diff --git a/998d45b0-b0a0-4111-9655-e6e58920bc36TEMP_MPY_wvf_snd.mp3 b/998d45b0-b0a0-4111-9655-e6e58920bc36TEMP_MPY_wvf_snd.mp3 deleted file mode 100644 index fbaabf2..0000000 Binary files a/998d45b0-b0a0-4111-9655-e6e58920bc36TEMP_MPY_wvf_snd.mp3 and /dev/null differ diff --git a/Frontend/templates/Frontend/video-editing.html b/Frontend/templates/Frontend/video-editing.html index 2fcfcb2..2bbda84 100644 --- a/Frontend/templates/Frontend/video-editing.html +++ b/Frontend/templates/Frontend/video-editing.html @@ -7,6 +7,7 @@ + Transcript-Editing @@ -50,7 +51,7 @@ - +
diff --git a/d23f6b79-19b6-4037-bcb2-eb1188f753b6TEMP_MPY_wvf_snd.mp3 b/d23f6b79-19b6-4037-bcb2-eb1188f753b6TEMP_MPY_wvf_snd.mp3 deleted file mode 100644 index c14d963..0000000 Binary files a/d23f6b79-19b6-4037-bcb2-eb1188f753b6TEMP_MPY_wvf_snd.mp3 and /dev/null differ diff --git a/static/js/generate-timeline.js b/static/js/generate-timeline.js index 3e9ca3b..6df0e71 100755 --- a/static/js/generate-timeline.js +++ b/static/js/generate-timeline.js @@ -91,7 +91,9 @@ function startCut(){ } function endCut(){ + console.log(video.currentTime); + timelineTimestamps["timestamps"][0].push(video.currentTime); cutVideo(id, timelineTimestamps); diff --git a/static/js/transcript-editing.js b/static/js/transcript-editing.js index 01edf34..9850328 100755 --- a/static/js/transcript-editing.js +++ b/static/js/transcript-editing.js @@ -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(); } diff --git a/transcription/views.py b/transcription/views.py index 4e6b58d..e805c5e 100644 --- a/transcription/views.py +++ b/transcription/views.py @@ -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]