Skip to content

Commit

Permalink
Fixed moviepy error
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenCochell committed Apr 13, 2023
1 parent 39fca45 commit b70c6f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions static/js/generate-timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ function cuttingMode(){
function startCut(){
console.log(timelineTimestamps["timestamps"]);
timelineTimestamps["timestamps"] = [];
timelineTimestamps["timestamps"].push([video.currentTime.toString()]);
timelineTimestamps["timestamps"].push([video.currentTime]);
}

function endCut(){

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

cutButton.style.display = "flex";
Expand Down
10 changes: 8 additions & 2 deletions transcription/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,16 @@ def cut_files(request):
# Iterate over each cut:

for cut in cuts:
cut = [eval(i) for i in cut]
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 b70c6f3

Please sign in to comment.