由於不支持的編解碼器,FFmpeg/Avconv 無法複製字幕? (FFmpeg/Avconv unable to copy subtitles due to unsupported codec?)


問題描述

由於不支持的編解碼器,FFmpeg/Avconv 無法複製字幕? (FFmpeg/Avconv unable to copy subtitles due to unsupported codec?)

我有一個包含這些流的 mp4 文件(avconv ‑i file.mp4ffmpeg ‑i file.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 執行我的要求(即剝離音頻流並按原樣複製其餘部分)?如果是這樣,


    參考解法

    方法 1:

    For ffmpeg, first thing make sure you have a recent version (try the git snapshot).

    One thing you can try is to use the ‑copy_unknown option, but I don't think it'll help in this case.

    My hunch is that it doesn't allow some codecs in mp4. See if you don't have other errors/warnings in the console output before the final error message, like codec not currently supported in container.

    If that's the case try to write them to a mov file.

    (by its_meaergistal)

    參考文件

    1. FFmpeg/Avconv unable to copy subtitles due to unsupported codec? (CC BY‑SA 2.5/3.0/4.0)

#avconv #video #video-editing #FFmpeg






相關問題

由於不支持的編解碼器,FFmpeg/Avconv 無法複製字幕? (FFmpeg/Avconv unable to copy subtitles due to unsupported codec?)

使用“avserver”將輸入流式傳輸到流式輸出 (Stream input to stream output using 'avserver')

avconv 改變音頻文件的音量 (avconv change volume of an audio file)







留言討論