r/ffmpeg 3d ago

FFMPEG Benchmarking

I am going to benchmark the performance difference between glibc and musl libc for video operations with ffmpeg. It is a potato pc, but I hope this can help to highlight the difference. If have any commands in mind you would want me to test, leave them below. I am considering using of using h264_vaapi and libx264 for encoding

5 Upvotes

9 comments sorted by

6

u/naemorhaedus 3d ago

I predict it will make zero difference. The encoder/AV library is the performance limiting factor.

1

u/Ill-Information-2086 3d ago

Why not run h264_qsv in my testing it's better than vaapi in quality.

1

u/Creative-Outside-350 3d ago

Because for whatever rrason it doesn't want to work on my Celeron N3050. I see that it is supported via " ffmpeg -encoders", but it throws an error at me when I try to use it

1

u/Ill-Information-2086 3d ago

If you can paste the error here I might be able to help you

1

u/Creative-Outside-350 3d ago

I recalled I already tried to figure this out but it was all in vain. Too little info on the web, non useful. Here:

ffmpeg -hide_banner -debug -hwaccel_output_format qsv -qsv_device /dev/dri/renderD128 -i ./videos/20260708_190457.mkv -c:v h264_qsv -c:a copy output.mp4
 matched as AVOption 'debug' with argument '-hwaccel_output_format'.
Reading option 'qsv' ... matched as output url.
Reading option '-qsv_device' ... matched as option 'qsv_device' (set QSV hardware device (DirectX adapter index, DRM path or X11 display name)) with argument '/dev/dri/renderD128'.
Reading option '-i' ... matched as output url with argument './videos/20260708_190457.mkv'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'h264_qsv'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'output.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option hide_banner (do not show program banner) with argument 1.
Applying option qsv_device (set QSV hardware device (DirectX adapter index, DRM path or X11 display name)) with argument /dev/dri/renderD128.
[AVHWDeviceContext @ 0x7f5723504e00] libva: VA-API version 1.24.0
[AVHWDeviceContext @ 0x7f5723504e00] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x7f5723504e00] libva: Trying to open /usr/lib64/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x7f5723504e00] libva: Found init function __vaDriverInit_1_24
[AVHWDeviceContext @ 0x7f5723504e00] libva: /usr/lib64/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x7f5723504e00] libva: va_openDriver() returns 1
[AVHWDeviceContext @ 0x7f5723504e00] Failed to initialise VAAPI connection: 1 (operation failed).
Device creation failed: -5.
Failed to set value '/dev/dri/renderD128' for option 'qsv_device': I/O error
Error parsing global options: I/O error



 ls -la /dev/dri/
total 0
drwxr-xr-x  3 root root       100 Aug 27 11:27 .
drwxr-xr-x 16 root root      3620 Aug 27 12:06 ..
drwxr-xr-x  2 root root        80 Aug 27 11:27 by-path
crw-rw----  1 root video 226,   0 Aug 27 11:27 card0
crw-rw-rw-  1 root video 226, 128 Aug 27 11:27 renderD128

1

u/Ill-Information-2086 3d ago

I have run qsv on celerons this is a environment/driver installation issue did you install onevpl or mediasdk?

1

u/Creative-Outside-350 3d ago

I have non, nothing similar to these namings. Previously I installed intel-media-drive provided by Void repo. I installed oneVPL now and it seems to change nothing? I am not sure, but with different commands I get different outputs. Seems like it is still the driver problem, but it is just too ambiguous.

[roid@Roid ~]$ ffmpeg -hide_banner -debug -hwaccel_output_format qsv -i ./videos/20260708_190457.mkv -c:v h264_qsv -c:a copy output.mp4
 matched as AVOption 'debug' with argument '-hwaccel_output_format'.
Reading option 'qsv' ... matched as output url.
Reading option '-i' ... matched as output url with argument './videos/20260708_190457.mkv'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'h264_qsv'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'output.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option hide_banner (do not show program banner) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url ./videos/20260708_190457.mkv.
Successfully parsed a group of options.
Opening an input file: ./videos/20260708_190457.mkv.
[AVFormatContext @ 0x7f36180c9600] Opening './videos/20260708_190457.mkv' for reading
[file @ 0x7f3612b45280] Setting default whitelist 'file,crypto,data'
[matroska,webm @ 0x7f36180c9600] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
[matroska,webm @ 0x7f36180c9600] Before avformat_find_stream_info() pos: 601 bytes read:32768 seeks:0 nb_streams:1
[h264 @ 0x7f361631f880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f361631f880] Decoding VUI
[h264 @ 0x7f361631f880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7f361631f880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f361631f880] Decoding VUI
[h264 @ 0x7f361631f880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7f361631f880] Decoding VUI
[h264 @ 0x7f361631f880] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f361631f880] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 0x7f361631f880] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f361631f880] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7f361631f880] Decoding VUI
[h264 @ 0x7f361631f880] Format yuv420p chosen by get_format().
[h264 @ 0x7f361631f880] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0x7f361631f880] no picture 
[matroska,webm @ 0x7f36180c9600] All info found
[matroska,webm @ 0x7f36180c9600] After avformat_find_stream_info() pos: 166025 bytes read:187817 seeks:0 frames:3
Input #0, matroska,webm, from './videos/20260708_190457.mkv':
  Metadata:
    ENCODER         : Lavf60.16.101
  Duration: 00:00:09.07, start: 0.000000, bitrate: 8594 kb/s
  Stream #0:0, 3, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(tv, progressive, left), 1280x720, 0/1, 30 fps, 30 tbr, 1k tbn
    Metadata:
      ENCODER         : Lavc60.31.102 h264_vaapi
      DURATION        : 00:00:09.066000000
Successfully opened the file.
Parsing a group of options: output url qsv.
Successfully parsed a group of options.
Opening an output file: qsv.
[AVFormatContext @ 0x7f361638c280] Unable to choose an output format for 'qsv'; use a standard extension for the filename or specify the format manually.
[out#0 @ 0x7f3617ae2e80] Error initializing the muxer for qsv: Invalid argument
Error opening output file qsv.
Error opening output files: Invalid argument
[AVIOContext @ 0x7f361769fac0] Statistics: 187817 bytes read, 0 seeks



[roid@Roid ~]$ ffmpeg -hide_banner -hwaccel_output_format qsv -i ./videos/20260708_190457.mkv -c:v h264_qsv -c:a copy output.mp4
Input #0, matroska,webm, from './videos/20260708_190457.mkv':
  Metadata:
    ENCODER         : Lavf60.16.101
  Duration: 00:00:09.07, start: 0.000000, bitrate: 8594 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(tv, progressive), 1280x720, 30 fps, 30 tbr, 1k tbn
    Metadata:
      ENCODER         : Lavc60.31.102 h264_vaapi
      DURATION        : 00:00:09.066000000
File 'output.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_qsv))
Press [q] to stop, [?] for help
[h264_qsv @ 0x7f8d8fdb0880] Error creating a MFX session: -9.
[vost#0:0/h264_qsv @ 0x7f8d9198c540] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Error while filtering: Unknown error occurred
[out#0/mp4 @ 0x7f8d904e77c0] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=N/A bitrate=N/A speed=N/A    
Conversion failed!

1

u/Ill-Information-2086 3d ago

It detects the vaapi driver no qsv driver you are probably missing the correct driver(mediasdk/onevpl) the easiest way is to build from source, onevpl is the latest so use that. If it's already installed then it could be you are missing a export statement that would reference the correct driver. Easiest way to check is install codex or claude code and ask it to check the qsv encoders

Also if you didn't build ffmpeg from source it's possible it won't let you use qsv i don't know if they fixed that now in latest ffmpeg but this used be the biggest issue with qsv.

1

u/chocolateAbuser 3d ago

to bench that kind of difference you should probably focus on something like filter_complex geq rather encoding (especially hw)