#10262 closed defect (fixed)

FFMPEG-QSV 1:N Transcoding with deinterlace errors out at end

Reported by: sanasar Owned by: haihao
Priority: normal Component: avfilter
Version: 6.0 Keywords: QSV
Cc: sanasar, dvrogozh Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

We have identified regression with latest public FFMPEG: Command line below fails with error

  • version n6.0 bad
  • version a6e9d01f88 bad (Latest master)
  • version d4f853f4ed good

Following configuration was used running on ArcticSound M

  • libva: 2.17.0
  • libva-utils: 2.17.1
  • gmmlib: 22.3.4
  • media-driver: 23.1.3
  • onevpl-gpu: 23.1.3
  • mediasdk: 23.1.3
  • oneVPL: v2023.1.2
ffmpeg -y -hwaccel qsv -hwaccel_device /dev/dri/renderD128 \
-extra_hw_frames 8 -c:v h264_qsv -re -i bbb_sunflower_1080p_60fps_4Mbps_38kframes.h264 \
-filter_complex '[0:v]split=3[e_1080i60][in_480i][in_DI];[in_480i]scale_qsv=720:480[e_480i60];[in_DI]deinterlace_qsv[s1080p];[s1080p]split[in_720p][in_1080p];[in_720p]scale_qsv=1280:720[e_720p60];[in_1080p]fps=fps=30[in_1080p30];[in_1080p30]split[e_1080p30][in_720p30];[in_720p30]scale_qsv=1280:720[s720p];[s720p]split[e_720p30][in_360p];[in_360p]scale_qsv=640:360[s360];[s360]split[e_360p30][in_288p];[in_288p]scale_qsv=352:288[s288];[s288]split[e_288p30][in_180p];[in_180p]scale_qsv=240:180[e_180p30]' \
-map [e_1080i60] -c:v h264_qsv -preset medium -b:v 5M -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 10M -bufsize 20M -y -f null - \
-map [e_480i60] -c:v h264_qsv -preset medium -b:v 1500k -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 3M -bufsize 6M -y -f null - \
-map [e_720p60] -c:v h264_qsv -preset medium -b:v 3M -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 6M -bufsize 12M -y -f null - \
-map [e_1080p30] -c:v h264_qsv -preset medium -b:v 5M -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 10M -bufsize 20M -y -f null - \
-map [e_720p30] -c:v h264_qsv -preset medium -b:v 3M -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 6M -bufsize 12M -y -f null - \
-map [e_360p30] -c:v h264_qsv -preset medium -b:v 1M -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 2M -bufsize 4M -y -f null - \
-map [e_288p30] -c:v h264_qsv -preset medium -b:v 800k -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 1600k -bufsize 3200k -y -f null - \
-map [e_180p30] -c:v h264_qsv -preset medium -b:v 500k -g 256 -b_strategy 1 -low_power 1 -refs 5 -bf 7 -async_depth 2 -maxrate 1M -bufsize 2M -y -f null -

Following error is observed. Sometimes we do see hang after error is printed and ffmpeg needs to be killed.

[h264_qsv @ 0x5570c93ee940] A decode call did not consume any data: expect more data at input (-10)13 bitrate=N/A speed=   1x    peed=N/A
    Last message repeated 2 times
[Parsed_scale_qsv_7 @ 0x5570c9c971c0] Can't allocate a surface.
[Parsed_scale_qsv_7 @ 0x5570c9c971c0] Failed to query an output frame.
Error marking filters as finished
Conversion failed!

Change History (4)

comment:1 by sanasar, 21 months ago

FFMPEG bisection was done and issue started from below commit

b92028346c35dad837dd1160930435d88bd838b5 is the first bad commit
commit b92028346c35dad837dd1160930435d88bd838b5
Author: Haihao Xiang <haihao.xiang@intel.com>
Date:   Mon Jan 30 09:37:19 2023 +0800

    lavfi/deinterlace_qsv: re-use VPPContext for deinterlace_qsv filter

    QSVDeintContext and VPPContext have the same base context, and all
    features in deinterlace_qsv are implemented in vpp_qsv filter,  so
    deinterlace_qsv can be taken as a special case of vpp_qsv filter, and we
    may use VPPContext with a different option array, preinit callback and
    support pixel formats to implement deinterlace_qsv, then remove
    QSVDeintContext.

    Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>

 libavfilter/Makefile             |   2 +-
 libavfilter/vf_deinterlace_qsv.c | 166 ---------------------------------------
 libavfilter/vf_vpp_qsv.c         |  25 ++++++
 3 files changed, 26 insertions(+), 167 deletions(-)
 delete mode 100644 libavfilter/vf_deinterlace_qsv.c
gta@DUT5167ATSM:~$ git bisect log
git bisect start
# bad: [a6e9d01f88a707f8a2057e01b5ad2e8968109530] avcodec/libx264: Use av_pix_fmt_count_planes() where appropriate
git bisect bad a6e9d01f88a707f8a2057e01b5ad2e8968109530
# good: [d4f853f4ed39f51afbc14b3a7fe3bd7a435eb851] doc/filters.texi: add documentation for the ts_sync_mode framesync option
git bisect good d4f853f4ed39f51afbc14b3a7fe3bd7a435eb851
# good: [e5e29eda5aae8eb5d1d32f647c68c0543db63217] lavc/avcodec: improve AV_CODEC_FLAG_RECON_FRAME doxy
git bisect good e5e29eda5aae8eb5d1d32f647c68c0543db63217
# bad: [22960783978d9e0b6d4a4ed21f503bd24662aa7e] avutil/frame: deprecate AVFrame.coded_picture_number and display_picture_number
git bisect bad 22960783978d9e0b6d4a4ed21f503bd24662aa7e
# bad: [7e1d474021898251dd4b3e56c0d153eafd440f7c] avfilter/af_compand: simplify frame allocation
git bisect bad 7e1d474021898251dd4b3e56c0d153eafd440f7c
# good: [431f6260ac6408fdccfe06dd5276084b17c3557f] mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists
git bisect good 431f6260ac6408fdccfe06dd5276084b17c3557f
# bad: [82da22066c0818b606812d479674929a229386e2] lavc: deprecate CrystalHD decoders
git bisect bad 82da22066c0818b606812d479674929a229386e2
# good: [077e63496581edf02e503e7d99dbc4e1a5670246] lavfi/vpp_qsv: add rate option
git bisect good 077e63496581edf02e503e7d99dbc4e1a5670246
# bad: [9a820ec8b1e2323b70a1cebd204bf459bf7daa1a] ffmpeg: add video heartbeat capability to fix_sub_duration
git bisect bad 9a820ec8b1e2323b70a1cebd204bf459bf7daa1a
# bad: [b92028346c35dad837dd1160930435d88bd838b5] lavfi/deinterlace_qsv: re-use VPPContext for deinterlace_qsv filter
git bisect bad b92028346c35dad837dd1160930435d88bd838b5
# good: [a48c95d3c9c404c9139f7fc4eb7ae8bdf6fe0eaa] lavfi/deinterlace_qsv: simplify deinterlace_qsv filter
git bisect good a48c95d3c9c404c9139f7fc4eb7ae8bdf6fe0eaa
# first bad commit: [b92028346c35dad837dd1160930435d88bd838b5] lavfi/deinterlace_qsv: re-use VPPContext for deinterlace_qsv filter

comment:2 by dvrogozh, 21 months ago

Cc: dvrogozh added
Note: See TracTickets for help on using tickets.