1

I want to convert a mkv formatted video to mp4, using the ffmpeg application. and for that I ran below command in terminal:

ffmpeg -y -i c38a4990774b3c23.mkv -c:v libx264 -c:a aac -r 25 -strict -2 -map_metadata -1 -movflags faststart -vf "crop=1920:800:0:4, scale=iw*min(426/iw\,240/ih):ih*min(426/iw\,240/ih), pad=426:240:(426-iw*min(426/iw\,240/ih))/2:(240-ih*min(426/iw\,240/ih))/2, setsar=sar=1" output.mp4

I have compiled ffmpeg with --enable-pthread configuration

when I run this command on my personal PC with a 3.2GHz quad core cpu, it uses 60% of overall cpu process and encode video with 150fps; but when I run this command on a production server with 8 2.4GHz dual core cpu (16 core) it only uses up to 20% of overall cpu process and encode video with 97fps.

I have also tried ramdisk but I got no performance improvement.

Salar
  • 5,305
  • 7
  • 50
  • 78
Amin Fazlali
  • 1,209
  • 1
  • 9
  • 17
  • 1
    You'll need to know the CPU microarchitecture of your PC and that of the production server to, at best, gain some high level insights. Also it's possible that one box is using hyperthreading (thus showing a 2x core count) whereas the other box is not, further muddying the waters. Perhaps your prod server has multi-socket Xeons, so most likely an older microarchitecture. If it has hyperthreading, then effectively only 8 cores can use SIMD. – Chris O Dec 04 '16 at 13:41
  • 1
    Adding a little to the microarchitecture comment: The most recent architectures have 512-bit SIMD whereas earlier have 256-bit (and even smaller for much earlier architectures). Are you using the same binary? See if you can find out which compiler was used in constructing the application on the server. Compilers (and versions) differ in their effectiveness in making use of newer architectural features. I believe that GNU now has AVX-512 support but that support may not be the default. – Taylor Kidd Dec 05 '16 at 16:32

0 Answers0