From 594c11cfadf23e0ad351548705b9c5f21d875858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=B6rner?= Date: Thu, 3 Nov 2022 23:55:11 +0100 Subject: [PATCH] add options for finalizing --- make-apple-motion.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/make-apple-motion.py b/make-apple-motion.py index a9f7379..8a91713 100755 --- a/make-apple-motion.py +++ b/make-apple-motion.py @@ -45,6 +45,18 @@ parser.add_argument('--exclude-id', dest='exclude_ids', nargs='+', action="store Usage: ./make.py yourproject/ --exclude-id 1 8 15 16 23 42 ''') +parser.add_argument('--vcodec', type=str, default='mpeg2video', help=''' + ffmpeg video codec to use. defaults to mpeg2video, libx264 or copy (keeps the original h264 stream) is also often used. + ''') + +parser.add_argument('--acodec', type=str, default='mp2', help=''' + ffmpeg video codec to use. defaults to mp2, aac or copy (keeps the m4a stream) is also often used. + ''') + +parser.add_argument('--num-audio-streams', dest='naudio', type=int, default=1, help=''' + number of audio-streams to generate. defaults to 1 + ''') + args = parser.parse_args() @@ -189,9 +201,11 @@ def finalize_job(job_id, event): shutil.copy(intermediate_clip, copy_clip) - run('ffmpeg -y -hide_banner -loglevel error -i {input} -f lavfi -i anullsrc -ar 48000 -ac 2 -map 0:v -c:v mpeg2video -q:v 0 -aspect 16:9 -map 1:a -map 1:a -map 1:a -map 1:a -shortest -f mpegts {output}', + run('ffmpeg -y -hide_banner -loglevel error -i {input} -ar 48000 -ac 2 -map 0:v:0 -c:v {vcodec} -q:v 0 -aspect 16:9 '+(args.naudio * '-map 0:a:0 ')+' -c:a {acodec} -f mpegts {output}', input=intermediate_clip, - output=final_clip) + output=final_clip, + vcodec=args.vcodec, + acodec=args.acodec) event_print(event, "finalized intro to " + final_clip)