hevc alpha crash fix ?
0001 is old 0004 patch, new 0002 should fix crash you probably saw on loading + seeking in x265-created hevc alpha encoded mp4 file I tested with 3 other hevc + alpha test files and they still worked, too I hope my change does not intro some unwanted side effect ....
I successfully compiled CinGG using only these two patches. Thank you. After downloading them from the site you recommended, I tried uploading two videos: hevc_4k60P_main_dji_mavic3.mov hevc_with_alpha_layer.mov The first one won't load (loglevel=debug): [AVFormatContext @ 0x7f44882af9c0] Opening '/home/paz/hevc_4k60P_main_dji_mavic3.mov' for reading [file @ 0x7f4488031100] Setting default whitelist 'file,crypto,data' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] ISO: File Type Major Brand: qt [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] ISO: File Type Major Brand: qt [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] moov atom not found [AVIOContext @ 0x7f448822a640] Statistics: 65536 bytes read, 3 seeks The second one loads normally; in the terminal, I get a very long output, which I’ve attached. Everything seems fine to me, and it even uses Vulkan for decoding. As for rendering, I’m not sure if I need to create a preset with an alpha channel. But I haven’t tested it yet.
On Fri, May 15, 2026 at 4:36 PM Andrea paz <gamberucci.andrea@gmail.com> wrote:
I successfully compiled CinGG using only these two patches. Thank you.
After downloading them from the site you recommended, I tried uploading two videos:
hevc_4k60P_main_dji_mavic3.mov hevc_with_alpha_layer.mov
The first one won't load (loglevel=debug):
[AVFormatContext @ 0x7f44882af9c0] Opening '/home/paz/hevc_4k60P_main_dji_mavic3.mov' for reading [file @ 0x7f4488031100] Setting default whitelist 'file,crypto,data' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] ISO: File Type Major Brand: qt [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] ISO: File Type Major Brand: qt [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] moov atom not found [AVIOContext @ 0x7f448822a640] Statistics: 65536 bytes read, 3 seeks
may be download silently failed before reaching true end?
The second one loads normally; in the terminal, I get a very long output, which I’ve attached.
I think this is normal with loglevel debug
Everything seems fine to me, and it even uses Vulkan for decoding.
As for rendering, I’m not sure if I need to create a preset with an alpha channel. But I haven’t tested it yet.
Preset already exist in one of my earlier emails, but I am not 100% sure x265 creates correct bitstream In theory nvenc for nvidia was also said to be able to create hevc-alpha bitstream, and may be intel too (whatever mac machines used in 2019) but again I have no way to test that ....
On Fri, May 15, 2026 at 9:25 PM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
On Fri, May 15, 2026 at 4:36 PM Andrea paz <gamberucci.andrea@gmail.com> wrote:
I successfully compiled CinGG using only these two patches. Thank you.
After downloading them from the site you recommended, I tried uploading two videos:
hevc_4k60P_main_dji_mavic3.mov hevc_with_alpha_layer.mov
The first one won't load (loglevel=debug):
[AVFormatContext @ 0x7f44882af9c0] Opening '/home/paz/hevc_4k60P_main_dji_mavic3.mov' for reading [file @ 0x7f4488031100] Setting default whitelist 'file,crypto,data' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] ISO: File Type Major Brand: qt [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] ISO: File Type Major Brand: qt [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f44882af9c0] moov atom not found [AVIOContext @ 0x7f448822a640] Statistics: 65536 bytes read, 3 seeks
may be download silently failed before reaching true end?
The second one loads normally; in the terminal, I get a very long output, which I’ve attached.
I think this is normal with loglevel debug
Everything seems fine to me, and it even uses Vulkan for decoding.
As for rendering, I’m not sure if I need to create a preset with an alpha channel. But I haven’t tested it yet.
Preset already exist in one of my earlier emails, but I am not 100% sure x265 creates correct bitstream
In theory nvenc for nvidia was also said to be able to create hevc-alpha bitstream, and may be intel too (whatever mac machines used in 2019) but again I have no way to test that ....
https://cloud.mail.ru/public/BuKn/xDXhGP7aX 460 kb test file I encoded with x265 4.2 earlier. This used to crash cingg on seeking. with my naive condition added to ref.c it ecodes without crashing. My understanding this crash prevented further testing of my hevc alpha profile using x265 for nvenc there is documentation at https://docs.nvidia.com/video-technologies/video-codec-sdk/13.0/nvenc-video-... see 8.11 but I do not see any mention of such settings in ffmpeg 8.1s libavcodec ? grep alpha thirdparty/ffmpeg-8.1/libavcodec/nvenc.c is empty.
Andrew, with the additional patch "0002-Add-combined-hevc-alpha-decoding-patch.patch", I no longer had the crash I had previously reported. Since both you and Andrea successfully tested, I would like to checkin ffmpeg-8.1.patch11, ...patch12, and ...patch14 as long as you concur. But why 13 skipped? Checkin would include patches: 0001-Add-two-patches-for-decoding-hevc-alpha.patch 0002-Add-combined-hevc-alpha-decoding-patch.patch 0002-Add-simple-hevc-alpha-encode-profile-with-hvc1-tag.patch 0003-Fix-h265_alpha-profile.patch On Thu, May 14, 2026 at 8:47 PM Andrew Randrianasulu < randrianasulu@gmail.com> wrote:
0001 is old 0004 patch, new 0002 should fix crash you probably saw on loading + seeking in x265-created hevc alpha encoded mp4 file
I tested with 3 other hevc + alpha test files and they still worked, too
I hope my change does not intro some unwanted side effect ....
On Sun, May 17, 2026 at 8:37 PM Phyllis Smith <phylsmith2017@gmail.com> wrote:
Andrew, with the additional patch "0002-Add-combined-hevc-alpha-decoding-patch.patch", I no longer had the crash I had previously reported. Since both you and Andrea successfully tested, I would like to checkin ffmpeg-8.1.patch11, ...patch12, and ...patch14 as long as you concur. But why 13 skipped?
Because patch13 was just patch from ffmpeg.git, then I decided to roll in my fix too because I just do diff -u between full original and my already patched working copy in thirdparty I hope no additional issues will be found during wider testing, but only way to test is test so roll it in, see if it catches fire, IF it catches fire we will think/tinker more. Checkin would include patches:
0001-Add-two-patches-for-decoding-hevc-alpha.patch 0002-Add-combined-hevc-alpha-decoding-patch.patch 0002-Add-simple-hevc-alpha-encode-profile-with-hvc1-tag.patch 0003-Fix-h265_alpha-profile.patch
On Thu, May 14, 2026 at 8:47 PM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
0001 is old 0004 patch, new 0002 should fix crash you probably saw on loading + seeking in x265-created hevc alpha encoded mp4 file
I tested with 3 other hevc + alpha test files and they still worked, too
I hope my change does not intro some unwanted side effect ....
Checked into GIT as now these seem to be stable so more use of this code can be utilized in case of missed impacts.
0001-Add-two-patches-for-decoding-hevc-alpha.patch 0002-Add-combined-hevc-alpha-decoding-patch.patch
0002-Add-simple-hevc-alpha-encode-profile-with-hvc1-tag.patch 0003-Fix-h265_alpha-profile.patch
0005-Guard-against-failed-hTransform-in-newly-added-cms-c.patch 0006-Fix-x265-4.2-build-on-i586.patch
I'm not sure how the x265 patches with an alpha channel work. For my tests, I used an H.264 background without transparency (aereo.mp4). On top of that, I placed the four “puppet” files I downloaded from the Apple website Andrew mentioned. Here's the link to download the files. https://developer.apple.com/documentation/avfoundation/using-hevc-video-with... Or, to save time, here’s the link to my Dropbox folder where I’ve gathered the four files plus the render file: https://www.dropbox.com/scl/fi/ovavq5cqmtfvosz7ulhoy/Archivio.tar.gz?rlkey=5... Test: - puppets_with_alpha_hevc.mov It does not display transparency on the timeline or in the rendering created with the "h265_alpha.mp4" preset. - puppets_with_alpha_prores-60fps.mp4 It does not display transparency on the timeline or in the rendering created with the h265_alpha.mp4 preset. - puppets_with_alpha_prores.mov shows transparency on the timeline and in the final render - puppets_with_greenbg_hevc.mov Shows the transparency on the timeline and in the final render after removing the green background using chroma key. Other files with transparency don't work in either decoding or encoding. Given these results, I can't figure out what makes transparency work and what doesn't. Codecs? Formats? My system? NOTE: I tried the Kdenlive AppImage and got the same results. Here's a link to a video showing my tests: https://www.dropbox.com/scl/fi/lspehro82yvyqozdygq77/2026-05-18_10-22-41.mkv...
On Mon, May 18, 2026 at 12:03 PM Andrea paz <gamberucci.andrea@gmail.com> wrote:
I'm not sure how the x265 patches with an alpha channel work.
well, I placed usual jpeg file on second (bottom) track relative to track with transparent video file. as long as jpeg file is bigger than image it should show up in compositor behind figures ... rendering prores with alpha file alone into x265 + alpha should give you file behaving like original prores + alpha and non-transparent jpeg. order (who is on top track) matters!
For my tests, I used an H.264 background without transparency (aereo.mp4). On top of that, I placed the four “puppet” files I downloaded from the Apple website Andrew mentioned. Here's the link to download the files.
https://developer.apple.com/documentation/avfoundation/using-hevc-video-with...
Or, to save time, here’s the link to my Dropbox folder where I’ve gathered the four files plus the render file:
https://www.dropbox.com/scl/fi/ovavq5cqmtfvosz7ulhoy/Archivio.tar.gz?rlkey=5...
Test:
- puppets_with_alpha_hevc.mov It does not display transparency on the timeline or in the rendering created with the "h265_alpha.mp4" preset. - puppets_with_alpha_prores-60fps.mp4 It does not display transparency on the timeline or in the rendering created with the h265_alpha.mp4 preset. - puppets_with_alpha_prores.mov shows transparency on the timeline and in the final render - puppets_with_greenbg_hevc.mov Shows the transparency on the timeline and in the final render after removing the green background using chroma key.
Other files with transparency don't work in either decoding or encoding.
Given these results, I can't figure out what makes transparency work and what doesn't. Codecs? Formats? My system? NOTE: I tried the Kdenlive AppImage and got the same results.
Here's a link to a video showing my tests:
https://www.dropbox.com/scl/fi/lspehro82yvyqozdygq77/2026-05-18_10-22-41.mkv...
participants (3)
-
Andrea paz -
Andrew Randrianasulu -
Phyllis Smith