Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running KUbuntu 11.10 Linux.

I would like to extract a clip from an MP4 file. I tried this command:

myCLIPrompt:~/Downloads/temp/clips$ mencoder -ss 00:43:13 -endpos 00:02:12 -oac copy -ovc copy The.Original.Video.\[VTV\].mp4 -o TheClip.mp4

and I got this error message:

MEncoder SVN-r33713-4.6.1 (C) 2000-2011 MPlayer Team

success: format: 0  data: 0x0 - 0x19148a83
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  720x404  24bpp  29.970 fps  843.8 kbps (103.0 kbyte/s)
[V] filefmt:44  fourcc:0x34363248  size:720x404  fps:29.970  ftime:=0.0334
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 143.0 kbit/9.31% (ratio: 17880->192000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
videocodec: framecopy (720x404 24bpp fourcc=34363248)
Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.


How do I do it the correct way?

Thanks in advance


share|improve this question

Use avconv. For example, if you'd like to extract a clip of duration 10s starting at 15s, then you'd use

avconv -i input.mp4 -ss 00:00:15 -t 00:00:10 -codec copy output.mp4

There are a lot more options that you can play with, like specifying the resolution, output format etc. See the man page of avconv for all the options.

If you happen to have ffmpeg you can use

ffmpeg -i input.mp4 -ss 00:00:15 -t 00:00:10 -c:v copy -c:a copy output.mp4 
share|improve this answer
The second one worked for me. I don't have avconv in my system. When I Googled how to install it I saw something about having to compile it. Does it do anything that ffmpeg doesn't to justify the trouble? – user787832 Jul 7 '12 at 19:07
ffmpeg is now deprecated. It is not developed anymore and is there on 12.04 only for compatibility. – abhshkdz Jul 7 '12 at 19:17
Good to know, I'll switch to avcconv when there is a compiled version to download. Thanks for the good info. – user787832 Jul 7 '12 at 19:42
@abhshkdz FFmpeg is not deprecated. It is actively developed. Where did you get that info from? The Ubuntu package message is simply wrong. See here: Bug #939863 “Warning message from ffmpeg program needs update” – slhck Jul 11 '12 at 17:03
For me it wouldn't work unless I put the -i inputfile argument first, and then the -ss -t arguments in the middle, and then the outputfile... SO: avconv -i input.mp4 -ss 00:00:15 -t 00:00:10 -codec copy output.mp4 – hwjp Oct 23 '14 at 10:34
up vote 2 down vote accepted

Googling around my ffmpeg command should have been more like this

ffmpeg -i InputFile -ss StartTime -t Duration Outputfiless
ffmpeg -i input.mp4 -ss 00:07:38 -t 00:07:36 output.mp4

-ss being the time in the video to start the clip at, -t the duration of the clip. Never use more than 60 units for minutes or seconds. For example if the duration is 6 minutes and 62 seconds write 07:02, for seven minutes and two seconds

I got on the ffmpeg-users GNUMailman email list. I was told that the Ubuntu family of distributions uses an old, buggy, unsupported port of ffmpeg.

I was told that if I wanted ffmpeg to work on even the latest Ubuntu family distribution I would need to get the source code directly from the ffmpeg project, compile and set it up myself.



share|improve this answer
Just want to note: this work on the HomeBrew version of ffmpeg on Mac OS/X Mountain Lion as well. – tamouse Sep 24 '13 at 5:49

You must log in to answer this question.

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