最近使用ffmpeg合成mp4视频有了如下报错信息:
Non-monotonous DTS in output stream 0:0; previous: 21587350, current: 12740928; changing to 21587351. This may result in incorrect timestamps in the output file.

解决方法是如下:
1 | for f in ./*.mp4; do ffmpeg -i $f -q 0 "${f%.*}.mts"; done |
然后新建文本文档,可以用python新建
1 | f=open('file.txt','w') |
得到如下文件:
之后使用命令:
1 | ffmpeg -f concat -i file.txt -c copy output.mp4 |
即可
说些什么吧!