x264 encoding speed, what should my expectations be?

8,550

Well, it's only a Core 2 Duo. The i7 would perform way better of course. Having CUDA doesn't help unfortunately, since x264 doesn't have GPU support. Also, encoding h.264 is computationally way more intensive than "just" into MPEG-4 Visual DivX.

That being said, x264 is a pretty fast encoder, and here's the thing. You see the -preset slow? You're actually telling the encoder to be slow.

Presets in x264 enable different algorithmic optimizations that yield better quality for the same amount of bits spent, or, less bits spent for a fixed quality. Thus: compression efficiency. Generally, the slower the preset is, the better the optimizations will be, but the more computation time they take.

You can choose other presets, as outlined in x264 --fullhelp, such as:

  • ultrafast
  • superfast
  • veryfast
  • faster
  • fast
  • medium (default)
  • slow
  • slower
  • veryslow

Pick the one that suits best, i.e. the one you can afford waiting for.

Share:
8,550

Related videos on Youtube

Stefan
Author by

Stefan

Updated on September 18, 2022

Comments

  • Stefan
    Stefan almost 2 years

    I am running Ubuntu 10.10 (maverick) on an HP Pavillion dv3 with core2duo 2.29 GHz, NVidia Geforce G105M (512MB) with CUDA and 4GB RAM. I have the latest versions of ffmpeg and x264.

    I recognise that these aren't fantastic specs for encoding, but I am used to encoding with DIVX on a (different) single core PC with approx 2GHz processor, and being able to convert 10+ hour-long TV episodes overnight.

    I have just started encoding with x264 and ffmpeg on the above HP laptop, and I was astounded to find a single 2 hr film taking 22 hrs to encode!

    The command-Line I used was:

    ffmpeg -i infile.mpg -vcodec libx264 -preset slow -profile normal -crf 24 -threads 0 outfile.mp4
    

    Is this normal or do I have a bottleneck somewhere?

    Thanks

  • afrazier
    afrazier over 12 years
    +1 for pointing out that the user is using -preset slow!
  • slhck
    slhck over 12 years
    Oh, and btw your command line looks great so far, I'd only change profile to profile:v, since profile itself can be ambiguous and is often interpreted for audio. Don't ask why.
  • Stefan
    Stefan over 12 years
    Thank you for your prompt reply. A very clear and concise answer - it didn't occur to me that setting the preset to slow would make that much of a difference. I'm doing some testing now with the different presets.
  • Macho Matt
    Macho Matt over 12 years
    You may want to consider encoding just part of the source file at different speeds to gauge quality. To do that, add -t <seconds> to your command.