VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    In the docs for ffmpeg concat it states:

    Using intermediate files
    If you have MP4 files, these could be losslessly concatenated by first transcoding them to MPEG-2 transport streams. With H.264 video and AAC audio, the following can be used:

    ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
    ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
    ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

    When I try this for lossless copy, the first frame of input2 freezes for time enough to notice. If I check it with ffprobe, it shows the first frame pts time, at the merge point has suddenly gone to twice as long as it should be causing the stutter there.

    Is this a bug or am I doing or understanding it wrong?
    Thank you
    Quote Quote  
  2. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    This may put you on the right track. I'm not sure.

    My mp4 videos come out of my camera.
    Same:
    DAR
    PAR
    Video bitrate
    FPS
    Audio bitrate
    etc.

    So I wrote a little batch file to concatenate them.

    Code:
    for %%a in (*.mp4) do echo file '%%a' >> list.txt
    ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy OutputVideo.mp4
    del list.txt
    All the videos and ffmpeg.exe in the same folder and away I go.
    Alter one of the parameters and I have to convert all videos to a ts first. So I don't.

    Maybe the video stream and audio stream of one of the ts files are of different lengths.
    MediaInfo might pick this up.

    Cheers.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!