A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow you to join video files by merely concatenating them. Hence you may concatenate your multimedia files by first transcoding them to these privileged formats, then using the humble cat command. As an example:
#!/bin/bash
# Divx5 (hq) output for DVD player compatibility
videoparams1="mpeg4 -mbd rd -flags +4mv+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -sameq -b 1000k"
# MP3 (stereo) for DVD player compatibility
audioparams1="libmp3lame -ac 2 -ab 128k"
outputfile=~/Videos/ffmpeg-`date +%Y%m%d-%H%M%S`.avi
cat *.VOB | ffmpeg -i - \I tried the 2 pass method and consistently encountered errors w/ missing output logs. This is apparently a known bug w/ my FFMpeg version. Since the shipping version w/ Ubuntu excludes non-free codecs, I complied my own and have no desire to re-do that process. Note that you can test by directing the output to NULL with outputfile="-f AVI -y /dev/null" . This is handy when tweaking parameters like video bitrate "-b". The VOB bitrate can be 9801K (yikes!). If omitted, even w/ same quality "-sameq", the bitrate defaults to 200k (garbage). Find your own satisfactory value. The other video perameters were lifted from the FFMpeg FAQ.
-vcodec $videoparams1 \
-acodec $audioparams1 \
$outputfile
Comments