首页 > 解决方案 > 如何修复输出流 0:1 中的非单调 DTS;使用 ffmpeg 时

问题描述

当我使用ffmpegto convert m3u8to 时mp4,我收到一些警告,

ffmpeg -i xx.m3u8 -c copy demo.mp4

警告是

Non-monotonous DTS in output stream 0:1; previous: 3277744, current: 3276712; changing to 3277745. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:1; previous: 3277745, current: 3277736; changing to 3277746. This may result in incorrect timestamps in the output file.

我应该怎么做才能解决它?

标签: ffmpegm3u8

解决方案


你可以试试这个:

ffmpeg -i xx.m3u8 -c copy -bsf:a aac_adtstoasc demo.mp4

根据此论坛帖子,您还可以尝试:

似乎解码时间戳被破坏了。您可以尝试“-fflags +igndts”根据PTS重新生成DTS:

或者直接指向.ts文件,忽略DTS:

ffmpeg -fflags +igndts -i xx.ts -map 0:0 -map 0:2 -c:v copy -c:a copy demo.mp4

推荐阅读