intel/intel-optimized-ffmpeg

Verified Publisher

By Intel Corporation

Updated over 1 year ago

Home of Intel-Optimized FFmpeg®

Image
Languages & Frameworks

10K+

Introduction

This is a common software stack for media transcode workload with FFmpeg. It supports x264, x265, SVT-HEVC and SVT-AV1.

Sample to run with FFmpeg command line

The sample commands are just for reference only. Please run the command according to the real scenario and replace the test stream.

Transcoding Example with x264 library

Command without NUMA affinity:

ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libx264 -preset medium -x264-params "keyint=120:min-keyint=120:sliced-threads=0:scenecut=0:asm=avx2:threads=8" -tune psnr -profile:v high -b:v 6M -maxrate 12M -bufsize 24M -r 60  -y 1080p.mp4

Command with NUMA affinity and AVX2:

numactl --membind=0 --cpunodebind=0 -- ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libx264 -preset medium -x264-params "keyint=120:min-keyint=120:sliced-threads=0:scenecut=0:asm=avx2:threads=8" -tune psnr -profile:v high -b:v 6M -maxrate 12M -bufsize 24M -r 60  -y 1080p.mp4

Command with cores binding and AVX512

numactl --membind=0 --physcpubind=0-7 -- ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libx264 -preset medium -x264-params "keyint=120:min-keyint=120:sliced-threads=0:scenecut=0:asm=avx512:threads=8" -tune psnr -profile:v high -b:v 6M -maxrate 12M -bufsize 24M -r 60  -y 1080p.mp4

Transcoding Example with x265 library

AVX512 optimized Command with NUMA socket 0 and cores number 8. x265 library support numa setting via -x265-params numa-pools=0. numactl only set the numa affinity for the ffmpeg thread(not x265 thread).

ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libx265 -preset medium -x265-params "keyint=120:min-keyint=120:scenecut=0:asm=avx512:numa-pools=0:pools=8" -tune psnr -profile:v main -b:v 6M -maxrate 12M -bufsize 24M -r 60  -y 1080p.mp4

Transcoding Example with SVT-HEVC library

ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libsvt_hevc -preset 5 -profile:v 1 -rc 1 -g 119 -sc_detection 0 -b:v 5M -maxrate 10M -bufsize 20M -y 1080P.mp4

Transcoding Example with SVT-AV1 library

ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libsvtav1  -profile:v main -rc 1 -g 119 -sc_detection 0 -b:v 4M -maxrate 8M -bufsize 16M -y 1080p.mp4
Docker Image

There are two common docker images: intel/intel-optimized-ffmpeg:avx2 and intel/intel-optimized-ffmpeg:avx3, which only contain common FFmpeg software stack and no extra benchmarking python scripts/streams.

Example to run the command with docker image for x264: with and without numa cores binding. Please mount the test stream in the folder /home/archive of docker container.

NUMA Socket 0 binding:

docker run -ti --privileged -v localpath:/home/archive ffmpeg-base-avx2:latest numactl --membind=0 --cpunodebind=0 -- ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libx264 -preset medium  -x264-params "keyint=120:min-keyint=120:sliced-threads=0:scenecut=0:asm=avx2:threads=8" -tune psnr -profile:v high -b:v 6M -maxrate 12M -bufsize 24M -r 60  -y 1080p.mp4

Cores binding:

docker run -ti --privileged -v localpath:/home/archive ffmpeg-base-avx2:latest numactl --membind=0 --physcpubind=0-7 -- ffmpeg -y -i /home/archive/crowd_run_1080p50_x264.mp4 -c:v libx264 -preset medium -x264-params "keyint=120:min-keyint=120:sliced-threads=0:scenecut=0:asm=avx512:threads=8" -tune psnr -profile:v high -b:v 6M -maxrate 12M -bufsize 24M -r 60  -y 1080p.mp4
See Also

Docker Pull Command

docker pull intel/intel-optimized-ffmpeg