Body: <p>I'm trying to batch remux files to mp4, copying audio, video and subtitles streams. </p>
  
  <pre><code>ffmpeg -i "$file" -map 0:a:m:language:por\? -map 0:a:m:language:eng\? -map 0:s:m:language:por\? -map 0:s:m:language:eng\? -map 0:v -c:v copy -c:s mov_text -c:a copy -movflags faststart -f mp4 "${file%.*}"-remux.mp4
  </code></pre>
  
  <p>But I get lots of errors sometimes about timestamps and non-monotous DTS streams.</p>
  
  <p>Searching online I found those 2 flags here:</p>
  
  <pre><code>-fflags "+genpts" -avoid_negative_ts "make_zero"
  </code></pre>
  
  <p>But they don't fix my issue. What is the best way to fix this issues and make sure audio, subtitles and video are still in sync? Looking for something safe to apply to any input file in batch processing scripts, without re-encoding</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-21T06:53:10.493Z
Comments.Text: Nothing to do about those. Those messages indicate faulty timestamps in the input so ffmpeg does its best to correct them.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-21T07:53:39.420Z
Comments.Text: Is it safe to use the 2 flags I found? What about `+igndts` ?
Comments.UserDisplayName: Freedo
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-21T08:42:36.657Z
Comments.Text: No, genpts will generate new timestamps which will destroy original timings. avoid_negative_ts will just add a uniform offset, and not change monotonicity. igndts will also regenerate timestamps. As long as the video plays fine, I'd just ignore it.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-21T09:31:47.257Z
Comments.Text: But do you recommend using those options if I'm going to batch process thousands of files? I don't care about regenerating stuff as long it doesn't cause issues / improve stuff
Comments.UserDisplayName: Freedo
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-21T11:57:20.307Z
Comments.Text: It will cause issues if input is variable frame rate.
Comments.UserDisplayName: Gyan
Tags: <ffmpeg>
Title: Non-monotonous DTS in output stream... changing to 1 error
UserDisplayName: Freedo
ThreadText: # Non-monotonous DTS in output stream... changing to 1 error
  
  (Asked by: username_0 on 2020-05-21)
  
  I'm trying to batch remux files to mp4, copying audio, video and subtitles streams.
  
  ```
  ffmpeg -i "$file" -map 0:a:m:language:por\? -map 0:a:m:language:eng\? -map 0:s:m:language:por\? -map 0:s:m:language:eng\? -map 0:v -c:v copy -c:s mov_text -c:a copy -movflags faststart -f mp4 "${file%.*}"-remux.mp4
  
  ```
  
  But I get lots of errors sometimes about timestamps and non-monotous DTS streams.
  
  Searching online I found those 2 flags here:
  
  ```
  -fflags "+genpts" -avoid_negative_ts "make_zero"
  
  ```
  
  But they don't fix my issue. What is the best way to fix this issues and make sure audio, subtitles and video are still in sync? Looking for something safe to apply to any input file in batch processing scripts, without re-encoding
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: Nothing to do about those. Those messages indicate faulty timestamps in the input so ffmpeg does its best to correct them.  
  > **username_0**: Is it safe to use the 2 flags I found? What about `+igndts` ?  
  > **username_1**: No, genpts will generate new timestamps which will destroy original timings. avoid_negative_ts will just add a uniform offset, and not change monotonicity. igndts will also regenerate timestamps. As long as the video plays fine, I'd just ignore it.  
  > **username_0**: But do you recommend using those options if I'm going to batch process thousands of files? I don't care about regenerating stuff as long it doesn't cause issues / improve stuff  
  > **username_1**: It will cause issues if input is variable frame rate.  
  
  ---
  
  ## 0 answers
  
  