#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 2400 -y
 0030_HD22_1.0.h264}}}

 ''Both'' VA-API ''and'' QSV/MSDK transcoding are broken, but VA-API
 transcoding gives more warnings:
 {{{
 $ 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
 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
   libavformat    60. 20.100 / 60. 20.100
   libavdevice    60.  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
   libpostproc    57.  4.100 / 57.  4.100
 -vsync is deprecated. Use -fps_mode
 [AVHWDeviceContext @ 0x55aef10dd680] libva: VA-API version 1.21.0
 [AVHWDeviceContext @ 0x55aef10dd680] libva: User environment variable
 requested driver 'iHD'
 [AVHWDeviceContext @ 0x55aef10dd680] libva: Trying to open
 /opt/install/Nightly_3486/lib/dri/iHD_drv_video.so
 [AVHWDeviceContext @ 0x55aef10dd680] libva: Found init function
 __vaDriverInit_1_21
 [AVHWDeviceContext @ 0x55aef10dd680] libva: va_openDriver() returns 0
 [AVHWDeviceContext @ 0x55aef10dd680] Initialised VAAPI connection: version
 1.21
 [AVHWDeviceContext @ 0x55aef10dd680] VAAPI driver: Intel iHD driver for
 Intel(R) Gen Graphics - 24.1.4 (35b955d7a).
 [AVHWDeviceContext @ 0x55aef10dd680] Driver not found in known nonstandard
 list, using standard behaviour.
 [h264 @ 0x55aef11a7600] Reinit context to 1280x720, pix_fmt: yuv420p
 [h264 @ 0x55aef110d700] max_analyze_duration 500000 reached at 520000
 microseconds st:0
 Selecting decoder 'h264' because of requested hwaccel method vaapi
 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 @ 0x55aef11c7fc0] No explicit maps, mapping streams
 automatically...
 [vost#0:0/h264_vaapi @ 0x55aef11c7640] Created video stream from input
 stream 0:0
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
 [vost#0:0/h264_vaapi @ 0x55aef11c7640] Starting thread...
 [vf#0:0 @ 0x55aef11c2c80] Starting thread...
 [vist#0:0/h264 @ 0x55aef122e180] [dec:h264 @ 0x55aef11e2d40] Starting
 thread...
 [in#0/h264 @ 0x55aef110c180] Starting thread...
 Press [q] to stop, [?] for help
 [h264 @ 0x55aef11c5ec0] Reinit context to 1280x720, pix_fmt: vaapi
 [graph 0 input from stream 0:0 @ 0x7f6c6c003880] w:1280 h:720 pixfmt:vaapi
 tb:1/1200000 fr:30000/1001 sar:1/1 csp:bt709 range:tv
 [graph 0 input from stream 0:0 @ 0x7f6c6c003880] video frame properties
 congruent with link at pts_time: 0
 [h264_vaapi @ 0x55aef11c6800] Using input frames context (format vaapi)
 with h264_vaapi encoder.
 [h264_vaapi @ 0x55aef11c6800] Input surface format is nv12.
 [h264_vaapi @ 0x55aef11c6800] Using VAAPI profile VAProfileH264High (7).
 [h264_vaapi @ 0x55aef11c6800] Using VAAPI entrypoint VAEntrypointEncSlice
 (6).
 [h264_vaapi @ 0x55aef11c6800] Using VAAPI render target format YUV420
 (0x1).
 [h264_vaapi @ 0x55aef11c6800] RC mode: AVBR.
 [h264_vaapi @ 0x55aef11c6800] RC target: 2000000 bps converging in 120
 frames with 100% accuracy.
 [h264_vaapi @ 0x55aef11c6800] RC framerate: 30000/1001 (29.97 fps).
 [h264_vaapi @ 0x55aef11c6800] Driver does not report any additional
 prediction constraints.
 [h264_vaapi @ 0x55aef11c6800] Using intra, P- and B-frames (supported
 references: 8 / 2).
 [h264_vaapi @ 0x55aef11c6800] All wanted packed headers available (wanted
 0xd, found 0x1f).
 [h264_vaapi @ 0x55aef11c6800] Using level 3.1.
 Output #0, h264, to 'output/0027_HD20_1.0.h264':
   Metadata:
     encoder         : Lavf60.20.100
   Stream #0:0: Video: h264 (High), 1 reference frame, vaapi(tv, bt709,
 progressive, left), 1280x720 (0x0) [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s,
 29.97 fps, 29.97 tbn
       Metadata:
         encoder         : Lavc60.39.100 h264_vaapi
 [out#0/h264 @ 0x55aef11c7fc0] Starting thread...
 [h264 @ 0x55aef1802840] get_buffer() failed
 [h264 @ 0x55aef1802840] thread_get_buffer() failed
 [h264 @ 0x55aef1802840] decode_slice_header error
 [h264 @ 0x55aef1802840] no frame!
 [h264 @ 0x55aef18d2000] get_buffer() failed
 [h264 @ 0x55aef18d2000] thread_get_buffer() failed
 [h264 @ 0x55aef18d2000] decode_slice_header error
 [h264 @ 0x55aef18d2000] no frame!
 [h264 @ 0x55aef19a17c0] get_buffer() failed
 [h264 @ 0x55aef19a17c0] thread_get_buffer() failed
 [h264 @ 0x55aef19a17c0] decode_slice_header error
 [h264 @ 0x55aef19a17c0] no frame!
 [h264 @ 0x55aef1a70f80] get_buffer() failed
 [h264 @ 0x55aef1a70f80] thread_get_buffer() failed
 [h264 @ 0x55aef1a70f80] decode_slice_header error
 [h264 @ 0x55aef1a70f80] no frame!
 [h264 @ 0x55aef1b40740] co located POCs unavailable
 [vist#0:0/h264 @ 0x55aef122e180] [dec:h264 @ 0x55aef11e2d40] Error
 submitting packet to decoder: Invalid data found when processing input
     Last message repeated 1 times
 ... <lot of similar warnings> ...
 [vist#0:0/h264 @ 0x55aef122e180] [dec:h264 @ 0x55aef11e2d40] Error
 submitting packet to decoder: Invalid data found when processing input
     Last message repeated 1 times
 [h264 @ 0x55aef18d2000] get_buffer() failed
 [h264 @ 0x55aef18d2000] thread_get_buffer() failed
 [h264 @ 0x55aef18d2000] decode_slice_header error
 [h264 @ 0x55aef18d2000] no frame!
 [h264 @ 0x55aef19a17c0] get_buffer() failed
 [h264 @ 0x55aef19a17c0] thread_get_buffer() failed
 [h264 @ 0x55aef19a17c0] decode_slice_header error
 [h264 @ 0x55aef19a17c0] no frame!
 [vf#0:0 @ 0x55aef11c2c80] All consumers returned EOF
 [vf#0:0 @ 0x55aef11c2c80] Terminating thread with return code 0 (success)
 [vist#0:0/h264 @ 0x55aef122e180] [dec:h264 @ 0x55aef11e2d40] Decoder
 returned EOF, finishing
 [vist#0:0/h264 @ 0x55aef122e180] [dec:h264 @ 0x55aef11e2d40] Terminating
 thread with return code 0 (success)
 [vist#0:0/h264 @ 0x55aef122e180] All consumers of this stream are done
 [in#0/h264 @ 0x55aef110c180] All consumers are done
 [in#0/h264 @ 0x55aef110c180] Terminating thread with return code 0
 (success)
 [vost#0:0/h264_vaapi @ 0x55aef11c7640] Encoder thread received EOF
 [vost#0:0/h264_vaapi @ 0x55aef11c7640] Terminating thread with return code
 0 (success)
 [out#0/h264 @ 0x55aef11c7fc0] All streams finished
 [out#0/h264 @ 0x55aef11c7fc0] Terminating thread with return code 0
 (success)
 [AVIOContext @ 0x55aef205dc40] Statistics: 20088479 bytes written, 0
 seeks, 77 writeouts
 [out#0/h264 @ 0x55aef11c7fc0] Output file #0 (output/0027_HD20_1.0.h264):
 [out#0/h264 @ 0x55aef11c7fc0]   Output stream #0:0 (video): 2400 frames
 encoded; 2400 packets muxed (20088479 bytes);
 [out#0/h264 @ 0x55aef11c7fc0]   Total: 2400 packets (20088479 bytes) muxed
 [out#0/h264 @ 0x55aef11c7fc0] video:19618KiB audio:0KiB subtitle:0KiB
 other streams:0KiB global headers:0KiB muxing overhead: 0.000000%
 frame= 2400 fps=571 q=-0.0 Lsize=   19618KiB time=00:01:20.04
 bitrate=2007.7kbits/s speed=  19x
 [in#0/h264 @ 0x55aef110c180] Input file #0
 (input/1280x720p_29.97_10mb_h264_cabac.264):
 [in#0/h264 @ 0x55aef110c180]   Input stream #0:0 (video): 3147 packets
 read (78678696 bytes); 2409 frames decoded; 444 decode errors;
 [in#0/h264 @ 0x55aef110c180]   Total: 3147 packets (78678696 bytes)
 demuxed
 [AVIOContext @ 0x55aef110c480] Statistics: 78708736 bytes read, 0 seeks
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10856>
FFmpeg <https://ffmpeg.org>
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".

Reply via email to