VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Hi,
    I'm editing a serie of similar videos with VirtualDub and after finishing I export them with "External encoders", in my case the input videos are MP4, x264 and I chose to export them by maintaining format and encoder.
    At the very end, I join 5 MP4 videos with ffmpeg by using the following batch file:

    ffmpeg -i video1.mp4 -c copy -bsf h264_mp4toannexb temp1.ts
    ffmpeg -i video2.mp4 -c copy -bsf h264_mp4toannexb temp2.ts
    ffmpeg -i video3.mp4 -c copy -bsf h264_mp4toannexb temp3.ts
    ffmpeg -i video4.mp4 -c copy -bsf h264_mp4toannexb temp4.ts
    ffmpeg -i video5.mp4 -c copy -bsf h264_mp4toannexb temp5.ts
    ffmpeg -i "concat:temp1.ts|temp2.ts|temp3.ts|temp4.ts|temp5. ts" -c copy -bsf aac_adtstoasc output.mp4
    del temp1.ts temp2.ts temp3.ts temp4.ts temp5.ts

    The resulting output is perfect in any regards, the audio is in synch, the quality is as good as it should be when watching the merged video in a player on PC or watching on TV.

    However, to see more clearly, I decided to start this batch file in a cmd window to see if any errors would occur. And in fact, I get a lot of yellow lines telling stuff that ffmpeg doesn't seem to like.
    Here a screenshot after merging with the batch:

    Click image for larger version

Name:	Screenshot.jpg
Views:	906
Size:	402.2 KB
ID:	34139

    When editing the videos, I get much more of these yellow entries, the above shot is just an example without editing. The 2 first yellow lines are always present, the remaining ones point to a possible "mismatch in the timestamp".
    As said, the output is fully playable with no glitches in my video players or else.

    What are the possible consequences of these "mismatches" and should I correct these, and if yes how? Or can I just ignore them?

    Thanks,
    XenonS
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Have you tried google that non-monotonouus dts error message?

    But if the audio is in synch I wouldn't worry that much.
    Quote Quote  
  3. Yes, I have found some entries by googling, but they all end with "use this xy program...", not very helpful, except one tip page with someone familiar with ffmpeg where I just asked this question as a comment (just a few minutes ago).

    Of course I understand that all my 5 videos in the case above must be similar in container, format, size, bitrate, audio data etc. otherwise this will not yield any result. However, I don't know if I would get any error message telling me that, I don't think so. I know that if videos are different I'll have to re-encode them properly in a single one. But here, they are all similar, except the lenght that may differ by milliseconds (they are all 10 minutes long).
    As said, I don't have any trouble with the output, I just wonder if these messages are serious in some aspect I don't know about.

    XenonS
    Quote Quote  
  4. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Your problem is that MPEG Transport Streams (and also Program Streams) don't have index chunks pointing to GOP starts (MP4 does have that), thus need a continuous timecode next to the video stream to aid random seeking. If you convert 5 parts one after another, each of them will probably start with a zero timestamp (if not defined otherwise); combining them will cause the timecode get reset at each joint. To avoid that, you would have to convert the 5 original MP4 parts as a logically continuous input. Or you may have to get the timestamps in the concatenated output rewritten to be continuous now.

    There are some related ffmpeg options:
    Code:
    -copyts             copy timestamps
    -start_at_zero      shift input timestamps to start at 0 when using copyts
    -copytb mode        copy input stream time base when stream copying
    Unfortunately I don't know which to use when in your case.
    Quote Quote  
  5. Hi LighH.de,
    thank you very much for your details, I highly appreciate
    I will try the options you suggest, also opening my above merged videos with some of my editing programs (VSDC Free Editor, AVS Video Editor) and examine the data of the timeline.
    I think if I ever have to re-edit these videos, then the exact timestamps will be important, e.g. when cutting videos or apply effects in a specific time interval.
    I'm very interested to use ffmpeg's ability to join/cut videos without re-encoding.

    Greetings,
    XenonS
    Quote Quote  
  6. Member
    Join Date
    Jul 2014
    Location
    Denmark
    Search Comp PM
    You could also try to add "-fflags +igndts" as input argument and "-fflags +genpts" as output argument:

    ffmpeg -fflags +igndts -i "concat:temp1.ts|temp2.ts|temp3.ts|temp4.ts|te mp5. ts" -c copy -bsf aac_adtstoasc -fflags +genpts output.mp4

    This will ignore the decoder time stamps (DTS) in the input files and generate new ones in the output file. I'm not sure if this works without re-encoding, but give it a try
    I'm the developer behind FFQueue. My posts might reflect this! ;-)
    Quote Quote  
  7. As an alternative, I was successful in joining my videos with MP4Box with the command:

    MP4Box -cat video1.mp4 -cat video2.mp4 -cat video3.mp4 -cat video4.mp4 -cat video5.mp4 -new output.mp4

    XenonS
    Quote Quote  



Similar Threads

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