由于不支持的编解码器,FFmpeg / Avconv无法复制字幕?

时间:2015-11-27 12:03:07

标签: video ffmpeg avconv video-editing

我有一个包含这些流(avconv -i file.mp4ffmpeg -i file.mp4)的mp4文件:

Stream #0.0(eng): Audio: aac, 48000 Hz, stereo, fltp, 125 kb/s (default)
Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s
Stream #0.2(eng): Video: h264 (Main), yuv420p, 1280x568, 4027 kb/s, PAR 1:1 DAR 160:71, 23.98 fps, 2997 tbn, 50 tbc (default)
Stream #0.3(eng): Subtitle: c608 / 0x38303663, 0 kb/s
Stream #0.4(und): Subtitle: text / 0x74786574
Stream #0.5: Video: mjpeg, yuvj420p, 667x1000 [PAR 72:72 DAR 667:1000], 90k tbn

我试图从文件中删除第一个音频流,如下所示:

avconv -i file.mp4 -map 0 -map -0:0 -codec copy file-out.mp4

# OR #

ffmpeg -i file.mp4 -map 0 -map -0:0 -codec copy file-out.mp4

问题是,我收到此错误:

Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

所以,我检查了mp4文件本身是否有问题:

avprobe file.mp4

# OR #

ffprobe file.mp4

输出结果说:

Unsupported codec with id 0 for input stream 3
Unsupported codec with id 94213 for input stream 4

我不知道这意味着什么。 (显然字幕有问题,但我从iTunes获得了视频。)

  1. 出了什么问题?

  2. 我可以简单地强制avconv / ffmpeg执行我的要求(即剥离音频流并将其余部分复制)吗?如果是这样,怎么样?

  3. 显然我在最终错误消息之前错过了控制台输出中的其他错误/警告,如@aergistal建议:

    [mp4 @ 0x2645420] Codec for stream 0 does not use global headers but container format requires global headers
    [mp4 @ 0x2645420] Codec for stream 1 does not use global headers but container format requires global headers
    [mp4 @ 0x2645420] Codec for stream 2 does not use global headers but container format requires global headers
    [mp4 @ 0x2645420] Codec for stream 3 does not use global headers but container format requires global headers
    [mp4 @ 0x2645420] Codec for stream 4 does not use global headers but container format requires global headers
    [mp4 @ 0x2645420] track 2: could not find tag, codec not currently supported in container
    

1 个答案:

答案 0 :(得分:1)

对于'?',首先要确保您拥有最新版本(尝试git snapshot)。

您可以尝试使用ffmpeg选项,但我认为在这种情况下它不会有所帮助。

我的预感是它不允许-copy_unknown中的某些编解码器。在最终错误消息之前查看控制台输出中是否有其他错误/警告,例如mp4

如果是这种情况,请尝试将它们写入codec not currently supported in container文件。