Opened 9 months ago

Last modified 9 months ago

#10856 new defect

Regression: VA-API + QSV transcoding fail, with large number of errors

Reported by: eero-t Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

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

Change History (3)

comment:1 by eero-t, 9 months ago

With QSV, warnings are about allocation failures:

$ ffmpeg -loglevel verbose -vsync passthrough -fpsprobesize 300 -analyzeduration 500K -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD128 -c:v h264_qsv -i input/1280x720p_29.97_10mb_h264_cabac.264 -c:v h264_qsv -b:v 2000K -compression_level 4 -an -vframes 2400 -y output/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 @ 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 500000 reached at 520000 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/1200000 fr:30000/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) ratecontrol method
[h264_qsv @ 0x56221bfc1d80] MFMode:2
[h264_qsv @ 0x56221bfc1d80] profile: avc high; level: 32
[h264_qsv @ 0x56221bfc1d80] GopPicSize: 256; GopRefDist: 3; GopOptFlag: closed; IdrInterval: 0
[h264_qsv @ 0x56221bfc1d80] TargetUsage: 4; RateControlMethod: VBR
[h264_qsv @ 0x56221bfc1d80] BufferSizeInKB: 750; InitialDelayInKB: 375; TargetKbps: 2000; MaxKbps: 3000; BRCParamMultiplier: 1
[h264_qsv @ 0x56221bfc1d80] NumSlice: 1; NumRefFrame: 2
[h264_qsv @ 0x56221bfc1d80] RateDistortionOpt: OFF
[h264_qsv @ 0x56221bfc1d80] RecoveryPointSEI: OFF
[h264_qsv @ 0x56221bfc1d80] VDENC: OFF
[h264_qsv @ 0x56221bfc1d80] Entropy coding: CABAC; MaxDecFrameBuffering: 2
[h264_qsv @ 0x56221bfc1d80] NalHrdConformance: ON; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: ON
[h264_qsv @ 0x56221bfc1d80] FrameRateExtD: 1001; FrameRateExtN: 30000 
[h264_qsv @ 0x56221bfc1d80] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[h264_qsv @ 0x56221bfc1d80] MaxFrameSize: 353280; MaxSliceSize: 0
[h264_qsv @ 0x56221bfc1d80] BitrateLimit: ON; MBBRC: OFF; ExtBRC: OFF
[h264_qsv @ 0x56221bfc1d80] Trellis: auto
[h264_qsv @ 0x56221bfc1d80] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: 2x
[h264_qsv @ 0x56221bfc1d80] AdaptiveI: OFF; AdaptiveB: OFF; BRefType:off
[h264_qsv @ 0x56221bfc1d80] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[h264_qsv @ 0x56221bfc1d80] DisableDeblockingIdc: 0 
[h264_qsv @ 0x56221bfc1d80] SkipFrame: no_skip
[h264_qsv @ 0x56221bfc1d80] PRefType: default
[h264_qsv @ 0x56221bfc1d80] TransformSkip: unknown 
[h264_qsv @ 0x56221bfc1d80] IntRefCycleDist: 0
[h264_qsv @ 0x56221bfc1d80] LowDelayBRC: OFF
[h264_qsv @ 0x56221bfc1d80] MaxFrameSizeI: 0; MaxFrameSizeP: 0
[h264_qsv @ 0x56221bfc1d80] ScenarioInfo: 0
Output #0, h264, to 'output/0027_HD20_1.0.h264':
  Metadata:
    encoder         : Lavf60.20.100
  Stream #0:0: Video: h264, 1 reference frame, qsv(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_qsv
      Side data:
        cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: N/A
[out#0/h264 @ 0x56221bfbfc00] Starting thread...
[h264_qsv @ 0x56221bfda040] get_buffer() failed
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Error submitting packet to decoder: Cannot allocate memory
[h264_qsv @ 0x56221bfda040] get_buffer() failed
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Error submitting packet to decoder: Cannot allocate memory
[h264_qsv @ 0x56221bfda040] get_buffer() failed
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Error submitting packet to decoder: Cannot allocate memory
... <lot of similar warnings> ...
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Decoding error: Cannot allocate memory
[h264_qsv @ 0x56221bfda040] get_buffer() failed
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Decoding error: Cannot allocate memory
[h264_qsv @ 0x56221bfda040] get_buffer() failed
[h264_qsv @ 0x56221bfda040] Too many errors when draining, this is a bug. Stop draining and force EOF.
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Decoding error: Internal bug, should not have happened
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Decoder returned EOF, finishing
[vist#0:0/h264 @ 0x56221bfc0cc0] [dec:h264_qsv @ 0x56221bfc2bc0] Terminating thread with return code 0 (success)
[vf#0:0 @ 0x56221bfd4440] Filtergraph returned EOF, finishing
[vf#0:0 @ 0x56221bfd4440] All consumers returned EOF
[vf#0:0 @ 0x56221bfd4440] Terminating thread with return code 0 (success)
[vost#0:0/h264_qsv @ 0x56221bfc0280] Encoder thread received EOF
[vost#0:0/h264_qsv @ 0x56221bfc0280] Terminating thread with return code 0 (success)
[out#0/h264 @ 0x56221bfbfc00] All streams finished
[out#0/h264 @ 0x56221bfbfc00] Terminating thread with return code 0 (success)
[AVIOContext @ 0x56221bfda400] Statistics: 501868 bytes written, 0 seeks, 2 writeouts
[out#0/h264 @ 0x56221bfbfc00] Output file #0 (output/0027_HD20_1.0.h264):
[out#0/h264 @ 0x56221bfbfc00]   Output stream #0:0 (video): 49 frames encoded; 49 packets muxed (501868 bytes); 
[out#0/h264 @ 0x56221bfbfc00]   Total: 49 packets (501868 bytes) muxed
[out#0/h264 @ 0x56221bfbfc00] video:490KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.000000%
frame=   49 fps=0.0 q=39.0 Lsize=     490KiB time=00:00:01.56 bitrate=2560.2kbits/s speed=12.4x    
[in#0/h264 @ 0x56221bfba180] Input file #0 (input/1280x720p_29.97_10mb_h264_cabac.264):
[in#0/h264 @ 0x56221bfba180]   Input stream #0:0 (video): 3596 packets read (90045687 bytes); 49 frames decoded; 3563 decode errors; 
[in#0/h264 @ 0x56221bfba180]   Total: 3596 packets (90045687 bytes) demuxed
[AVIOContext @ 0x56221bfc3100] Statistics: 90045687 bytes read, 0 seeks
Last edited 9 months ago by eero-t (previous) (diff)

comment:2 by eero-t, 9 months ago

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
  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 @ 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 500000 reached at 520000 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/1200000 fr:30000/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] GopPicSize: 256; GopRefDist: 3; GopOptFlag: closed; IdrInterval: 0
[h264_qsv @ 0x55c971721900] TargetUsage: 4; RateControlMethod: VBR
[h264_qsv @ 0x55c971721900] BufferSizeInKB: 750; InitialDelayInKB: 375; TargetKbps: 2000; MaxKbps: 3000; BRCParamMultiplier: 1
[h264_qsv @ 0x55c971721900] NumSlice: 1; NumRefFrame: 2
[h264_qsv @ 0x55c971721900] RateDistortionOpt: OFF
[h264_qsv @ 0x55c971721900] RecoveryPointSEI: OFF
[h264_qsv @ 0x55c971721900] VDENC: OFF
[h264_qsv @ 0x55c971721900] Entropy coding: CABAC; MaxDecFrameBuffering: 2
[h264_qsv @ 0x55c971721900] NalHrdConformance: ON; SingleSeiNalUnit: ON; VuiVclHrdParameters: OFF VuiNalHrdParameters: ON
[h264_qsv @ 0x55c971721900] FrameRateExtD: 1001; FrameRateExtN: 30000 
[h264_qsv @ 0x55c971721900] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[h264_qsv @ 0x55c971721900] MaxFrameSize: 353280; MaxSliceSize: 0
[h264_qsv @ 0x55c971721900] BitrateLimit: ON; MBBRC: OFF; ExtBRC: OFF
[h264_qsv @ 0x55c971721900] Trellis: auto
[h264_qsv @ 0x55c971721900] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: 2x
[h264_qsv @ 0x55c971721900] AdaptiveI: OFF; AdaptiveB: OFF; BRefType:off
[h264_qsv @ 0x55c971721900] MinQPI: 0; MaxQPI: 0; MinQPP: 0; MaxQPP: 0; MinQPB: 0; MaxQPB: 0
[h264_qsv @ 0x55c971721900] DisableDeblockingIdc: 0 
[h264_qsv @ 0x55c971721900] SkipFrame: no_skip
[h264_qsv @ 0x55c971721900] PRefType: default
[h264_qsv @ 0x55c971721900] TransformSkip: unknown 
[h264_qsv @ 0x55c971721900] IntRefCycleDist: 0
[h264_qsv @ 0x55c971721900] LowDelayBRC: OFF
[h264_qsv @ 0x55c971721900] MaxFrameSizeI: 0; MaxFrameSizeP: 0
[h264_qsv @ 0x55c971721900] ScenarioInfo: 0
Output #0, h264, to 'output/0027_HD20_1.0.h264':
  Metadata:
    encoder         : Lavf60.20.100
  Stream #0:0: Video: h264, 1 reference frame, qsv(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.38.100 h264_qsv
      Side data:
        cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: N/A
[out#0/h264 @ 0x55c97171fc40] Starting thread...
frame=  236 fps=0.0 q=20.0 size=    1792kB time=00:00:07.80 bitrate=1880.2kbits/s speed=15.6x    
frame=  506 fps=506 q=26.0 size=    3840kB time=00:00:16.81 bitrate=1870.6kbits/s speed=16.8x    
frame=  775 fps=517 q=31.0 size=    6144kB time=00:00:25.79 bitrate=1951.4kbits/s speed=17.2x    
frame= 1036 fps=518 q=33.0 size=    8192kB time=00:00:34.50 bitrate=1945.1kbits/s speed=17.2x    
frame= 1301 fps=520 q=32.0 size=   10496kB time=00:00:43.34 bitrate=1983.8kbits/s speed=17.3x    
frame= 1553 fps=518 q=30.0 size=   12544kB time=00:00:51.75 bitrate=1985.6kbits/s speed=17.2x    
frame= 1807 fps=516 q=35.0 size=   14592kB time=00:01:00.22 bitrate=1984.8kbits/s speed=17.2x    
frame= 2056 fps=514 q=34.0 size=   16640kB time=00:01:08.53 bitrate=1989.0kbits/s speed=17.1x    
frame= 2331 fps=518 q=28.0 size=   18688kB time=00:01:17.71 bitrate=1970.0kbits/s speed=17.3x    
[vf#0:0 @ 0x55c97173ac00] All consumers returned EOF
[vf#0:0 @ 0x55c97173ac00] Terminating thread with return code 0 (success)
[vist#0:0/h264 @ 0x55c97171fe80] Decoder returned EOF, finishing
[vist#0:0/h264 @ 0x55c97171fe80] Terminating thread with return code 0 (success)
[vist#0:0/h264 @ 0x55c97171fe80] All consumers of this stream are done
[in#0/h264 @ 0x55c97171a180] All consumers are done
[in#0/h264 @ 0x55c97171a180] Terminating thread with return code 0 (success)
[vost#0:0/h264_qsv @ 0x55c9717202c0] Encoder thread received EOF
[vost#0:0/h264_qsv @ 0x55c9717202c0] Terminating thread with return code 0 (success)
[out#0/h264 @ 0x55c97171fc40] All streams finished
[out#0/h264 @ 0x55c97171fc40] Terminating thread with return code 0 (success)
[AVIOContext @ 0x55c971736500] Statistics: 19927719 bytes written, 0 seeks, 77 writeouts
[out#0/h264 @ 0x55c97171fc40] Output file #0 (output/0027_HD20_1.0.h264):
[out#0/h264 @ 0x55c97171fc40]   Output stream #0:0 (video): 2400 frames encoded; 2400 packets muxed (19927719 bytes); 
[out#0/h264 @ 0x55c97171fc40]   Total: 2400 packets (19927719 bytes) muxed
[out#0/h264 @ 0x55c97171fc40] video:19461kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
frame= 2400 fps=519 q=30.0 Lsize=   19461kB time=00:01:20.01 bitrate=1992.4kbits/s speed=17.3x    
[in#0/h264 @ 0x55c97171a180] Input file #0 (input/1280x720p_29.97_10mb_h264_cabac.264):
[in#0/h264 @ 0x55c97171a180]   Input stream #0:0 (video): 2410 packets read (60235271 bytes); 2402 frames decoded; 0 decode errors; 
[in#0/h264 @ 0x55c97171a180]   Total: 2410 packets (60235271 bytes) demuxed
[AVIOContext @ 0x55c971723100] Statistics: 60260352 bytes read, 0 seeks

comment:3 by eero-t, 9 months ago

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.

Note: See TracTickets for help on using tickets.