Skip to content

Instantly share code, notes, and snippets.

@aminbenarieb
Created March 20, 2020 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aminbenarieb/4c1983852040647a81f157d624b05b2a to your computer and use it in GitHub Desktop.
Save aminbenarieb/4c1983852040647a81f157d624b05b2a to your computer and use it in GitHub Desktop.
still 00:00:00 00:00:10
right 00:00:10 00:00:13
up 00:00:13 00:00:15
still 00:00:15 00:00:19
right 00:00:19 00:00:20
left 00:00:20 00:00:24
right 00:00:24 00:00:26
down 00:00:26 00:00:27
right 00:00:27 00:00:28
right 00:00:28 00:00:30
left 00:00:30 00:00:31
still 00:00:31 00:00:34
right 00:00:35 00:00:37
down 00:00:37 00:00:38
up 00:00:38 00:00:42
right 00:00:42 00:00:43
still 00:00:43 00:00:48
right 00:00:48 00:00:49
left 00:00:50 00:00:51
up 00:00:51 00:00:53
left_right 00:00:53 00:00:58
left_up 00:00:58 00:01:01
import subprocess
#define video_path before use
with open("cuts.txt") as f:
for idx, line in enumerate(f.readlines()):
filename, start, end = line.strip().split(' ')
cmd = ["ffmpeg", "-i", f"{video_path}", "-ss", start, "-to", end, f"{idx}_{filename}.MOV"]
subprocess.run(cmd, stderr=subprocess.STDOUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment