Re: [FFmpeg-trac] #10856(undetermined:new): Regression: VA-API + QSV transcoding fail, with large number of errors

2024-02-12 Thread FFmpeg
#10856: Regression: VA-API + QSV transcoding fail, with large number of errors
-+-
 Reporter:  eero-t   |Owner:  (none)
 Type:  defect   |   Status:  new
 Priority:  important|Component:
 |  undetermined
  Version:  git-master   |   Resolution:
 Keywords:  regression   |   Blocked By:
 Blocking:   |  Reproduced by developer:  0
Analyzed by developer:  0|
-+-
Comment (by eero-t):

 FYI: During this same time period, I've had also Intel {{{media-driver}}}
 update with the  following new commits:
 {{{
 $ git log --format=oneline
 
eab411768e61a46e096793291f5f992eecf76cd8...a3c3b6ec43ba71aa8d0701df4d052be08adae107
 a3c3b6ec43ba71aa8d0701df4d052be08adae107 [Script] Add workflow permissions
 b7d3727aedc1279a87077bade5c1ba58137b8751 [Media Common] Bump up version to
 24.1.3
 0f10db04d6582a6d909f6c641cc6f4d5200eead0 media_libva_decoder: don't return
 early
 288df99b2da41e48ea928b6f2d8eca2e5b6e408b [Media Common] [VP] HW swizzling
 rework on new platforms
 878d16175637dc369e68e1ebad57c77a2f273572 [VP] Enable Preemption
 55d1e8bceb0f8d3a4b1f128bb938a8506e5c5718 [Encode] Improve effiiciency of
 Fast Dump usage
 f3e38626762ddb1db62b8ab66d392f885342868a [Decode] Add the surface format
 check for jpeg decode in Linux
 e33ab705259cb12901c6a930efa17e4eb5ea660e [Decode] refine the MMIO reg
 report logical for AV1
 f5bc040244e88bd7651dde254ca6f0fb90c42acf [Media Interface] fix mem leak on
 g12_lp
 }}}

 But as MSDK transcoding tool works still fine for the same transcoding
 operations as what are done with FFmpeg, that's unlikely to affect this.
-- 
Ticket URL: 
FFmpeg 
FFmpeg issue tracker___
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-trac] #10856(undetermined:new): Regression: VA-API + QSV transcoding fail, with large number of errors

2024-02-12 Thread FFmpeg
#10856: Regression: VA-API + QSV transcoding fail, with large number of errors
-+-
 Reporter:  eero-t   |Owner:  (none)
 Type:  defect   |   Status:  new
 Priority:  important|Component:
 |  undetermined
  Version:  git-master   |   Resolution:
 Keywords:  regression   |   Blocked By:
 Blocking:   |  Reproduced by developer:  0
Analyzed by developer:  0|
-+-
Comment (by eero-t):

 Before the problematic commit(s), output looked like this:
 {{{
 ffmpeg version N-113425-gac06190a5a Copyright (c) 2000-2024 the FFmpeg
 developers
   built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
   configuration: --prefix=/opt/install/Nightly_3469 --enable-libmfx
 --enable-vaapi --enable-sdl2 --disable-libx265 --disable-libx264
 --disable-libvpx --enable-libvorbis --enable-libopus --disable-libmp3lame
 --disable-libass --disable-sndio --enable-libfreetype --enable-gpl
 --disable-doc
   libavutil  58. 36.101 / 58. 36.101
   libavcodec 60. 38.100 / 60. 38.100
   libavformat60. 20.100 / 60. 20.100
   libavdevice60.  4.100 / 60.  4.100
   libavfilter 9. 17.100 /  9. 17.100
   libswscale  7.  6.100 /  7.  6.100
   libswresample   4. 13.100 /  4. 13.100
   libpostproc57.  4.100 / 57.  4.100
 -vsync is deprecated. Use -fps_mode
 [AVHWDeviceContext @ 0x55c971633dc0] libva: VA-API version 1.21.0
 [AVHWDeviceContext @ 0x55c971633dc0] libva: User requested driver 'iHD'
 [AVHWDeviceContext @ 0x55c971633dc0] libva: Trying to open
 /opt/install/Nightly_3469/lib/dri/iHD_drv_video.so
 [AVHWDeviceContext @ 0x55c971633dc0] libva: Found init function
 __vaDriverInit_1_21
 [AVHWDeviceContext @ 0x55c971633dc0] libva: va_openDriver() returns 0
 [AVHWDeviceContext @ 0x55c971633dc0] Initialised VAAPI connection: version
 1.21
 [AVHWDeviceContext @ 0x55c971633dc0] VAAPI driver: Intel iHD driver for
 Intel(R) Gen Graphics - 24.1.2 (eab411768).
 [AVHWDeviceContext @ 0x55c971633dc0] Driver not found in known nonstandard
 list, using standard behaviour.
 [AVHWDeviceContext @ 0x55c9716338c0] Use Intel(R) Media SDK to create MFX
 session, API version is 1.35, the required implementation version is 1.3
 [AVHWDeviceContext @ 0x55c9716338c0] Initialize MFX session:
 implementation version is 1.35
 [h264 @ 0x55c97171b9c0] Reinit context to 1280x720, pix_fmt: yuv420p
 [h264 @ 0x55c97171a340] max_analyze_duration 50 reached at 52
 microseconds st:0
 Input #0, h264, from 'input/1280x720p_29.97_10mb_h264_cabac.264':
   Duration: N/A, bitrate: N/A
   Stream #0:0: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709,
 progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 59.94 tbr, 1200k
 tbn
 [out#0/h264 @ 0x55c97171fc40] No explicit maps, mapping streams
 automatically...
 [vost#0:0/h264_qsv @ 0x55c9717202c0] Created video stream from input
 stream 0:0
 [h264_mp4toannexb @ 0x55c9718180c0] The input looks like it is Annex B
 already
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (h264_qsv) -> h264 (h264_qsv))
 [vost#0:0/h264_qsv @ 0x55c9717202c0] Starting thread...
 [vf#0:0 @ 0x55c97173ac00] Starting thread...
 [vist#0:0/h264 @ 0x55c97171fe80] Starting thread...
 [in#0/h264 @ 0x55c97171a180] Starting thread...
 Press [q] to stop, [?] for help
 [AVHWDeviceContext @ 0x7fda54002840] VAAPI driver: Intel iHD driver for
 Intel(R) Gen Graphics - 24.1.2 (eab411768).
 [AVHWDeviceContext @ 0x7fda54002840] Driver not found in known nonstandard
 list, using standard behaviour.
 [h264_qsv @ 0x55c97173c080] Decoder: output is video memory surface
 [h264_qsv @ 0x55c97173c080] Use Intel(R) Media SDK to create MFX session,
 the required implementation version is 1.35
 [AVHWDeviceContext @ 0x7fda54007440] VAAPI driver: Intel iHD driver for
 Intel(R) Gen Graphics - 24.1.2 (eab411768).
 [AVHWDeviceContext @ 0x7fda54007440] Driver not found in known nonstandard
 list, using standard behaviour.
 [h264_qsv @ 0x55c97173c080] Decoder: output is video memory surface
 [h264_qsv @ 0x55c97173c080] Use Intel(R) Media SDK to create MFX session,
 the required implementation version is 1.35
 [graph 0 input from stream 0:0 @ 0x7fda4c003340] w:1280 h:720 pixfmt:qsv
 tb:1/120 fr:3/1001 sar:1/1 csp:bt709 range:tv
 [h264_qsv @ 0x55c971721900] Using input frames context (format qsv) with
 h264_qsv encoder.
 [h264_qsv @ 0x55c971721900] Encoder: input is video memory surface
 [h264_qsv @ 0x55c971721900] Use Intel(R) Media SDK to create MFX session,
 the required implementation version is 1.35
 [h264_qsv @ 0x55c971721900] Using the variable bitrate (VBR) ratecontrol
 method
 [h264_qsv @ 0x55c971721900] MFMode:2
 [h264_qsv @ 0x55c971721900] profile: avc high; level: 32
 [h264_qsv @ 0x55c971721900

Re: [FFmpeg-trac] #10856(undetermined:new): Regression: VA-API + QSV transcoding fail, with large number of errors

2024-02-12 Thread FFmpeg
#10856: Regression: VA-API + QSV transcoding fail, with large number of errors
-+-
 Reporter:  eero-t   |Owner:  (none)
 Type:  defect   |   Status:  new
 Priority:  important|Component:
 |  undetermined
  Version:  git-master   |   Resolution:
 Keywords:  regression   |   Blocked By:
 Blocking:   |  Reproduced by developer:  0
Analyzed by developer:  0|
-+-
Comment (by eero-t):

 With QSV, warnings are about allocation failures:
 {{{
 ffmpeg version N-113614-g4f80441455 Copyright (c) 2000-2024 the FFmpeg
 developers
   built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
   configuration: --prefix=/opt/install/Nightly_3486 --enable-libmfx
 --enable-vaapi --enable-sdl2 --disable-libx265 --disable-libx264
 --disable-libvpx --enable-libvorbis --enable-libopus --disable-libmp3lame
 --disable-libass --disable-sndio --enable-libfreetype --enable-gpl
 --disable-doc
   libavutil  58. 36.101 / 58. 36.101
   libavcodec 60. 39.100 / 60. 39.100
   libavformat60. 20.100 / 60. 20.100
   libavdevice60.  4.100 / 60.  4.100
   libavfilter 9. 17.100 /  9. 17.100
   libswscale  7.  6.100 /  7.  6.100
   libswresample   4. 13.100 /  4. 13.100
   libpostproc57.  4.100 / 57.  4.100
 -vsync is deprecated. Use -fps_mode
 [AVHWDeviceContext @ 0x56221bed3dc0] libva: VA-API version 1.21.0
 [AVHWDeviceContext @ 0x56221bed3dc0] libva: User requested driver 'iHD'
 [AVHWDeviceContext @ 0x56221bed3dc0] libva: Trying to open
 /opt/install/Nightly_3486/lib/dri/iHD_drv_video.so
 [AVHWDeviceContext @ 0x56221bed3dc0] libva: Found init function
 __vaDriverInit_1_21
 [AVHWDeviceContext @ 0x56221bed3dc0] libva: va_openDriver() returns 0
 [AVHWDeviceContext @ 0x56221bed3dc0] Initialised VAAPI connection: version
 1.21
 [AVHWDeviceContext @ 0x56221bed3dc0] VAAPI driver: Intel iHD driver for
 Intel(R) Gen Graphics - 24.1.4 (35b955d7a).
 [AVHWDeviceContext @ 0x56221bed3dc0] Driver not found in known nonstandard
 list, using standard behaviour.
 [AVHWDeviceContext @ 0x56221bed38c0] Use Intel(R) Media SDK to create MFX
 session, API version is 1.35, the required implementation version is 1.3
 [AVHWDeviceContext @ 0x56221bed38c0] Initialize MFX session:
 implementation version is 1.35
 [h264 @ 0x56221bfbb980] Reinit context to 1280x720, pix_fmt: yuv420p
 [h264 @ 0x56221bfba340] max_analyze_duration 50 reached at 52
 microseconds st:0
 Input #0, h264, from 'input/1280x720p_29.97_10mb_h264_cabac.264':
   Duration: N/A, bitrate: N/A
   Stream #0:0: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709,
 progressive, left), 1280x720 (0x0) [SAR 1:1 DAR 16:9], 25 fps, 59.94 tbr,
 1200k tbn
 [out#0/h264 @ 0x56221bfbfc00] No explicit maps, mapping streams
 automatically...
 [vost#0:0/h264_qsv @ 0x56221bfc0280] Created video stream from input
 stream 0:0
 [h264_mp4toannexb @ 0x56221bfdac40] The input looks like it is Annex B
 already
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (h264_qsv) -> h264 (h264_qsv))
 [vost#0:0/h264_qsv @ 0x56221bfc0280] Starting thread...
 [vf#0:0 @ 0x56221bfd4440] Starting thread...
 [vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Starting
 thread...
 [in#0/h264 @ 0x56221bfba180] Starting thread...
 Press [q] to stop, [?] for help
 [AVHWDeviceContext @ 0x7f693c002840] VAAPI driver: Intel iHD driver for
 Intel(R) Gen Graphics - 24.1.4 (35b955d7a).
 [AVHWDeviceContext @ 0x7f693c002840] Driver not found in known nonstandard
 list, using standard behaviour.
 [h264_qsv @ 0x56221bfda040] Decoder: output is video memory surface
 [h264_qsv @ 0x56221bfda040] Use Intel(R) Media SDK to create MFX session,
 the required implementation version is 1.35
 [AVHWDeviceContext @ 0x7f693c007440] VAAPI driver: Intel iHD driver for
 Intel(R) Gen Graphics - 24.1.4 (35b955d7a).
 [AVHWDeviceContext @ 0x7f693c007440] Driver not found in known nonstandard
 list, using standard behaviour.
 [h264_qsv @ 0x56221bfda040] Decoder: output is video memory surface
 [h264_qsv @ 0x56221bfda040] Use Intel(R) Media SDK to create MFX session,
 the required implementation version is 1.35
 [graph 0 input from stream 0:0 @ 0x7f6934003340] w:1280 h:720 pixfmt:qsv
 tb:1/120 fr:3/1001 sar:1/1 csp:bt709 range:tv
 [graph 0 input from stream 0:0 @ 0x7f6934003340] video frame properties
 congruent with link at pts_time: 0
 [h264_qsv @ 0x56221bfc1d80] Using input frames context (format qsv) with
 h264_qsv encoder.
 [h264_qsv @ 0x56221bfc1d80] Encoder: input is video memory surface
 [h264_qsv @ 0x56221bfc1d80] Use Intel(R) Media SDK to create MFX session,
 the required implementation version is 1.35
 [h264_qsv @ 0x56221bfc1d80] Using the variable bitrate (VBR) rate

[FFmpeg-trac] #10856(undetermined:new): Regression: VA-API + QSV transcoding fail, with large number of errors

2024-02-12 Thread FFmpeg
#10856: Regression: VA-API + QSV transcoding fail, with large number of errors
-+-
 Reporter:  eero-t   | Type:  defect
   Status:  new  | Priority:  important
Component:   |  Version:  git-
  undetermined   |  master
 Keywords:  regression   |   Blocked By:
 Blocking:   |  Reproduced by developer:  0
Analyzed by developer:  0|
-+-
 Between following FFmpeg git master commits:
 {{{
 $ git log --format=oneline
 
ac06190a5a11f2b170e7719d769d7c0d65bff3e0...887a7817b6671cd5dce9ba9bf97b88afdbbe7137
 887a7817b6671cd5dce9ba9bf97b88afdbbe7137 lavc: move bitstream filters into
 bsf/ subdir
 e0da916b8f5b079a4865eef7f64863f50785463d fftools/ffmpeg: optimize inter-
 thread queue sizes
 341d0419e1291d5af524405d21d564aaf23dd409 avcodec/texturedsp: Factor common
 code out
 4f58372c10dfc5d8c4ae46738b5a1c79633ee5ff avcodec/hap: Avoid unnecessary
 opt.h inclusion
 a3fc9fb9fbc0c7154d874cc6740345bfc0102282 avcodec/texturedsp: Add separate
 TextureDSPEncContext
 8f791304f2e7bc70d6d6c404301a5c3a1de7da57 avcodec/dxvenc, hap(dec|enc):
 Move TextureDSPContext to stack
 e1d1304b4b30e442cb0b348ba486003b40740af3 avcodec/texturedspenc: Remove
 unused rgtc1_u_alpha encoding func
 916f01674178b0949b8d432b0d192169cc98b733 avcodec/dxvenc: Fix data races
 with slice threading
 555879ca7cf50f265c4beae365cc5142f3eb660e avcodec/dxvenc: Don't cast const
 away
 d52e8ed114301b44f2a1ff526c6164c43da35749 libavfilter/vf_dnn_detect: Use
 class confidence to filt boxes
 3de38b9da5c2ffddcf1c532bca78f989b0474494 libavfilter/dnn_interface: use
 dims to represent shapes
 c695de56b5ba8b2436e455c2284159759ca444d3 libavfilter/dnn_bakcend_openvino:
 Add automatic input/output detection
 0c517fcbe8ee864c8390dd08696ec63621a4f3e0 lavc/vvc: Fix emulation
 prevention byte handling
 bab7f91c36ab0386f269d8fd4787dbf5dbbcb01d tests/fate/ffmpeg: add a test for
 the issue fixed in previous commit
 1ea2e757f7cba714eefd27efb2f9285078bba4a3 fftools/ffmpeg_filter: do not end
 filtering when a graph input EOFs
 00013341dfd674b72acb8d93fb6b3f3dc7ebc42e fftools/ffmpeg_sched: add filter
 API to signal EOF on input
 eb4584f994fb9bcfe2a305dada99f8dd5805aae0 avcodec/vvc_ps: remove duplicated
 enum
 763e31a8d3e3def53fc22828e75df54127e9487e lavc/vvc: Clamp shift RHS
 cb7b4ee02491662e0aeee26479e8add955cd9b43 lavc/vvc: Use av_log2 when
 destination is integer
 8c99a1429a19268e91463e21fdf2f61b8a678135 avcodec/d3d12va_mpeg2|vc1: remove
 the unused macros
 8b41e9cfbe64c95c04d131632f099910296db48b avcodec/d3d12va_decode: check
 existance before assigning a new index
 }}}

 FFmpeg transcoding broke, at least for following transcoding commands
 (which do not use HW scaling):
 * H.265=>H.265 (4K): {{{ffmpeg -loglevel verbose -vsync passthrough
 -fpsprobesize 300 -analyzeduration 500K -hwaccel vaapi -vaapi_device
 /dev/dri/renderD128 -hwaccel_output_format vaapi -i
 Netflix_FoodMarket_4096x2160_10bit_420_100mbs_600.h265 -c:v hevc_vaapi
 -b:v 20M -an -vframes 300 -y 0099_4K20.h265}}}
 * H.264=>H.264 (HD): {{{ffmpeg -loglevel verbose -vsync passthrough
 -fpsprobesize 300 -analyzeduration 500K -hwaccel vaapi -vaapi_device
 /dev/dri/renderD128 -hwaccel_output_format vaapi -i
 1920x1080i_29.97_20mb_mpeg2_high.mpv -c:v h264_vaapi -b:v 6000K
 -compression_level 7 -an -vframes 2400 -y 0024_HD17i7_1.0.h264}}}
 * H.264=>H.264 ("HD"): {{{ffmpeg -loglevel verbose -vsync passthrough
 -fpsprobesize 300 -analyzeduration 500K -hwaccel vaapi -vaapi_device
 /dev/dri/renderD128 -hwaccel_output_format vaapi -i
 1280x720p_29.97_10mb_h264_cabac.264 -c:v h264_vaapi -b:v 2000K
 -compression_level 4 -an -vframes 2400 -y 0027_HD20_1.0.h264}}}
 * H.264=>H.264 (SD): {{{ffmpeg -loglevel verbose -vsync passthrough
 -fpsprobesize 300 -analyzeduration 500K -hwaccel vaapi -vaapi_device
 /dev/dri/renderD128 -hwaccel_output_format vaapi -i
 720x480p_30.00_4mb_h264_cabac_180s.264 -c:v h264_vaapi -b:v 2000K
 -compression_level 4 -an -vframes 4800 -y 0038_SD03_1.0.h264}}}
 * H.264=>MPEG2 (SD): {{{ffmpeg -loglevel verbose -vsync passthrough
 -fpsprobesize 300 -analyzeduration 500K -hwaccel vaapi -vaapi_device
 /dev/dri/renderD128 -hwaccel_output_format vaapi -i
 720x480p_30.00_4mb_h264_cabac_180s.264 -c:v mpeg2_vaapi -b:v 2000K
 -compression_level 4 -an -vframes 2400 -y 0039_SD03MP2_1.0.mpg}}}

 Identical transcoding with HW scale-down added still works OK though, at
 least for:
 * H.264=>H.264 ("HD"): {{{ffmpeg -loglevel verbose -vsync passthrough
 -fpsprobesize 300 -analyzeduration 500K -hwaccel vaapi -vaapi_device
 /dev/dri/renderD128 -hwaccel_output_format vaapi -i
 1280x720p_29.97_10mb_h264_cabac.264 -c:v h264_vaapi -b:v 800K -vf
 scale_vaapi=w=352:h=240,fps=15 -compression_level 4 -an -vframes