Advertisement
rowntreerob

Merge mp4 files by converting to raw then using cat

Mar 27th, 2012
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.91 KB | None | 0 0
  1. ./ffmpeg  -i gpsclip_seg1.mp4  -vn -f u16le -acodec pcm_s16le -ac 1 -ar 44100 - > temp1.a < /dev/null
  2. ./ffmpeg  -i gpsclip_seg2.mp4  -vn -f u16le -acodec pcm_s16le -ac 1 -ar 44100 - > temp2.a < /dev/null
  3. ./ffmpeg  -i gpsclip_seg3.mp4  -vn -f u16le -acodec pcm_s16le -ac 1 -ar 44100 - > temp3.a < /dev/null
  4. cat temp1.a temp2.a temp3.a > all.a
  5.  
  6. ./ffmpeg -i gpsclip_seg1.mp4 -an -f yuv4mpegpipe - > temp1.v < /dev/null &amp;
  7. ./ffmpeg -i gpsclip_seg2.mp4 -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v
  8. ./ffmpeg -i gpsclip_seg3.mp4 -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp3.v
  9. cat temp1.v temp2.v temp3.v > all.v
  10.  
  11. ./ffmpeg -f u16le -acodec pcm_s16le -ac 1 -ar 44100 -i all.a -f yuv4mpegpipe -i all.v -same_quant -y output.mp4
  12.  
  13. #rip each orig mp4 to separate raw tracks for audio / video
  14. #once u have raw bits you can simply cat them in order to aggregate
  15. #remux from raw to good codecs after the cat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement