[Cin] Vulkan hevc hdr decode regression on ffmpeg master?

Andrew Randrianasulu randrianasulu at gmail.com
Wed May 21 00:35:17 CEST 2025


вт, 20 мая 2025 г., 22:15 Phyllis Smith <phylsmith2017 at gmail.com>:

> Downloaded a msmpeg4 file and unfortunately my computers are AMD / vdpau
> hardware.  The one vaapi laptop will not compile CinGG anymore.
>


oh, what's error?



So the AMD computers get the error::
>
>> Decoder msmpeg4 does not support device type vaapi.
>> HW device init failed, using SW decode.
>> file:/root/Downloads/Fight.Club.Trailer.avi
>>   err: Operation not permitted
>>
> But I will still test decoding and encoding using software -- my rationale
> is that if it decodes correctly, then the encode will match between ffmpeg
> version 7.0 and future 8.0.
>
> On Sun, May 18, 2025 at 6:21 PM Andrew Randrianasulu <
> randrianasulu at gmail.com> wrote:
>
>>
>>
>> пн, 19 мая 2025 г., 03:04 Phyllis Smith <phylsmith2017 at gmail.com>:
>>
>>> Thanks. I suspect patch8 was aimed at mpeg4 (old, ala xvid, not h265)
>>>> playback via some hw accelerated method? I'll try some files I have from
>>>> those old times ...
>>>>
>>> I loaded small h263 videos in ffmpeg 7.0 (current) which would run
>>> h263dec.c (I assume) and then encoded them using h264.mp4 format.  I then
>>> did the same thing in the ffmpeg.git version (future version 8.0) where
>>> patch8 was deleted.  Visually detected no problem and when I used the
>>> patchbay arithmetic subtract on the 2 versions of encoded files, they
>>> showed no anomalies.
>>>
>>
>> I am going by my understanding of context diff:
>>
>>
>>
>> --- a/libavcodec/h263dec.c
>> +++ b/libavcodec/h263dec.c
>> @@ -623,7 +623,7 @@
>>      if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4)
>>          ff_mpeg4_frame_end(avctx, buf, buf_size);
>>
>> -    if (!s->divx_packed && avctx->hwaccel)
>> +    if (s->divx_packed && avctx->hwaccel)
>>          ff_thread_finish_setup(avctx);
>>
>>
>> yes, file named h263  but also serves (or served? if patch not applicable
>> anymore) role in decoding
>>
>> DiVX type of codecs, old msmpeg4 was first of them, divx3/5/XVID followed
>>
>> So, *I think* you need to raid
>>
>> samples.mplayerhq.hu
>>
>> and get some "packed B frame" xvid (or may be just make one with
>> Avidemux?) and then look if your vainfo/vdpauinfo shows MPEG4 decoding, set
>> cingg to this decode accel, and play vid in both sw and hw decode mode ?
>>
>> Sorry still not moved myself to check it out .....
>>
>>
>>
>>
>>
>>> But I completely re-run make clean,  ./autogen.sh/configure/make dance
>>>>
>>> Finally, it compiled but I am not sure what made the difference as I
>>> always use "make clean" and then run "bld.sh" which includes "autogen.sh";
>>> i.e. -
>>>
>>>> #!/bin/bash
>>>> ...
>>>> ( ./autogen.sh
>>>>   ./configure --with-single-user --with-git-ffmpeg=
>>>> https://git.ffmpeg.org/ffmpeg.git
>>>>   make && make install ) 2>&1 | tee log
>>>> mv Makefile Makefile.cfg
>>>> cp Makefile.devel Makefile
>>>>
>>>
>>>
>>> On Sat, May 17, 2025 at 6:04 PM Andrew Randrianasulu <
>>> randrianasulu at gmail.com> wrote:
>>>
>>>>
>>>>
>>>> вс, 18 мая 2025 г., 02:56 Phyllis Smith <phylsmith2017 at gmail.com>:
>>>>
>>>>> Checked into GIT the updated ffmpeg.git.patches for future potential
>>>>> upgrade to ffmpeg version 8.0.  And deleted ffmpeg.git.patch8 after
>>>>> attempting to determine what it was actually for and could find no
>>>>> information on that when included sometime in 2019 as patch7.  It is
>>>>> possible that it is no longer needed though - it may have been intended as
>>>>> a speed improvement; but if some relevant error resurfaces, it can then be
>>>>> revisited.
>>>>>
>>>>
>>>>
>>>> Thanks. I suspect patch8 was aimed at mpeg4 (old, ala xvid, not h265)
>>>> playback via some hw accelerated method? I'll try some files I have from
>>>> those old times ...
>>>>
>>>>
>>>>
>>>>> Andrea, the failure in your last attached cin5.log as shown below
>>>>> appears to be due to commenting out libpostproc.a in configure.ac
>>>>> because that is needed by cinelerra-5.1/mpeg2enc build.
>>>>>
>>>>>> make[2]: *** [Makefile:75: x86_64/hveg2enc] Error 1
>>>>>> make[2]: uscita dalla directory
>>>>>> «/home/paz/cinelerra5/cinelerra-5.1/mpeg2enc»
>>>>>>
>>>>>
>>>>
>>>> For me deleting libpostproc.a from configure.ac worked for compiling
>>>> with ffmpeg.git
>>>>
>>>> But I completely re-run make clean,  ./autogen.sh/configure/make dance
>>>>
>>>> not sure why it did not work for you ....
>>>> make sure your user can rewrite global_config in the root of
>>>> cinelerra's main src tree? (if you tried building from root and then from
>>>> ordinary user)
>>>>
>>>>>
>>>>>
>>>>> On Wed, May 14, 2025 at 7:49 AM Andrew Randrianasulu <
>>>>> randrianasulu at gmail.com> wrote:
>>>>>
>>>>>> On Wed, May 14, 2025 at 1:31 PM Andrew Randrianasulu
>>>>>> <randrianasulu at gmail.com> wrote:
>>>>>> >
>>>>>> > So I was experimenting  with Vulkan decoding in cinelerra-gg.
>>>>>> >
>>>>>> > After some fight I get build using ffmpeg git
>>>>>> >
>>>>>> > commit 038314bc6be2f35a82e9fba2228bcac2e4fee648 for ffmpeg
>>>>>> >
>>>>>> > here is bunch of errors like this:
>>>>>> >
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 296
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 9
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 296
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 8
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 298
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 8
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 300
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 300
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 300
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 302
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 304
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 304
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 304
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 306
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 308
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 308
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 308
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 310
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 312
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 312
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 312
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 314
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 316
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 316
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 316
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 318
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 320
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 320
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 320
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 322
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 324
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 324
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 324
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 326
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 328
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 328
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> > [hevc @ 0x6f72ad00] Could not find ref with POC 328
>>>>>> > [hevc @ 0x6f72ad00] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f72ad00] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f77b3c0] Could not find ref with POC 330
>>>>>> > [hevc @ 0x6f77b3c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f77b3c0] Skipping invalid undecodable NALU: 2
>>>>>> > [hevc @ 0x6f789480] Could not find ref with POC 332
>>>>>> > [hevc @ 0x6f789480] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f789480] Skipping invalid undecodable NALU: 1
>>>>>> > [hevc @ 0x6f7465c0] Could not find ref with POC 332
>>>>>> > [hevc @ 0x6f7465c0] Error constructing the frame RPS.
>>>>>> > [hevc @ 0x6f7465c0] Skipping invalid undecodable NALU: 3
>>>>>> >
>>>>>> > file itself:
>>>>>> >
>>>>>> https://drive.google.com/file/d/1Ic9DZXMSo07EJMqCFaQRKSSrSw6y1mYv/view
>>>>>> >
>>>>>> > But I see some kind of first frame corruption I never saw on 7.0
>>>>>> build
>>>>>> >
>>>>>> > https://paste.pics/860707666060d195485e07ea7b057ce8
>>>>>> >
>>>>>> > and speed kinda down from 58 fps to just 50-51  relative to ffmpeg
>>>>>> libs 7.0?
>>>>>> >
>>>>>> > hw:
>>>>>> > 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc.
>>>>>> > [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
>>>>>> (rev
>>>>>> > c7)
>>>>>> >
>>>>>> > mesa:
>>>>>> >
>>>>>> > OpenGL renderer string: AMD Radeon RX 550 / 550 Series (radeonsi,
>>>>>> > polaris12, ACO, DRM 3.61, 6.12.26-x64)
>>>>>> > OpenGL core profile version string: 4.6 (Core Profile) Mesa
>>>>>> > 25.2.0-devel (git-ef63e3e4d2)
>>>>>> >
>>>>>> > cingg home git:
>>>>>> > git://git.cinelerra-gg.org/goodguy/cinelerra.git
>>>>>> >
>>>>>> > I set two evn. variables specific to my system, but mostly I wanted
>>>>>> to
>>>>>> > get libplacebo and libzimg for HDR->SDR conversion
>>>>>> >
>>>>>> > EXTRA_LIBS :=  -lOpenCL -lSvtAv1Enc -lvpl -ldav1d -lxvidcore -lass
>>>>>> > -lbluray -lsnappy -lzimg -lplacebo -lshaderc_shared -lnuma -lva
>>>>>> > -lva-x11 `pkg-config --libs x11` -lva-drm -ldl
>>>>>> > FFMPEG_EXTRA_CFG :=  --enable-libvpl --disable-doc --enable-opencl
>>>>>> > --enable-libsvtav1 --enable-frei0r --enable-libdav1d
>>>>>> --enable-libzimg
>>>>>> > --enable-libxvid --enable-libass --enable-libbluray
>>>>>> --enable-libsnappy
>>>>>> > --enable-libshaderc --enable-libplacebo --enable-vulkan
>>>>>> > --disable-debug --extra-cflags=-I/usr/local/include/vpl
>>>>>> > --extra-cflags=-I/usr/include/svt-av1 --extra-ldflags=" -lva
>>>>>> > `pkg-config --libs libva` -lva-x11 -lva-drm -ldl"
>>>>>> >
>>>>>> >
>>>>>> > cingg configure:
>>>>>> >
>>>>>> > ./configure --with-git-ffmpeg=https://git.ffmpeg.org/ffmpeg.git
>>>>>> > --with-single-user --enable-libsvtav1 --disable-dav1d
>>>>>> >
>>>>>> > I used bunch of patches (attached, done by Phyllis and me) and
>>>>>> > manually removed posprocess.a ref. from our configure.ac for now
>>>>>>
>>>>>>
>>>>>> One more patch/hack just for making building easier attached (on top
>>>>>> of 0001-3 patches for cingg)
>>>>>>
>>>>>> ffmpeg.git patches  go into thirdparty/src, and you probably want to
>>>>>> move away ffmpeg.git.patch8 out of  this directory so it will not fail
>>>>>> patching
>>>>>>
>>>>>>
>>>>>>
>>>>>> >
>>>>>> > there is still some problem with attaching ffmpeg filters
>>>>>> > per-input-file, but main Vulkan decode problem still visible without
>>>>>> > any filters
>>>>>> >
>>>>>> > I run just-compiled cin binary like this:
>>>>>> >
>>>>>> > RADV_PERFTEST=video_decode bin/cin
>>>>>> > ~/K38_sdcard1/Documents/iPhone11_4K-recorder_59.940HDR10.mov
>>>>>> >
>>>>>> > and got corruption as visible on screenshot  at the start of this
>>>>>> email
>>>>>> >
>>>>>> > Playing image forward cleans up  this corruption, but returning to
>>>>>> > timeline beginning bring it back.
>>>>>>
>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20250521/a4599f63/attachment-0001.htm>


More information about the Cin mailing list