Jellyfin Forum
Arc A380 QSV/HWA? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Off Topic (https://forum.jellyfin.org/f-off-topic)
+--- Forum: Self-hosting & Homelabs (https://forum.jellyfin.org/f-self-hosting-homelabs)
+--- Thread: Arc A380 QSV/HWA? (/t-arc-a380-qsv-hwa)

Pages: 1 2


RE: Arc A380 QSV/HWA? - bitmap - 2023-08-29

Well...progress? With -cq instead of -global_quality I got unrecognized option. With -crf instead of -cq I got a core dump. :-( EDIT: I'm an idiot, it's -qp, not -cq. And that resulted in a seg fault as well, so I guess I'm on to trying a jellyfin-ffmpeg solution? Not all bad, just don't know if it has all the tools I need (e.g., VMAF) by default. And compiling things on my own is always scary.

(2023-08-29, 05:31 AM)TheDreadPirate Wrote:
(2023-08-29, 05:23 AM)bitmap Wrote: When the documentation just confuses you more...

https://ffmpeg.org/ffmpeg-filters.html#crop

Yeah.  The first example is the one you suggested and I've been using.  Turns out you need to use example two....but also something else they mention in other examples but not the crop example.  Gotta add -vf.

Code:
-vf crop=w=1920:h=816:x=:0y=148

Oh yeah...the -vf was in my code I think. It's a video filter, so that has to be present. The first example should work because in reality it's the exact same as the second, it just cuts out the "names" of each value.


RE: Arc A380 QSV/HWA? - bitmap - 2023-09-04

Still no results with the swap to jellyfin-ffmpeg6. Different error though, so....progress?

Code:
bitmap@server:~$ /usr/lib/jellyfin-ffmpeg/ffmpeg -init_hw_device vaapi=va:/dev/dri/renderD129 -init_hw_device qsv=qs@va \                                                                                                                               
    -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/render/D129 \
        -i "media.mkv" \
        -map 0:v -map 0:m:language:eng \
        -c:v av1_qsv -pix_fmt p010le \
        -preset slower -global_quality:v 18 -c:a libopus -ac 2 \
        -af "pan=stereo|FL<FC+0.30*FL+0.30*BL|FR<FC+0.30*FR+0.30*BR" \
        -b:a 256k -c:s copy "media-encoded.mkv"
ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12 (Ubuntu 12.3.0-1ubuntu1~23.04)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec    60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter    9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample  4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55c8aedfc6c0] No VA display found for device /dev/dri/render/D129.
Device creation failed: -22.                                                                                                                                                                                                                               
Failed to set value '/dev/dri/render/D129' for option 'qsv_device': Invalid argument                                                                                                                                                                       
Error parsing global options: Invalid argument



RE: Arc A380 QSV/HWA? - nyanmisaka - 2023-09-04

Permission issue.

https://jellyfin.org/docs/general/administration/hardware-acceleration/intel#configure-on-linux-host

Code:
sudo usermod -aG render $USER
sudo usermod -aG video $USER



RE: Arc A380 QSV/HWA? - bitmap - 2023-09-04

Not at all, my user is part of the render (and video) group(s) already. Very familiar with that problem (been there, done that).

I ran this again in verbose mode and fixed a typo I made. Everything seems to be in order, but I'm getting different errors now and nothing I'm getting is coming from my command...

Code:
bitmap@server:~$ /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD129 -init_hw_device qsv=qs@va \                                                                                                                    
    -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD129 \
        -i "media.mkv" \
        -map 0:v -map 0:m:language:eng \
        -c:v av1_qsv -pix_fmt p010le \
        -preset slower -qp 20 -c:a libopus -ac 2 \
        -b:a 256k -c:s copy "media-enc.mkv"
<BANNER_REMOVED>
[AVHWDeviceContext @ 0x56550108e980] libva: VA-API version 1.19.0
[AVHWDeviceContext @ 0x56550108e980] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so                                                                                                                                                
[AVHWDeviceContext @ 0x56550108e980] libva: Found init function __vaDriverInit_1_19                                                                                                                                                                          
[AVHWDeviceContext @ 0x56550108e980] libva: va_openDriver() returns 0                                                                                                                                                                                        
[AVHWDeviceContext @ 0x56550108e980] Initialised VAAPI connection: version 1.19                                                                                                                                                                              
[AVHWDeviceContext @ 0x56550108e980] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).                                                                                                                                            
[AVHWDeviceContext @ 0x56550108e980] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[AVHWDeviceContext @ 0x5655010be580] Use Intel(R) oneVPL to create MFX session, API version is 2.9, the required implementation version is 1.3                                                                                                              
libva info: VA-API version 1.19.0                                                                                                                                                                                                                            
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x5655010be580] Initialize MFX session: implementation version is 2.9
[AVHWDeviceContext @ 0x565501b2f180] libva: VA-API version 1.19.0                                                                                                                                                                                            
[AVHWDeviceContext @ 0x565501b2f180] libva: User requested driver 'iHD'                                                                                                                                                                                      
[AVHWDeviceContext @ 0x565501b2f180] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so                                                                                                                                                
[AVHWDeviceContext @ 0x565501b2f180] libva: Found init function __vaDriverInit_1_19                                                                                                                                                                          
[AVHWDeviceContext @ 0x565501b2f180] libva: va_openDriver() returns 0                                                                                                                                                                                        
[AVHWDeviceContext @ 0x565501b2f180] Initialised VAAPI connection: version 1.19                                                                                                                                                                              
[AVHWDeviceContext @ 0x565501b2f180] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).                                                                                                                                            
[AVHWDeviceContext @ 0x565501b2f180] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[AVHWDeviceContext @ 0x5655020317c0] Use Intel(R) oneVPL to create MFX session, API version is 2.9, the required implementation version is 1.3                                                                                                              
<REPEATED_DRIVER_INITIALIZATION>
[AVHWDeviceContext @ 0x5655020317c0] Initialize MFX session: implementation version is 2.9
[h264 @ 0x565501226b00] Reinit context to 1920x1088, pix_fmt: yuv420p                                                                                                                                                                                        
[matroska,webm @ 0x565501724a00] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x565501724a00] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x565501724a00] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x565501724a00] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
Selecting decoder 'h264_qsv' because of requested hwaccel method qsv                                                                                                                                                                                        
<FILE_DATA_REMOVED>
[AVHWDeviceContext @ 0x565501682140] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).
[AVHWDeviceContext @ 0x565501682140] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[h264_qsv @ 0x5655013f30c0] Decoder: output is video memory surface                                                                                                                                                                                          
[h264_qsv @ 0x5655013f30c0] Use Intel(R) oneVPL to create MFX session with the specified MFX loader                                                                                                                                                          
[AVHWDeviceContext @ 0x565501619cc0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).                                                                                                                                            
[AVHWDeviceContext @ 0x565501619cc0] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[h264_qsv @ 0x5655013f30c0] Decoder: output is video memory surface                                                                                                                                                                                          
[h264_qsv @ 0x5655013f30c0] Use Intel(R) oneVPL to create MFX session with the specified MFX loader                                                                                                                                                          
There are 3 hardware devices. device __qsv_device of type qsv is picked for filters by default. Set hardware device explicitly with the filter_hw_device option if device __qsv_device is not usable for filters.                                            
[graph_1_in_0_1 @ 0x565501831fc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:5.1(side)                                                                                                                                                              
[format_out_0_1 @ 0x565501582c40] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'                                                                                                              
[auto_aresample_0 @ 0x5655014b8b00] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:flt r:48000Hz                                                                                                                                              
There are 3 hardware devices. device __qsv_device of type qsv is picked for filters by default. Set hardware device explicitly with the filter_hw_device option if device __qsv_device is not usable for filters.                                            
[graph 0 input from stream 0:0 @ 0x565501269200] w:1920 h:1080 pixfmt:qsv tb:1/1000 fr:24000/1001 sar:1/1                                                                                                                                                    
[auto_scale_0 @ 0x565501671ec0] w:iw h:ih flags:'' interl:0                                                                                                                                                                                                  
[format @ 0x5655018fef80] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'                                                                                                                                    
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'                                                                                                                                              
Error reinitializing filters!                                                                                                                                                                                                                                
Failed to inject frame into filter network: Function not implemented                                                                                                                                                                                        
Error while processing the decoded data for stream #0:0                                                                                                                                                                                                      
[libopus @ 0x56550201d3c0] 1 frames left in the queue on closing                                                                                                                                                                                            
[AVIOContext @ 0x5655014b9b40] Statistics: 0 bytes written, 0 seeks, 0 writeouts                                                                                                                                                                            
Terminating demuxer thread 0                                                                                                                                                                                                                                
[AVIOContext @ 0x56550157c600] Statistics: 5050407 bytes read, 2 seeks



RE: Arc A380 QSV/HWA? - nyanmisaka - 2023-09-04

Remove these

"-init_hw_device vaapi=vaConfused-facedev/dri/renderD129 -init_hw_device qsv=qs@va"

"-pix_fmt p010le"


RE: Arc A380 QSV/HWA? - bitmap - 2023-09-04

Will give this a try today. Is it not possible to do 8-over-10-bit conversions with av1_qsv? Also, at this point should I be putting this in a different spot like a GitHub issue for jellyfin-ffmpeg rather than here? Doesn't seem like a bug yet, but I feel bad bugging you here and really appreciate your help. This is new territory and the resources available are so extremely limited there's not really anything out there available too help troubleshoot...

EDIT: Tried without the above two options, essentially the same result. Left in slightly more information, but I don't think it adds anything. It's just another successful hardware init.

Code:
bitmap@server:~$ /usr/lib/jellyfin-ffmpeg/ffmpeg -hide_banner -v verbose \
    -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD129 \
        -i "media.mkv" \
        -map 0:v -map 0:m:language:eng \
        -c:v av1_qsv -pix_fmt p010le -preset slower -qp 20 -c:a libopus -ac 2 \
        -b:a 256k -c:s copy "media-enc.mkv"
[AVHWDeviceContext @ 0x561d2b27c140] libva: VA-API version 1.19.0
[AVHWDeviceContext @ 0x561d2b27c140] libva: User requested driver 'iHD'                                                                                                                                                                                      
[AVHWDeviceContext @ 0x561d2b27c140] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so                                                                                                                                                
[AVHWDeviceContext @ 0x561d2b27c140] libva: Found init function __vaDriverInit_1_19                                                                                                                                                                          
[AVHWDeviceContext @ 0x561d2b27c140] libva: va_openDriver() returns 0                                                                                                                                                                                        
[AVHWDeviceContext @ 0x561d2b27c140] Initialised VAAPI connection: version 1.19                                                                                                                                                                              
[AVHWDeviceContext @ 0x561d2b27c140] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).                                                                                                                                            
[AVHWDeviceContext @ 0x561d2b27c140] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[AVHWDeviceContext @ 0x561d2b27bc40] Use Intel(R) oneVPL to create MFX session, API version is 2.9, the required implementation version is 1.3                                                                                                              
libva info: VA-API version 1.19.0                                                                                                                                                                                                                            
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x561d2b27bc40] Initialize MFX session: implementation version is 2.9
[h264 @ 0x561d2b37c0c0] Reinit context to 1920x1088, pix_fmt: yuv420p                                                                                                                                                                                        
[matroska,webm @ 0x561d2b78d2c0] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x561d2b78d2c0] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x561d2b78d2c0] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x561d2b78d2c0] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
Selecting decoder 'h264_qsv' because of requested hwaccel method qsv                                                                                                                                                                                        
<FILE_DATA_REMOVED>
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_qsv) -> av1 (av1_qsv))
  Stream #0:1 -> #0:1 (dts (dca) -> opus (libopus))
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help
[AVHWDeviceContext @ 0x561d2b771400] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).
[AVHWDeviceContext @ 0x561d2b771400] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[h264_qsv @ 0x561d2bd372c0] Decoder: output is video memory surface                                                                                                                                                                                          
[h264_qsv @ 0x561d2bd372c0] Use Intel(R) oneVPL to create MFX session with the specified MFX loader                                                                                                                                                          
[AVHWDeviceContext @ 0x561d2b27b940] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).                                                                                                                                            
[AVHWDeviceContext @ 0x561d2b27b940] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[h264_qsv @ 0x561d2bd372c0] Decoder: output is video memory surface                                                                                                                                                                                          
[h264_qsv @ 0x561d2bd372c0] Use Intel(R) oneVPL to create MFX session with the specified MFX loader                                                                                                                                                          
[graph_1_in_0_1 @ 0x561d2b6d3300] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:5.1(side)                                                                                                                                                              
[format_out_0_1 @ 0x561d2c0c4200] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'                                                                                                              
[auto_aresample_0 @ 0x561d2c0c52c0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:flt r:48000Hz                                                                                                                                              
[graph 0 input from stream 0:0 @ 0x561d2bd7c140] w:1920 h:1080 pixfmt:qsv tb:1/1000 fr:24000/1001 sar:1/1                                                                                                                                                    
[auto_scale_0 @ 0x561d2bd7abc0] w:iw h:ih flags:'' interl:0                                                                                                                                                                                                  
[format @ 0x561d2b3acec0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'                                                                                                                                    
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'                                                                                                                                              
Error reinitializing filters!                                                                                                                                                                                                                                
Failed to inject frame into filter network: Function not implemented                                                                                                                                                                                        
Error while processing the decoded data for stream #0:0                                                                                                                                                                                                      
[libopus @ 0x561d2b4887c0] 1 frames left in the queue on closing                                                                                                                                                                                            
[AVIOContext @ 0x561d2bd88f80] Statistics: 0 bytes written, 0 seeks, 0 writeouts                                                                                                                                                                            
Terminating demuxer thread 0                                                                                                                                                                                                                                
[AVIOContext @ 0x561d2b47d800] Statistics: 5050407 bytes read, 2 seeks                                                                                                                                                                                      
Conversion failed!



RE: Arc A380 QSV/HWA? - bitmap - 2023-09-06

Just wanted to revisit this and say that I'm an idiot. Actually I'm just sleep-deprived and work four different jobs, so this stuff happens in bits between all the different things I do. So thank you @nyanmisaka for your help. Every time I search for help online, it's a post in a forum or on a Github issue from you helping some dumbass like me. To be fair, they're mostly more knowledgeable than I am since they're on the bleeding edge and I'm riding coattails.

I didn't remove the -pix_fmt option. I did a search before I started this morning and found a Tdarr reddit post from when the ARC cards were brand new and folks were struggling to get AV1 encoding working with the exact error message I'm getting. They found that both -pix_fmt and -profile:v options were causing issues. So I tried adding -provile:v main10 out of desperation. It failed, as expected. Then I noticed I still had the -pix_fmt option in my running document.

Wait....no...

Code:
bitmap@server:$ /usr/lib/jellyfin-ffmpeg/ffmpeg -hide_banner -v verbose \
    -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD129 \
        -i "/mnt/media/re-encode/testbed/input/media.mkv" \
        -map 0:v -map 0:m:language:eng \
        -c:v av1_qsv -preset slower -qp 20 -c:a libopus -ac 2 \
        -b:a 256k -c:s copy "/mnt/media/re-encode/testbed/output/media-AV1.mkv.mkv"
[AVHWDeviceContext @ 0x556f1b0350c0] libva: VA-API version 1.19.0
[AVHWDeviceContext @ 0x556f1b0350c0] libva: User requested driver 'iHD'                                                                                                                                                                                      
[AVHWDeviceContext @ 0x556f1b0350c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so                                                                                                                                                
[AVHWDeviceContext @ 0x556f1b0350c0] libva: Found init function __vaDriverInit_1_19                                                                                                                                                                          
[AVHWDeviceContext @ 0x556f1b0350c0] libva: va_openDriver() returns 0                                                                                                                                                                                        
[AVHWDeviceContext @ 0x556f1b0350c0] Initialised VAAPI connection: version 1.19                                                                                                                                                                              
[AVHWDeviceContext @ 0x556f1b0350c0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).                                                                                                                                            
[AVHWDeviceContext @ 0x556f1b0350c0] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[AVHWDeviceContext @ 0x556f1b034bc0] Use Intel(R) oneVPL to create MFX session, API version is 2.9, the required implementation version is 1.3                                                                                                              
libva info: VA-API version 1.19.0                                                                                                                                                                                                                            
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x556f1b034bc0] Initialize MFX session: implementation version is 2.9
[h264 @ 0x556f1b163d40] Reinit context to 1920x1088, pix_fmt: yuv420p                                                                                                                                                                                        
[matroska,webm @ 0x556f1bd98580] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x556f1bd98580] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x556f1bd98580] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
[matroska,webm @ 0x556f1bd98580] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size                                                                                                                      
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options                                                                                                                                                                
Selecting decoder 'h264_qsv' because of requested hwaccel method qsv                                                                                                                                                                                        
Input #0, matroska,webm, from '/mnt/media/re-encode/testbed/input/media.mkv':
  Metadata: [REMOVED]

Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_qsv) -> av1 (av1_qsv))
  Stream #0:1 -> #0:1 (dts (dca) -> opus (libopus))
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help
[AVHWDeviceContext @ 0x556f1bbe8bc0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).
[AVHWDeviceContext @ 0x556f1bbe8bc0] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[h264_qsv @ 0x556f1b2884c0] Decoder: output is video memory surface                                                                                                                                                                                          
[h264_qsv @ 0x556f1b2884c0] Use Intel(R) oneVPL to create MFX session with the specified MFX loader                                                                                                                                                          
[AVHWDeviceContext @ 0x556f1b123f80] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.3.2 (95dc859).                                                                                                                                            
[AVHWDeviceContext @ 0x556f1b123f80] Driver not found in known nonstandard list, using standard behaviour.                                                                                                                                                  
[h264_qsv @ 0x556f1b2884c0] Decoder: output is video memory surface                                                                                                                                                                                          
[h264_qsv @ 0x556f1b2884c0] Use Intel(R) oneVPL to create MFX session with the specified MFX loader                                                                                                                                                          
[graph_1_in_0_1 @ 0x556f1ba53cc0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:5.1(side)                                                                                                                                                              
[format_out_0_1 @ 0x556f1b26c7c0] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'                                                                                                              
[auto_aresample_0 @ 0x556f1b8d2cc0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:flt r:48000Hz                                                                                                                                              
[graph 0 input from stream 0:0 @ 0x556f1bddf7c0] w:1920 h:1080 pixfmt:qsv tb:1/1000 fr:24000/1001 sar:1/1                                                                                                                                                    
[av1_qsv @ 0x556f1b6651c0] Using input frames context (format qsv) with av1_qsv encoder.                                                                                                                                                                    
[av1_qsv @ 0x556f1b6651c0] Encoder: input is video memory surface                                                                                                                                                                                            
[av1_qsv @ 0x556f1b6651c0] Use Intel(R) oneVPL to create MFX session with the specified MFX loader                                                                                                                                                          
[av1_qsv @ 0x556f1b6651c0] Using the variable bitrate (VBR) ratecontrol method                                                                                                                                                                              
[av1_qsv @ 0x556f1b6651c0] profile: av1 main; level: 40                                                                                                                                                                                                      
[av1_qsv @ 0x556f1b6651c0] GopPicSize: 250; GopRefDist: 4; GopOptFlag:; IdrInterval: 0                                                                                                                                                                      
[av1_qsv @ 0x556f1b6651c0] TargetUsage: 2; RateControlMethod: VBR                                                                                                                                                                                            
[av1_qsv @ 0x556f1b6651c0] BufferSizeInKB: 750; InitialDelayInKB: 125; TargetKbps: 1000; MaxKbps: 1000; BRCParamMultiplier: 1                                                                                                                                
[av1_qsv @ 0x556f1b6651c0] NumRefFrame: 3                                                                                                                                                                                                                    
[av1_qsv @ 0x556f1b6651c0] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0; IntRefCycleDist: 0                                                                                                                                                          
[av1_qsv @ 0x556f1b6651c0] MaxFrameSize: 0;                                                                                                                                                                                                                  
[av1_qsv @ 0x556f1b6651c0] BitrateLimit: unknown; MBBRC: OFF; ExtBRC: unknown                                                                                                                                                                                
[av1_qsv @ 0x556f1b6651c0] VDENC: ON                                                                                                                                                                                                                        
[av1_qsv @ 0x556f1b6651c0] BRefType: pyramid                                                                                                                                                                                                                
[av1_qsv @ 0x556f1b6651c0] PRefType: default                                                                                                                                                                                                                
[av1_qsv @ 0x556f1b6651c0] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0                                                                                                                                                                  
[av1_qsv @ 0x556f1b6651c0] FrameRateExtD: 1001; FrameRateExtN: 24000                                                                                                                                                                                        
[av1_qsv @ 0x556f1b6651c0] NumTileRows: 1; NumTileColumns: 1; NumTileGroups: 1                                                                                                                                                                              
[av1_qsv @ 0x556f1b6651c0] WriteIVFHeaders: OFF                                                                                                                                                                                                              
[av1_qsv @ 0x556f1b6651c0] LowDelayBRC: OFF                                                                                                                                                                                                                  
[av1_qsv @ 0x556f1b6651c0] MaxFrameSize: 0;                                                                                                                                                                                                                  
Output #0, matroska, to '/mnt/media/re-encode/testbed/output/media-AV1.mkv':                                                                    
  Metadata: [REMOVED]

Automatically inserted bitstream filter 'pgs_frame_merge'; args=''e= 824.3kbits/s speed=5.13x  

Error while decoding stream #0:0: Invalid data found when processing input
[matroska,webm @ 0x556f1bd98580] 0x00 at pos 12498345078 (0x2e8f59c76) invalid as first byte of an EBML number                                                                                                                                              

Error while decoding stream #0:0: Invalid data found when processing input                                                                                                                                                                                  
[matroska,webm @ 0x556f1bd98580] 0x00 at pos 14859755260 (0x375b5defc) invalid as first byte of an EBML number                                                                                                                                              

EOF in input file 04 q=-0.0 size=  832000kB time=01:32:24.04 bitrate=1229.4kbits/s speed=5.18x                                                                                                                                                              
Terminating demuxer thread 0                                                                                                                                                                                                                                

[h264_qsv @ 0x556f1b2884c0] A decode call did not consume any data: expect more data at input (-10)                                                                                                                                                          
    Last message repeated 2 times                                                                                                                                                                                                                            

No more output streams to write to, finishing.
[out#0/matroska @ 0x556f1b663a00] All streams finished                                                                                                                                                                                                      
[out#0/matroska @ 0x556f1b663a00] Terminating muxer thread                                                                                                                                                                                                  
[AVIOContext @ 0x556f1bbaf400] Statistics: 854162871 bytes written, 2 seeks, 3260 writeouts                                                                                                                                                                  
frame=132917 fps=124 q=-0.0 Lsize=  834140kB time=01:32:26.54 bitrate=1232.0kbits/s speed=5.18x                                                                                                                                                              
video:657213kB audio:165383kB subtitle:8970kB other streams:0kB global headers:0kB muxing overhead: 0.309612%
Input file #0 (/mnt/media/re-encode/testbed/input/media.mkv):
  Input stream #0:0 (video): 132918 packets read (17272902706 bytes); 132917 frames decoded;                                                                                                                                                                
  Input stream #0:1 (audio): 519731 packets read (1045698772 bytes); 519731 frames decoded (266102272 samples);                                                                                                                                              
  Input stream #0:2 (audio): 205 packets read (412460 bytes);                                                                                                                                                                                                
  Input stream #0:3 (subtitle): 1218 packets read (9185094 bytes);                                                                                                                                                                                          
  Input stream #0:4 (subtitle): 0 packets read (0 bytes);                                                                                                                                                                                                    
  Input stream #0:5 (subtitle): 0 packets read (0 bytes);                                                                                                                                                                                                    
  Input stream #0:6 (subtitle): 0 packets read (0 bytes);                                                                                                                                                                                                    
  Total: 654072 packets (18328199032 bytes) demuxed                                                                                                                                                                                                          
Output file #0 (/mnt/media/re-encode/testbed/output/media-AV1.mkv):                                                                            
  Output stream #0:0 (video): 132917 frames encoded; 132917 packets muxed (672985953 bytes);                                                                                                                                                                
  Output stream #0:1 (audio): 277190 frames encoded (266102272 samples); 277191 packets muxed (169352064 bytes);                                                                                                                                            
  Output stream #0:2 (subtitle): 1218 packets muxed (9185094 bytes);                                                                                                                                                                                        
  Total: 411326 packets (851523111 bytes) muxed                                                                                                                                                                                                              
[AVIOContext @ 0x556f1b6237c0] Statistics: 19393601045 bytes read, 5 seeks

Goddammit.

Gonna try a few more things (wanna check on other options available and try to break things) as well as figure out how to write metadata for things as I'm encoding, as I truly hate having incorrect stream information when I've re-encoded something.

Bottom line? This 19 GB+ remux came down to 815 MB in AV1 OPUS stereo at QP 20. I need to watch and verify it's not awful quality, may try a few other options that are *supposedly* available, but this was pretty stable at about 5.25x speed, which is pretty awesome. I need to see if I can get this working with ab-av1 as well...I don't think so, since I don't have VMAF compiled with jellyfin-ffmpeg but I could make that happen. It's always something stupid when you're at the one-yard line...


RE: Arc A380 QSV/HWA? - bitmap - 2023-09-13

Okay, an update. I posted a bit in the other topic, but this is dedicated to AV1. I'm refining my tactics and have a bit of a template going on...I'm going with two-pass ABR since that's about all I can get to work with av1_qsv at the moment and it gives me the best bang for my buck with a variety of different media. Quick and dirty script:

Code:
# input file path
MEDIA="/path/to/media.mkv" && \
# output file template without extras or file extension
OUTPUT="/path/to/media" && \
# clean title (optional)
CLNTTL=""
# quality indicator
QUALITY="Bluray" && \
# resolution indicator
RES="2160p" && \
# release group indicator
GRP="bitmap" && \
# audio language(s)
LNG="EN" && \
# subtitle languages
SUBS="EN" && \
# video bit rate
BV="10M" && \
# max vid bit rate
MRATE="20M" && \
# vid buffer size
BSIZE="40M" && \
# English audio stream index
ENAUD="0" && \
# English subtitle stream index
ENSUB="0" && \
# Additional mappings (use full -map [input]:[stream-type]:[index] syntax)
ADDMP="-map 0:a:1 -map 0:s:2" && \
ffmpeg -y -hide_banner -v quiet -stats \
    -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD129 \
    -i "${MEDIA}" -pass 1 -map 0:v -c:v av1_qsv -preset slower -an -sn \
    -b:v "${BV}" -maxrate:v "${MRATE}" -bufsize:v "${BSIZE}" \
    -look_ahead 1 -look_ahead_depth 100 \
    "${OUTPUT} [${QUALITY}-${RES} AV1 OPUS 2.0+5.1][${LNG][${SUBS}]-${GRP}.mkv" && \
ffmpeg -y -hide_banner \
    -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD129 \
    -i "${MEDIA}" -pass 2 -map 0:v:0 \
    -map 0:a:"${ENAUD}" -map 0:a:"${ENAUD}" -map 0:a:"${ENSUB}" \
    "${ADDMP}" \
    -c:v av1_qsv -preset slower -look_ahead 1 -look_ahead_depth 100 \
    -b:v "${BV}" -maxrate:v "${MRATE}" -bufsize:v "${BSIZE}" \
    -c:a libopus -ac:a:0 2 -b:a:0 192k -ac:a:1 6 -b:a:1 256k \
    -filter:a:0 "pan=stereo|FL<FC+0.30*FL+0.30*BL|FR<FC+0.30*FR+0.30*BR" \
       -c:s copy
       -metadata title="${CLNTTL} | ${GRP}" \
       -metadata:s:v:0 title='AV1 "${RES}" "${BV}" ABR' \
       -metadata:s:a:0 title='English OPUS Stereo Dialog Mix' \
       -metadata:s:a:1 title='English OPUS 5.1' \
       -metadata:s:s:0 title='English' \
       -metadata:s:s:1 title='English (SDH)' \
       "${OUTPUT} [${QUALITY}-${RES} AV1 OPUS 2.0+5.1][${LNG][${SUBS}]-${GRP}.mkv" && \
       rm ffmpeg2pass*

Still haven't figured out the best way to automate selection for a bunch of stuff. Beginning to reach my limits on bash scripting, partially because I'm just writing these to copy and paste into the shell. I'll probably throw together a Python script or two in the coming days to see if I can get anything working on that front with a bit more friendly UX and maybe some deeper exploration of files.