分割损坏的 webm 视频文件

分割损坏的 webm 视频文件

有一个 50 分钟长的 webm 视频文件,播放约 8 分钟后停止播放。由于我不需要视频的开头,因此我决定将其拆分并获取最后 30 分钟。

为此,我安装了 ffmpeg,并使用以下命令按照建议这里

ffmpeg -ss 00:20:00 -t 00:50:00 -i a.webm -acodec copy -vcodec copy b.webm

但是,当我执行此操作时,我收到以下错误消息:

Truncating packet of size 591111 to 13231
[matroska,webm @ 00000225a4ac8c00] Element at 0xb966ccb ending at 0x11ee2070 exceeds containing master element ending at 0xbc386e8
    Last message repeated 1 times
[matroska,webm @ 00000225a4ac8c00] Length 5 indicated by an EBML number's first byte 0x09 at pos 200544103 (0xbf40f67) exceeds max length 4.
[matroska,webm @ 00000225a4ac8c00] Element at 0xc4e9b68 ending at 0xc4eb1e3 exceeds containing master element ending at 0xc4e9bb9

这是否意味着我不能分割文件,除非我修复了它?如果是这样,你能根据错误堆栈指导我修复它吗?

答案1

尝试分别转储视频和音频以隔离问题。这可能会发现您在某个点没有视频或没有音频。

将视频转换为静态图像

.\ffmpeg.exe -ss 00:20:00 -t 00:50:00 -i a.webm -an -f image2 filename%03d.jpg

提取音频

.\ffmpeg.exe -ss 00:20:00 -t 00:50:00 -i a.webm audio.mp3

相关内容