3

I have nearly 130 files that I want to burn onto a DVD as an end result. I've gone down a bit of a rabbit hole and ended up at ffmpeg trying to combine all the files into a single giant 2 and a half hour mp4 that I can then use avidemux to burn onto a DVD. Note that combined, the videos are 4.13GB.

If there already is an easier method to this, I would absolutely love to hear it.

I started off by trying

ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4

But this gave a ton of Non-monotonous DTS in output stream errors. I figured (after extensive googling in a topic I am not familiar with), the encodings are not the same causing some kind of desync. I resolved to re-encode them all into a standard format and then concat them.

    ffmpeg -f concat -safe 0 -i mylist.txt -c:v libx264 -crf 18 -preset superfast -c:a copy output.mp4

The video still has video/audio sync errors. I reduced mylist.txt to be about 10 or so videos just so I don't have to wait so long. The resulting log can be viewed in full here.

The main points I assume the errors are coming from are lines such as;

...
...
frame= 2340 fps= 69 q=21.0 size=  194048kB time=00:01:18.22 bitrate=20320.3kbits/s speed=2.29x    
frame= 2375 fps= 69 q=19.0 size=  196864kB time=00:01:19.23 bitrate=20354.3kbits/s speed=2.29x    
[mp4 @ 000000000060f760] Non-monotonous DTS in output stream 0:1; previous: 3831808, current: 3520405; changing to 3831809. This may result in incorrect timestamps in the output file.
[concat @ 00000000006084c0] DTS 1226511 < 7174903 out of order
[h264 @ 0000000000559960] Invalid NAL unit 1, skipping.
    Last message repeated 1 times
[h264 @ 0000000000559960] no frame!
[mp4 @ 000000000060f760] Non-monotonous DTS in output stream 0:1; previous: 3831809, current: 3521429; changing to 3831810. This may result in incorrect timestamps in the output file.
[mp4 @ 000000000060f760] Non-monotonous DTS in output stream 0:1; previous: 3831810, current: 3522453; changing to 3831811. This may result in incorrect timestamps in the output file.
[h264 @ 0000000002820480] Invalid NAL unit 1, skipping.
[h264 @ 0000000002820480] no frame!
[mp4 @ 000000000060f760] Non-monotonous DTS in output stream 0:1; previous: 3831811, current: 3523477; changing to 3831812. This may result in incorrect timestamps in the output file.
[h264 @ 0000000002820960] Invalid NAL unit 1, skipping.
[h264 @ 0000000002820960] no frame!
[mp4 @ 000000000060f760] Non-monotonous DTS in output stream 0:1; previous: 3831812, current: 3524501; changing to 3831813. This may result in incorrect timestamps in the output file.
[mp4 @ 000000000060f760] Non-monotonous DTS in output stream 0:1; previous: 3831813, current: 3525525; changing to 3831814. This may result in incorrect timestamps in the output file.
[h264 @ 0000000002820e20] Invalid NAL unit 1, skipping.
[h264 @ 0000000002820e20] no frame!
...
...

There are also a bunch of Past duration 0.998665 too large errors but I read that's not a big issue.

I'm thinking now to use Vegas Pro and just render all the videos together in the timeline but ffmpeg sounds like the cleanest (and fastest) way. What am I not understanding?

1 Answer 1

1

So, you've got two targets there -- on one hand you said you want to go to DVD, and the other, you're encoding to H.264. Pick one. :)

Assuming you want DVD still, use -target ntsc-dvd

ffmpeg -f concat -safe 0 -i mylist.txt -target ntsc-dvd video.vob
2
  • Oh wow, never expected a response for this. Where exactly am I defining two targets? I ended up with a really convoluted solution that didn't use ffmpeg I believe.
    – Pejman Poh
    May 31, 2018 at 9:24
  • Maybe I misread, but you started off saying you wanted to burn to a DVD, but then used ffmpeg to encode to MPEG4 with x264. So, one is MPEG2, the other is not. :)
    – Steve Dibb
    Jun 1, 2018 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.