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 server which has:

  • 8x3,4 (sandy bridge cpu)
  • 10gb ram

i tried different combinations to convert vvideos i mean avi to mp4 but it takes so long: - ~20mins=~200mb

maybe there is some ffmpeg command which does this much faster?

EDIT WITH ULTRAFAST:

root@1tb:~/test# ffmpeg -i video.avi -c:v libx264 -preset ultrafast out.mp4
ffmpeg version git-2013-10-28-f1f0b01 Copyright (c) 2000-2013 the FFmpeg developers
  built on Oct 29 2013 02:05:45 with gcc 4.4.5 (Debian 4.4.5-8)
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab
  libavutil      52. 48.100 / 52. 48.100
  libavcodec     55. 39.100 / 55. 39.100
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, avi, from 'video.avi':
  Duration: 00:29:00.28, start: 0.000000, bitrate: 1120 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 128 kb/s
    Metadata:
      title           : Hello.Ladies.S01E06.HDTV.XviD-AFG_360p.audio
[libx264 @ 0x2e08e40] using SAR=1/1
[libx264 @ 0x2e08e40] using cpu capabilities: none!
[libx264 @ 0x2e08e40] profile Constrained Baseline, level 3.0
[libx264 @ 0x2e08e40] 264 - core 138 r2358 9e941d1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=23 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 10000k tbn, 23.98 tbc
    Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s
    Metadata:
      title           : Hello.Ladies.S01E06.HDTV.XviD-AFG_360p.audio
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> libx264)
  Stream #0:1 -> #0:1 (mp3 -> libfaac)
Press [q] to stop, [?] for help
frame=41726 fps=326 q=-1.0 Lsize=  312916kB time=00:29:00.32 bitrate=1473.0kbits/s dup=1 drop=0
video:284876kB audio:27186kB subtitle:0 global headers:0kB muxing overhead 0.273494%
[libx264 @ 0x2e08e40] frame I:167   Avg QP:18.69  size: 30492
[libx264 @ 0x2e08e40] frame P:41559 Avg QP:21.68  size:  6897
[libx264 @ 0x2e08e40] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x2e08e40] mb P  I16..4:  6.3%  0.0%  0.0%  P16..4: 51.2%  0.0%  0.0%  0.0%  0.0%    skip:42.5%
[libx264 @ 0x2e08e40] coded y,uvDC,uvAC intra: 44.9% 54.5% 19.0% inter: 28.1% 20.3% 2.2%
[libx264 @ 0x2e08e40] i16 v,h,dc,p: 43% 23% 21% 13%
[libx264 @ 0x2e08e40] i8c dc,h,v,p: 36% 22% 32% 11%
[libx264 @ 0x2e08e40] kb/s:1340.96
root@1tb:~/test# qt-faststart out.mp4 labas1.mp4
ftyp          0 32
free         32 8
mdat         40 319552104
moov  319552144 873943
 patching stco atom...
 patching stco atom...
 writing ftyp atom...
 writing moov atom...
 copying rest of file...
root@1tb:~/test#
share|improve this question

migrated from stackoverflow.com Nov 5 '13 at 7:25

This question came from our site for professional and enthusiast programmers.

    
If u have good server and u wanna really fast convert files i discovered simple solution, that will help u convert any mp4 file i used 300mb file in 1 min: ffmpeg -i input.avi -c:v libx264 -preset ultrafast out.mp4 –  user2938660 Nov 5 '13 at 0:09
    
Please include your ffmpeg command and the complete console output. –  LordNeckbeard Nov 5 '13 at 0:26
    
i edited my post –  user2938660 Nov 5 '13 at 1:09
    
Did you compile x264 with --disable-asm? See output of x264 --version. –  LordNeckbeard Nov 5 '13 at 1:29
    
yes i disabled asm –  user2938660 Nov 5 '13 at 1:40

1 Answer 1

I don't see "-enable-pthread" in the ffmpeg output. build ffmpeg and x264 with that option (+ asm support) and you will be able to run faster.

note that if you add

  -threads 0

in your ffmpeg command line, the process split the workload over all your core (check CPU usage during a run to see the difference ...)

share|improve this answer
1  
--enable-pthread is automatically determined so it does not need to be declared, and -threads 0 is default with libx264. –  LordNeckbeard Nov 5 '13 at 7:59

Your Answer

 
discard

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