Search code examples
video-encoding

HandBrake; Multiple Inputs


How can I encode and concatenate multiple videos using HandBrake / HandBrakeCLI??

In HandBrakeCLI when I run: HandBrakeCLI -i file1.MPG -i file2.MPG -o out.m4v -O -e x264 -r 23.976 --pfr

the output only contains the second file!


Solution

  • You cannot concatenate videos using HandBrakeCLI.

    You can concatenate videos simply if they are in MPG-1

    Using FFMPEG you can do

    ffmpeg -i input1.avi -same_quant intermediate1.mpg
    ffmpeg -i input2.avi -same_quant intermediate2.mpg
    cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
    

    See the FFmpeg FAQ for details.

    Once the videos are concatenated, you can encode them however you like.