Linux – x264 encoding speed, what should the expectations be

conversionffmpeglinuxvideox264

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

Best Answer

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.

Related Question