gpt4 book ai didi

ffmpeg concat 因 dts 计时错误而失败

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

我有一些视频,我试图用 ffmpeg 连接它们,它们都可以自己正常工作,但试图用这个命令连接它们:

ffmpeg -f concat -safe 0 -fflags flush_packets -fflags discardcorrupt -i ./videos.txt -c copy -an 1.mp4
这不是实时流或 mpeg-dash,它只是独立的 mp4,我想加入一个更长的视频。
这只是一个不断的错误流,如下所示:
[mp4 @ 0x5560664a1780] Non-monotonous DTS in output stream 0:0; previous: 72811593, current: 4396274; changing to 72811594. This may result in incorrect timestamps in the output file.
[mp4 @ 0x5560664a1780] Non-monotonous DTS in output stream 0:0; previous: 72811594, current: 4396786; changing to 72811595. This may result in incorrect timestamps in the output file.
[mp4 @ 0x5560664a1780] Non-monotonous DTS in output stream 0:0; previous: 72811595, current: 4397298; changing to 72811596. This may result in incorrect timestamps in the output file.
[mp4 @ 0x5560664a1780] Non-monotonous DTS in output stream 0:0; previous: 72811596, current: 4397810; changing to 72811597. This may result in incorrect timestamps in the output file.

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55e9b217ab40] Dropped corrupted packet (stream = 0)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55e9b217ab40] stream 1, offset 0x402a6: partial file
./videos.txt: Invalid data found when processing input
需要明确的是,这些不是 .ts 视频,而是 mp4 视频。
Here's an example of ffprobe from
Metadata:
minor_version : 512
major_brand : isom
compatible_brands: isomiso2avc1mp41
comment : vid:v09044820000brpbed8biap950ufpcr0
encoder : Lavf58.20.100
Duration: 00:00:14.70, start: 0.000000, bitrate: 901 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 576x1024 [SAR 1:1 DAR 9:16], 830 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default)
Metadata:
handler_name : SoundHandler
另一个视频文件
  Metadata:
minor_version : 512
major_brand : isom
compatible_brands: isomiso2avc1mp41
comment : vid:v090447e0000bo8lplu9uukrbn9qbupg
encoder : Lavf58.20.100
Duration: 00:00:12.12, start: 0.000000, bitrate: 791 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 576x1024, 718 kb/s, 30 fps, 30 tbr, 1000k tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default)
Metadata:
handler_name : SoundHandler

最佳答案

所有输入必须具有相同的属性以获得最佳结果。您的帧速率和时间尺度各不相同。使输入 #1 匹配输入 #2 的示例:

ffmpeg -i 2997.mp4 -r 30 -video_track_timescale 1000k -c:a copy 30.mp4
这将摆脱 Non-monotonous DTS错误。 Invalid data found when processing input错误可能无关。

关于ffmpeg concat 因 dts 计时错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63882010/

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