2

I am trying to extract a subclip from a webm file and write to an mp4 fil. I have the following command line:

ffmpeg -ss 560 -i input.webm -ss 20 -t 46 -acodec copy -vcodec copy output.mp4

but I get the following error:

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                                                    

The strange thing is that the following works well for extracting files from mp4 to mp4

ffmpeg -ss 560 -i input.mp4 -ss 20 -t 46 -acodec copy -vcodec copy output.mp4

1 Answer 1

6

... codec not currently supported in container

An MP4 container won't accept VP8 video and Vorbis audio streams (-acodec copy -vcodec copy). To test this, change the output filename to output.mkv or output.webm and the job will work. If the output container must be MP4, you'll need to transcode at some point.

2
  • Thanks! I thought ffmpeg would automatically transcode it if it has to. Do I need to download/build a particular codec to do this? Where I can I find it? Jun 19, 2013 at 15:18
  • 1
    It will transcode based simply on output filename (though you may want more control than that). Here, the arguments -acodec copy -vcodec copy tell ffmpeg not to transcode the video and audio streams (to copy them as-is), so all it tries to do is remux them into an MP4 container, which fails. Remove those arguments and you'll get a result closer to what you expect. Jun 19, 2013 at 17:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .