<p>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. :)</p>

<p>Assuming you want DVD still, use -target ntsc-dvd</p>

<pre><code>ffmpeg -f concat -safe 0 -i mylist.txt -target ntsc-dvd video.vob
</code></pre>

CC BY-SA 4.0
2018-05-31T09:24:05.070Z
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
CC BY-SA 4.0
2018-06-01T22:48:41.550Z
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
CC BY-SA 4.0
2018-05-30T07:05:42.483Z
2018-05-30T07:05:42.483Z
Steve Dibb
<p>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.</p>

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

<p>I started off by trying</p>

<pre><code>ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4
</code></pre>

<p>But this gave a ton of <code>Non-monotonous DTS in output stream</code> 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.</p>

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

<p>The video still has video/audio sync errors. I reduced <code>mylist.txt</code> 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 <a href="https://zerobin.net/?6c1341a801af5d16#Dy65OYV/eJAWdAgZgzi6wGWFRnkcNnsYqG2Z42fpfHc=" rel="nofollow noreferrer">here</a>.</p>

<p>The main points I assume the errors are coming from are lines such as;</p>

<pre><code>...
...
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 &lt; 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!
...
...
</code></pre>

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

<p>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?</p>

<ffmpeg><mp4>
Concat files of different encodings?
Pejman Poh
# Concat files of different encodings?

(Asked by: username_0 on 2017-09-23)

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?

**Tags:** ffmpeg, mp4


---

## 1 answers

### Answer by username_1 on 2018-05-30. Score: 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

> **Comments:**
> **username_0**: 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.  
> **username_1**: 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. :)  

---

