![哪个 FFMPEG 选项是正确的,可以修复损坏的视频流(MPEG-2 TS)?](https://linux22.com/image/927479/%E5%93%AA%E4%B8%AA%20FFMPEG%20%E9%80%89%E9%A1%B9%E6%98%AF%E6%AD%A3%E7%A1%AE%E7%9A%84%EF%BC%8C%E5%8F%AF%E4%BB%A5%E4%BF%AE%E5%A4%8D%E6%8D%9F%E5%9D%8F%E7%9A%84%E8%A7%86%E9%A2%91%E6%B5%81%EF%BC%88MPEG-2%20TS%EF%BC%89%EF%BC%9F.png)
我正在尝试修复损坏的视频流文件。(我在 Linux 上)。在谷歌搜索后,我发现了一些 FFMPEG 选项。请有人解释一下这些选项之间的区别以及哪一个是最好的和面向未来的。
# 1. This -ignore_unknown?
ffmpeg -i Video_corrupted.mp4 -map 0 -ignore_unknown -c copy video_repaired.ts
# 2. This -copy_unknown?
ffmpeg -i Video_corrupted.mp4 -map 0 -copy_unknown -c copy video_repaired.ts
# 3. This -err_detect ignore_err?
ffmpeg -err_detect ignore_err -i Video_corrupted.mp4 -c copy video_repaired.ts
答案1
如果你收到以下错误
[matroska @ 0000023ccef9d980] Timestamps are unset in a packet for stream 0.
This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[matroska @ 0000023ccef9d980] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
尝试这个:
ffmpeg -fflags +genpts -i input.mkv -c copy repaired.mkv
看如何摆脱 ffmpeg pts 没有值错误关于超级用户。