vah264dec: "cannot map memory range 0-1"
I have a h264 file here that fails with vah264dec
(current git main) as follows. I saw the same failure on other files before already.
$ gst-play-1.0 --use-playbin3 test-small.ts
Press 'k' to see a list of keyboard shortcuts.
Now playing /home/slomo/tmp/test-small.ts
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
0:00:00.259544183 1695711 0x7ffbd0001980 ERROR videometa gstvideometa.c:362:default_map: cannot map memory range 0-1
0:00:00.259560835 1695711 0x7ffbd0001980 ERROR default video-frame.c:168:gst_video_frame_map_id: failed to map video frame plane 0
** (gst-play-1.0:1695711): CRITICAL **: 10:41:57.234: file ../subprojects/gst-plugins-good/gst/deinterlace/gstdeinterlace.c: line 738 (gst_video_frame_new_and_map): should not be reached
0:00:00.259612542 1695711 0x7ffbd0001980 ERROR deinterlace gstdeinterlace.c:1121:gst_deinterlace_push_history:<deinterlace> Failed to map video frame for buffer: 0x7ffb985fc090, pts 0:00:00.973467371, dts 99:99:99.999999999, dur 0:00:00.016683333, size 3342336, offset none, offset_end none, flags 0x300000
File in question is test-small.ts.
To make this work at all with git main or 1.24, #3436 (closed) needs to be fixed (or the relevant commits need to be revert, see issue).
Relevant part of the log is
0:00:00.254328825 1696498 0x7f0450001980 LOG vah264dec gstvah264dec.c:124:gst_va_h264_dec_output_picture:<vah264dec0> Outputting picture 0x7f04183f3f60 (poc 88)
0:00:00.254364042 1696498 0x7f0450001980 WARN vadisplay vasurfaceimage.c:233:va_get_derive_image: vaDeriveImage: operation failed
0:00:00.254368701 1696498 0x7f0450001980 DEBUG vamemory gstvaallocator.c:1588:_va_copy: 0x7f04183b04b0: copy 0, 18446744073709551615
0:00:00.255410149 1696498 0x7f0450001980 LOG vamemory gstvasurfacecopy.c:110:gst_va_surface_copy: shallow copy of 0x4 to 0x3
0:00:00.255417212 1696498 0x7f0450001980 WARN vadisplay vasurfaceimage.c:233:va_get_derive_image: vaDeriveImage: operation failed
0:00:00.255420909 1696498 0x7f0450001980 LOG vamemory gstvaallocator.c:1663:gst_va_memory_release: releasing 0x7f04183fed60: surface 0x3
0:00:00.255424747 1696498 0x7f0450001980 ERROR videometa gstvideometa.c:362:default_map: cannot map memory range 0-1
0:00:00.255427812 1696498 0x7f0450001980 ERROR default video-frame.c:168:gst_video_frame_map_id: failed to map video frame plane 0
Configured caps are
0:00:00.169339107 1696498 0x7f0450001980 INFO vah264dec gstvabasedec.c:1164:gst_va_base_dec_set_output_state:<vah264dec0> Negotiated caps video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, interlace-mode=(string)mixed, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709, framerate=(fraction)30000/1001
VA driver etc
0:00:00.087024895 1696498 0x7f0450001980 INFO vadisplay gstvadisplay_drm.c:156:gst_va_display_drm_create_va_display:<vadisplaydrm2> DRM render node with kernel driver amdgpu
0:00:00.087063759 1696498 0x7f0450001980 INFO vadisplay gstvadisplay.c:353:_va_info:<vadisplaydrm2> VA info: VA-API version 1.20.0
0:00:00.087071333 1696498 0x7f0450001980 INFO vadisplay gstvadisplay.c:353:_va_info:<vadisplaydrm2> VA info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
0:00:00.087085880 1696498 0x7f0450001980 INFO vadisplay gstvadisplay.c:353:_va_info:<vadisplaydrm2> VA info: Found init function __vaDriverInit_1_20
0:00:00.090653834 1696498 0x7f0450001980 INFO vadisplay gstvadisplay.c:353:_va_info:<vadisplaydrm2> VA info: va_openDriver() returns 0
0:00:00.090660958 1696498 0x7f0450001980 INFO vadisplay gstvadisplay.c:405:gst_va_display_initialize:<vadisplaydrm2> VA-API version 1.20
0:00:00.090665005 1696498 0x7f0450001980 INFO vadisplay gstvadisplay.c:176:_gst_va_display_filter_driver: VA-API driver vendor: Mesa Gallium driver 23.3.6 for AMD Radeon RX 550 / 550 Series (radeonsi, polaris12, LLVM 17.0.6, DRM 3.57, 6.7.9-200.fc39.x86_64)
CC @vjaquez