Skip to content

Commit d28516c

Browse files
committed
ffmpeg_editlist: Add built-in template generation
1 parent 83649d2 commit d28516c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

ffmpeg_editlist.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,41 @@
4040
4141
"""
4242

43+
template_single = """\
44+
- input: INPUT.mkv
45+
46+
- output: OUTPUT.mkv
47+
title: TITLE
48+
description: >-
49+
MULTI-LINE
50+
DESCRIPTION
51+
editlist:
52+
- start: 00:00 # These are time segments to include
53+
- 4:00: Begin exercise 1
54+
- stop: 5:00
55+
"""
56+
57+
template_workshop = """\
58+
- workshop_title: TITLE APPENDED TO VIDEO TITLES
59+
60+
- workshop_description: >
61+
MULTI LINE DESCRIPTION
62+
THAT GETS APPENDED
63+
TO EACH VIDEO'S DESCRIPTION
64+
65+
- input: INPUT.mkv
66+
67+
- output: OUTPUT.mkv
68+
title: TITLE
69+
description: >-
70+
MULTI-LINE
71+
DESCRIPTION
72+
editlist:
73+
- start: 00:00 # These are time segments to include
74+
- 4:00: Begin exercise 1
75+
- stop: 5:00
76+
"""
77+
4378
FFMPEG_VIDEO_COPY = ['-vcodec', 'copy',]
4479
FFMPEG_VIDEO_ENCODE = ['-c:v', 'libx264', ] #'-preset', 'slow', '-crf', '22'
4580
FFMPEG_AUDIO_COPY = ['-acodec', 'copy',]
@@ -205,8 +240,21 @@ def main(argv=sys.argv[1:]):
205240
help='Wait after each encoding (don\'t clean up the temporary directory right away')
206241
parser.add_argument('--list', action='store_true',
207242
help="Don't do anything, just list all outputs that would be processed (and nothing else)")
243+
244+
parser.add_argument('--template-single', action='store_true',
245+
help="Print out template for a single video, don't do anything else.")
246+
parser.add_argument('--template-workshop', action='store_true',
247+
help="Print out template for a workshop, don't do anything else.")
208248
args = parser.parse_args(argv)
209249

250+
# Printing out templates
251+
if args.template_single:
252+
print(template_single)
253+
sys.exit(0)
254+
if args.template_workshop:
255+
print(template_workshop)
256+
sys.exit(0)
257+
210258
if args.threads:
211259
FFMPEG_VIDEO_ENCODE.extend(['-threads', str(args.threads)])
212260
FFMPEG_VIDEO_ENCODE.extend(['-preset', args.preset])

0 commit comments

Comments
 (0)