You are not logged in.

#26 2023-03-10 23:50:15

Cvlc
Member
Registered: 2020-03-26
Posts: 273

Re: FFmpeg and oneVPL-intel-gpu (or quicksync)

Hmm. The default package still seems to have --enable-libmfx :
https://github.com/archlinux/svntogit-p … k/PKGBUILD

Or I am not looking in the right place ?

I don't think the switch has been made yet :
https://bugs.archlinux.org/task/77760?p … ing=ffmpeg

Last edited by Cvlc (2023-03-10 23:52:28)

Offline

#27 2023-04-12 04:40:53

ico
Member
Registered: 2011-01-25
Posts: 35

Re: FFmpeg and oneVPL-intel-gpu (or quicksync)

Sorry, for the delayed response. I haven't spent time looking into specific details, but I can focus on what works. ffmpeg might still be using MFX, but I don't care as long as QuickSync + ICQ works.

ffmpeg 6.0 and Linux kernel 6.2 from default repos.

Output: ffmpeg -loglevel verbose -i BigBuckBunny_2000h264.mp4 -c:v h264_qsv -global_quality 18 -rdo 1 -preset:v slow -y output.mp4

h264 @ 0x55f0f56d9100] Reinit context to 3840x2160, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 0x55f0f56dc400] w:3840 h:2160 pixfmt:yuv420p tb:1/24000 fr:24/1 sar:0/1
[auto_scale_0 @ 0x55f0f56deac0] w:iw h:ih flags:'' interl:0
[format @ 0x55f0f56dcdc0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'
[auto_scale_0 @ 0x55f0f56deac0] w:3840 h:2160 fmt:yuv420p sar:0/1 -> w:3840 h:2160 fmt:nv12 sar:0/1 flags:0x00000004
[h264_qsv @ 0x55f0f56f9080] Encoder: input is system memory surface
[h264_qsv @ 0x55f0f56f9080] Use Intel(R) Media SDK to create MFX session, the required implementation version is 1.1
[AVHWDeviceContext @ 0x55f0f56d2880] Trying to use DRM render node for device 0, with matching kernel driver (i915).
[AVHWDeviceContext @ 0x55f0f56d2880] libva: VA-API version 1.19.0
[AVHWDeviceContext @ 0x55f0f56d2880] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x55f0f56d2880] libva: Trying to open /usr/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x55f0f56d2880] libva: Found init function __vaDriverInit_1_19
[AVHWDeviceContext @ 0x55f0f56d2880] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55f0f56d2880] Initialised VAAPI connection: version 1.19
[AVHWDeviceContext @ 0x55f0f56d2880] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.2.0 (36275b060).
[AVHWDeviceContext @ 0x55f0f56d2880] Driver not found in known nonstandard list, using standard behaviour.
[h264_qsv @ 0x55f0f56f9080] Initialized an internal MFX session using hardware accelerated implementation
[h264_qsv @ 0x55f0f56f9080] Using the intelligent constant quality (ICQ) ratecontrol method
[h264_qsv @ 0x55f0f56f9080] MFMode:2
[h264_qsv @ 0x55f0f56f9080] profile: avc high; level: 51
[h264_qsv @ 0x55f0f56f9080] GopPicSize: 256; GopRefDist: 4; GopOptFlag: closed; IdrInterval: 0
[h264_qsv @ 0x55f0f56f9080] TargetUsage: 3; RateControlMethod: ICQ
[h264_qsv @ 0x55f0f56f9080] ICQQuality: 18
[h264_qsv @ 0x55f0f56f9080] NumSlice: 1; NumRefFrame: 3
[h264_qsv @ 0x55f0f56f9080] RateDistortionOpt: ON
[h264_qsv @ 0x55f0f56f9080] RecoveryPointSEI: OFF
[h264_qsv @ 0x55f0f56f9080] VDENC: ON
[h264_qsv @ 0x55f0f56f9080] Entropy coding: CABAC; MaxDecFrameBuffering: 3
[h264_qsv @ 0x55f0f56f9080] NalHrdConformance: OFF; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: OFF
[h264_qsv @ 0x55f0f56f9080] FrameRateExtD: 1; FrameRateExtN: 24 
[h264_qsv @ 0x55f0f56f9080] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[h264_qsv @ 0x55f0f56f9080] MaxFrameSize: 6220800; MaxSliceSize: 0
[h264_qsv @ 0x55f0f56f9080] BitrateLimit: OFF; MBBRC: ON; ExtBRC: OFF
[h264_qsv @ 0x55f0f56f9080] Trellis: auto
[h264_qsv @ 0x55f0f56f9080] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: 2x
[h264_qsv @ 0x55f0f56f9080] AdaptiveI: OFF; AdaptiveB: OFF; BRefType:pyramid
[h264_qsv @ 0x55f0f56f9080] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[h264_qsv @ 0x55f0f56f9080] DisableDeblockingIdc: 0 
[h264_qsv @ 0x55f0f56f9080] SkipFrame: no_skip
[h264_qsv @ 0x55f0f56f9080] PRefType: default
[h264_qsv @ 0x55f0f56f9080] TransformSkip: unknown 
[h264_qsv @ 0x55f0f56f9080] IntRefCycleDist: 0
[h264_qsv @ 0x55f0f56f9080] LowDelayBRC: OFF
[h264_qsv @ 0x55f0f56f9080] MaxFrameSizeI: 0; MaxFrameSizeP: 0
[h264_qsv @ 0x55f0f56f9080] ScenarioInfo: 0
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf60.3.100
  Stream #0:0(und): Video: h264, 1 reference frame (avc1 / 0x31637661), nv12(tv, progressive, left), 3840x2160 (0x0), q=2-31, 1000 kb/s, 24 fps, 12288 tbn (default)
    Metadata:
      creation_time   : 2014-08-25T21:09:31.000000Z
      handler_name    : 264:fps=24:fmt=h264@GPAC0.5.1-DEV-rev4807
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: N/A
EOF in input file 0 q=22.0 size=   17152kB time=00:00:06.83 bitrate=20562.4kbits/s speed=4.34x     
Terminating demuxer thread 0
No more output streams to write to, finishing.e=00:00:09.04 bitrate=21570.7kbits/s speed=4.34x    
[out#0/mp4 @ 0x55f0f56d0fc0] All streams finished
[out#0/mp4 @ 0x55f0f56d0fc0] Terminating muxer thread
[AVIOContext @ 0x55f0f56d1480] Statistics: 27726417 bytes written, 2 seeks, 109 writeouts
frame=  240 fps=105 q=25.0 Lsize=   27077kB time=00:00:09.87 bitrate=22461.9kbits/s speed=4.32x    
video:27072kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.015872%
Input file #0 (BigBuckBunny_2000h264.mp4):
  Input stream #0:0 (video): 240 packets read (2534002 bytes); 240 frames decoded; 
  Total: 240 packets (2534002 bytes) demuxed
Output file #0 (output.mp4):
  Output stream #0:0 (video): 240 frames encoded; 240 packets muxed (27722013 bytes); 
  Total: 240 packets (27722013 bytes) muxed
[AVIOContext @ 0x55f0f56bab00] Statistics: 2566888 bytes read, 2 seeks

With intel-media-driver-git from AUR, hevc_qsv + ICQ also works. Thanks to nyanmisaka's fix: https://github.com/intel/media-driver/i … 1503215312

Output: ffmpeg -loglevel verbose -i BigBuckBunny_2000h264.mp4 -c:v hevc_qsv -global_quality 18 -rdo 1 -preset:v slow -y output.mp4

[h264 @ 0x55807fa6e100] Reinit context to 3840x2160, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 0x55807fa71400] w:3840 h:2160 pixfmt:yuv420p tb:1/24000 fr:24/1 sar:0/1
[auto_scale_0 @ 0x55807fa73ac0] w:iw h:ih flags:'' interl:0
[format @ 0x55807fa71dc0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'
[auto_scale_0 @ 0x55807fa73ac0] w:3840 h:2160 fmt:yuv420p sar:0/1 -> w:3840 h:2160 fmt:nv12 sar:0/1 flags:0x00000004
[h264_qsv @ 0x55807fa8e080] Encoder: input is system memory surface
[h264_qsv @ 0x55807fa8e080] Use Intel(R) Media SDK to create MFX session, the required implementation version is 1.1
[AVHWDeviceContext @ 0x55807fa67880] Trying to use DRM render node for device 0, with matching kernel driver (i915).
[AVHWDeviceContext @ 0x55807fa67880] libva: VA-API version 1.19.0
[AVHWDeviceContext @ 0x55807fa67880] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x55807fa67880] libva: Trying to open /usr/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x55807fa67880] libva: Found init function __vaDriverInit_1_19
[AVHWDeviceContext @ 0x55807fa67880] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55807fa67880] Initialised VAAPI connection: version 1.19
[AVHWDeviceContext @ 0x55807fa67880] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.2.0 (36275b060).
[AVHWDeviceContext @ 0x55807fa67880] Driver not found in known nonstandard list, using standard behaviour.
[h264_qsv @ 0x55807fa8e080] Initialized an internal MFX session using hardware accelerated implementation
[h264_qsv @ 0x55807fa8e080] Using the intelligent constant quality (ICQ) ratecontrol method
[h264_qsv @ 0x55807fa8e080] MFMode:2
[h264_qsv @ 0x55807fa8e080] profile: avc high; level: 51
[h264_qsv @ 0x55807fa8e080] GopPicSize: 256; GopRefDist: 4; GopOptFlag: closed; IdrInterval: 0
[h264_qsv @ 0x55807fa8e080] TargetUsage: 3; RateControlMethod: ICQ
[h264_qsv @ 0x55807fa8e080] ICQQuality: 18
[h264_qsv @ 0x55807fa8e080] NumSlice: 1; NumRefFrame: 3
[h264_qsv @ 0x55807fa8e080] RateDistortionOpt: ON
[h264_qsv @ 0x55807fa8e080] RecoveryPointSEI: OFF
[h264_qsv @ 0x55807fa8e080] VDENC: ON
[h264_qsv @ 0x55807fa8e080] Entropy coding: CABAC; MaxDecFrameBuffering: 3
[h264_qsv @ 0x55807fa8e080] NalHrdConformance: OFF; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: OFF
[h264_qsv @ 0x55807fa8e080] FrameRateExtD: 1; FrameRateExtN: 24 
[h264_qsv @ 0x55807fa8e080] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[h264_qsv @ 0x55807fa8e080] MaxFrameSize: 6220800; MaxSliceSize: 0
[h264_qsv @ 0x55807fa8e080] BitrateLimit: OFF; MBBRC: ON; ExtBRC: OFF
[h264_qsv @ 0x55807fa8e080] Trellis: auto
[h264_qsv @ 0x55807fa8e080] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: 2x
[h264_qsv @ 0x55807fa8e080] AdaptiveI: OFF; AdaptiveB: OFF; BRefType:pyramid
[h264_qsv @ 0x55807fa8e080] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[h264_qsv @ 0x55807fa8e080] DisableDeblockingIdc: 0 
[h264_qsv @ 0x55807fa8e080] SkipFrame: no_skip
[h264_qsv @ 0x55807fa8e080] PRefType: default
[h264_qsv @ 0x55807fa8e080] TransformSkip: unknown 
[h264_qsv @ 0x55807fa8e080] IntRefCycleDist: 0
[h264_qsv @ 0x55807fa8e080] LowDelayBRC: OFF
[h264_qsv @ 0x55807fa8e080] MaxFrameSizeI: 0; MaxFrameSizeP: 0
[h264_qsv @ 0x55807fa8e080] ScenarioInfo: 0
Output #0, mp4, to 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf60.3.100
  Stream #0:0(und): Video: h264, 1 reference frame (avc1 / 0x31637661), nv12(tv, progressive, left), 3840x2160 (0x0), q=2-31, 1000 kb/s, 24 fps, 12288 tbn (default)
    Metadata:
      creation_time   : 2014-08-25T21:09:31.000000Z
      handler_name    : 264:fps=24:fmt=h264@GPAC0.5.1-DEV-rev4807
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: N/A
EOF in input file 0 q=22.0 size=   17152kB time=00:00:06.83 bitrate=20562.4kbits/s speed=4.35x     
Terminating demuxer thread 0
No more output streams to write to, finishing.e=00:00:09.04 bitrate=21570.7kbits/s speed=4.36x    
[out#0/mp4 @ 0x55807fa65fc0] All streams finished
[out#0/mp4 @ 0x55807fa65fc0] Terminating muxer thread
[AVIOContext @ 0x55807fa66480] Statistics: 27726417 bytes written, 2 seeks, 109 writeouts
frame=  240 fps=105 q=25.0 Lsize=   27077kB time=00:00:09.87 bitrate=22461.9kbits/s speed=4.33x    
video:27072kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.015872%
Input file #0 (BigBuckBunny_2000h264.mp4):
  Input stream #0:0 (video): 240 packets read (2534002 bytes); 240 frames decoded; 
  Total: 240 packets (2534002 bytes) demuxed
Output file #0 (output.mp4):
  Output stream #0:0 (video): 240 frames encoded; 240 packets muxed (27722013 bytes); 
  Total: 240 packets (27722013 bytes) muxed
[AVIOContext @ 0x55807fa4fb00] Statistics: 2566888 bytes read, 2 seeks

ICQ on VP9 and AV1 still doesn't work as of now.

But H264 and HEVC are enough for my use case. Time to get Jellyfin going now.

Last edited by ico (2023-04-12 04:44:02)

Offline

Board footer

Powered by FluxBB