Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a web application that converts videos and splits them using FFMPEG. It was working fine until recently I noticed that the videos were taking much more time converting than they are supposed to. I ran the FFMPEG command and found that FFMPEG keeps converting after reaching the mark point.

Here is the command that I ran:

[root@myserver ~]# ffmpeg -y -ss 00:00:00.0 -t 00:01:00.0 -ar 44100 -i INPUT.wmv -qscale 5 -acodec libmp3lame -async 1 OUTPUT.flv

And here is the result that I get:

FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
 libavutil     50.15. 1 / 50.15. 1
 libavcodec    52.72. 2 / 52.72. 2
 libavformat   52.64. 2 / 52.64. 2
 libavdevice   52. 2. 0 / 52. 2. 0
 libavfilter    1.19. 0 /  1.19. 0
 libswscale     0.11. 0 /  0.11. 0
 libpostproc   51. 2. 0 / 51. 2. 0
[asf @ 0x1e7ae8b0]max_analyze_duration reached
Input #0, asf, from 'INPUT.wmv':
  Metadata:
    WMFSDKVersion   : 12.0.7601.17514
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
  Duration: 04:01:40.81, start: 5.000000, bitrate: 245 kb/s
    Stream #0.0: Audio: wmapro, 44100 Hz, stereo, flt, 96 kb/s
    Stream #0.1: Video: vc1, yuv420p, 1364x768, 30.30 fps, 29.97 tbr, 1k tbn, 29.97 tbc
Output #0, flv, to 'OUTPUT.flv':
Metadata:
    encoder         : Lavf52.64.2
    Stream #0.0: Video: flv, yuv420p, 1364x768, q=2-31, 200 kb/s, 1k tbn, 29.97 tbc
    Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
Multiple frames in a packet from stream 0
frame=   58 fps= 56 q=5.0 size=     873kB time=9.98 bitrate= 716.6kbits/s dup=0
frame=   85 fps= 55 q=5.0 size=    1197kB time=16.95 bitrate= 578.2kbits/s dup=0
frame=  114 fps= 55 q=5.0 size=    1515kB time=23.90 bitrate= 519.3kbits/s dup=0
frame=  135 fps= 53 q=5.0 size=    1817kB time=29.21 bitrate= 509.7kbits/s dup=0
frame=  155 fps= 50 q=5.0 size=    1985kB time=33.57 bitrate= 484.5kbits/s dup=0
frame=  179 fps= 50 q=5.0 size=    2417kB time=39.42 bitrate= 502.3kbits/s dup=0
frame=  203 fps= 50 q=5.0 size=    2596kB time=44.77 bitrate= 474.9kbits/s dup=0
frame=  224 fps= 49 q=5.0 size=    2886kB time=49.08 bitrate= 481.7kbits/s dup=0
frame=  253 fps= 50 q=5.0 size=    3385kB time=55.48 bitrate= 499.8kbits/s dup=0
frame=  292 fps= 52 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  339 fps= 55 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  379 fps= 57 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  441 fps= 62 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  496 fps= 65 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  542 fps= 67 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  578 fps= 67 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  612 fps= 67 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  657 fps= 68 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  710 fps= 70 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  756 fps= 71 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  801 fps= 72 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  865 fps= 74 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  922 fps= 76 q=5.0 size=    3839kB time=59.90 bitrate= 525.0kbits/s dup=0
frame=  968 fps= 76 q=5.0 Lsize=   13851kB time=60.06 bitrate=1889.3kbits/s dup=0 drop=2
video:13330kB audio:469kB global headers:0kB muxing overhead 0.372018%
Received signal 2: terminating.

Note that I had to press Ctrl+C to terminate the process; otherwise it was going to keep running until it reached the end of the original video frames.

The output video is supposed to be 1 minute long, but it's much longer, depending on how soon I press Ctrl+C; but after the 1 minute mark there is no video or audio, just a still image of the last frame of the 1 minute video.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Thanks for providing the full output. Two things about your command:

  • Your FFmpeg version is terribly old. Please download a recent static build or compile it from source. There are thousands of things that have been fixed since then. If you're on a shared hosting server you might be able to run the static build from within the directories that you have execute privileges on, or you could ask your hosting provider to supply a non-ancient version of FFmpeg.

  • -t is an output option, meaning you have to specify it after -i and before the output filename.

Try again with a recent build, and I'm sure it'll work.

Note that -async is a deprecated option and doesn't seem to be necessary in your case.

share|improve this answer
    
Do I need to uninstall the current version or is there a command to upgrade the current version? I have total control over my server. –  Karim Apr 3 '13 at 16:05
    
You won't be able to update FFmpeg through the distro's packages as they always supply older versions. The easiest way would be to download a static build for Linux, then extract that archive somewhere, and use the ffmpeg binary that comes with it, e.g. just call ~/downloads/ffmpeg instead of your server's default ffmpeg. You can of course put the binary in another directory of your choice. –  slhck Apr 3 '13 at 16:08
    
I downloaded the static build and extracted it but when I run it I get this error: FATAL: kernel too old Segmentation fault –  Karim Apr 3 '13 at 16:35
    
Of course you could try specifying the -t after -i and see if that works for your old version, e.g. [root@myserver ~]# ffmpeg -y -ar 44100 -i INPUT.wmv -t 60 -qscale 5 -acodec libmp3lame OUTPUT.flv – but if that doesn't, perhaps take that as an opportunity to upgrade your OS? What version/kernel do you have? –  slhck Apr 3 '13 at 16:40
    
2.6.18-028stab101.1 –  Karim Apr 3 '13 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.