我正在尝试从webm
文件中提取子剪辑并写入mp4
文件。我有以下命令行:
ffmpeg -ss 560 -i input.webm -ss 20 -t 46 -acodec copy -vcodec copy output.mp4
但我收到以下错误:
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 22 2013 10:42:11 with gcc 4.7.2 (GCC)
configuration: --prefix=/path/to/installations --enable-shared --enable-gpl --en
able-nonfree --enable-version3 --enable-libx264
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, matroska,webm, from '/path/to/input.webm':
Duration: 01:13:20.32, start: 0.000000, bitrate: 2006 kb/s
Stream #0:0(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 30 fp,
30 tbr, 1k tbn, 1k tbc (default)
Stream #0:1(eng): Audio: vorbis, 44100 Hz, stereo, fltp (default)
[mp4 @ 0x1493c340] track 0: could not find tag, codec not currently support
ed in container
Output #0, mp4, to '/path/to/output.mp4':
Metadata:
encoder : Lavf54.63.104
Stream #0:0(eng): Video: vp8, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-3
1, 30 fps, 90k tbn, 1k tbc (default)
Stream #0:1(eng): Audio: vorbis ([221][0][0][0] / 0x00DD), 44100 Hz, st
ereo (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): O
peration not permitted
奇怪的是,下面的方法可以很好地从中提取mp4
文件mp4
ffmpeg -ss 560 -i input.mp4 -ss 20 -t 46 -acodec copy -vcodec copy output.mp4
答案1
...
codec not currently supported in container
MP4 容器不接受 VP8 视频和 Vorbis 音频流 ( -acodec copy -vcodec copy
)。要测试这一点,请将输出文件名更改为output.mkv
或output.webm
,作业将正常运行。如果输出容器必须是 MP4,则需要在某个时候进行转码。