gpt4 book ai didi

ffmpeg concat 在输出流中给出非单调 DTS

转载 作者:行者123 更新时间:2023-12-04 23:10:14 25 4
gpt4 key购买 nike

环境:Windows7,ffmpeg 4.2.2

copy the first 10 seconds from long.mp4 to UNO.mp4
copy sec 120 to sec 130 from long.mp4 to DUE.mp4
创建 List.txt 与
file 'C:\Users\Admin\Videos\UNO.mp4'
file 'C:\Users\Admin\Videos\DUE.mp4'
这里是两个文件的 ffprobe 输出:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'UNO.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:00:10.04, start: 0.000000, bitrate: 671 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 640x360 [SAR 1:1 DAR 16:9], 536 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : ISO Media file produced by Google Inc. Created on: 09/18/2020.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc. Created on: 09/18/2020.

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'DUE.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:00:11.96, start: 0.000000, bitrate: 657 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 640x360 [SAR 1:1 DAR 16:9], 524 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : ISO Media file produced by Google Inc. Created on: 09/18/2020.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc. Created on: 09/18/2020.
使用这两个文件作为输入
ffmpeg -f concat -safe 0 -i "C:\Users\Admin\Videos\List.txt" -c copy "C:\Users\Admin\Videos\mergedVideo.mp4"   
它输出:
mov,mp4,m4a,3gp,3g2,mj2 @ 00be7f80] Auto-inserting h264_mp4toannexb bitstream filter
nput #0, concat, from 'C:\Users\Admin\Videos\List.txt':
Duration: N/A, start: 0.000000, bitrate: 825 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 624x352 [SAR 1:1 DAR 39:22], 697 kb/s, 25 fps, 25
tbr, 90k tbn, 50 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
handler_name : SoundHandler
utput #0, mp4, to 'C:\Users\Admin\Videos\mergedVideo.mp4':
Metadata:
encoder : Lavf58.29.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 624x352 [SAR 1:1 DAR 39:22], q=2-31, 697 kb/s, 25
fps, 25 tbr, 90k tbn, 90k tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
handler_name : SoundHandler
tream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
然后是一长串:
mp4 @ 00c43c40] Non-monotonous DTS in output stream 0:0; previous: 899370, current: 720000; changing to 899371. This may result in incorrect timestamps in the output file.
最后作为最后一条消息:
rame=  552 fps=528 q=-1.0 Lsize=    2220kB time=00:00:20.01 bitrate= 908.4kbits/s speed=19.2x
ideo:1873kB audio:329kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.827539%
当我用ffplay播放输出mergedVideo.mp4时,它不会出错
这只是时间戳问题,还是丢失了一些帧或一些音频?
在后一种情况下,是否有一个参数来纠正问题,或者我必须重新编码?
(为了进一步测试,我尝试使用 avidemux 连接 UNO.mp4 和 DUE.mp4 而无需重新编码)
提前感谢大家的支持
毛里齐奥

最佳答案

首先,除非你用 -xerror 调用 FFmpeg选项(您没有)“非单调 DTS ...”消息不是错误。这只是一个警告。它只是告诉你它正在为你做什么,幸运的是它的自动调整确实适用于你的描述。
它正在进行调整,因为您正在连接和复制流,其中数据帧带有时间戳(与 WAV 或 MPEG 流不同)。 concat解复用器可能无法动态调整流数据中的时间戳(以避免来自主 ffmpeg 程序的警告/更正)。
底线。如果必须发出警告消息,请将日志级别更改为忽略警告:-loglevel error .
引用 ffmpeg.c Lines 817-834

关于ffmpeg concat 在输出流中给出非单调 DTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71247827/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com