Advertisement
rowntreerob

ffmpeg mp4 concat on diff size inputs

Apr 19th, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.94 KB | None | 0 0
  1. #ffmpeg concat when inputs of DIFF sizes the FAQ docs for concat do not work for me
  2. # INPUT yuv420p, 500x868
  3. # INPUT yuv420p, 1222x780
  4. # prep audio
  5. ./ffmpeg  -i _seg1.mp4  -vn -f u16le -acodec pcm_s16le -ac 1 -ar 44100 - > temp1.a < /dev/null
  6. ./ffmpeg  -i _seg2.mp4  -vn -f u16le -acodec pcm_s16le -ac 1 -ar 44100 - > temp2.a < /dev/null
  7. cat temp1.a temp2.a  > all.a
  8. # drop audio and create streams (mp2) that can input to /cat/, balance the size using crop/pad
  9. ./ffmpeg -i _seg1.mp4 -r:v 10 -c:v libx264 -bsf:v h264_mp4toannexb -an out1.h264
  10. ./ffmpeg -i clipperDemo_p2-4-6-2012.mp4 -r:v 10 -c:v libx264 -bsf:v h264_mp4toannexb -vf crop=500:780 -an out2.h264
  11. ./ffmpeg -i out2.h264  -c:v copy  -vf pad=1220:780:360:0:violet -an out3.h264
  12. #mp2 to mp4
  13. cat out1.h264 out3.h264 | ./ffmpeg -i pipe:0 -vcodec copy -an  out_all.mp4
  14. #mux audio cat & vid
  15. ./ffmpeg -f u16le -acodec pcm_s16le -ac 1 -ar 44100 -i all.a  -i out_all.mp4 -vcodec copy final.mp4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement