Add video file parameter to ffprobe, add 20Mbps bitrate to ffmpeg

This commit is contained in:
Arkadiusz Wieczorek 2021-09-20 18:22:40 +02:00
parent 1f010daf52
commit 3fc5101e89

View File

@ -127,7 +127,7 @@ const ns = range(pieces.length);
const sample_rate = parseInt(
(
await $`ffprobe odc25proxy.mp4 2>&1 | grep 'Audio:' | grep --only-matching --extended-regexp '[0-9]+ Hz' | sed 's/ Hz//'`
await $`ffprobe ${args[0]} 2>&1 | grep 'Audio:' | grep --only-matching --extended-regexp '[0-9]+ Hz' | sed 's/ Hz//'`
).stdout
); // in Hz
@ -182,4 +182,4 @@ ${audio_filter}
${ns.map((n) => `[copy${n}t][copy${n}ta]`).join(" ")}
concat=n=${pieces.length}:v=1:a=1 [out_video] [out_audio]`;
await $`ffmpeg -i ${video} -filter_complex ${filter} -map '[out_video]' -map '[out_audio]' ${`${video}.cut-complex.mp4`}`;
await $`ffmpeg -i ${video} -b:v 20000k -filter_complex ${filter} -map '[out_video]' -map '[out_audio]' ${`${video}.cut-complex.mp4`}`;