[FFmpeg-devel] [PATCH WIP 0/5] avcodec/hevc: Add alpha video decoding support

Anton Khirnov anton at khirnov.net
Sat Dec 14 11:40:39 EET 2024


Quoting Zhao Zhili (2024-12-11 05:23:20)
> From: Zhao Zhili <zhilizhao at tencent.com>
> 
> What works:
> 
> 1. Create a sample with macOS videotoolbox
> ffmpeg -i base.mp4 -i alpha.mp4 \
> 	-c:v hevc_videotoolbox -alpha_quality 0.5 -b:v 2M \
> 	 -filter_complex '[0:v]scale,format=bgra[v0];[1:v]scale=640x480,format=gray[v1];[v0][v1]alphamerge[v2]' \
> 	-map '[v2]' -y hevc-alpha.ts
> 
> Then you can remux it to mp4 if you prefer.
> 
> 2. Decoding test
> 
> a. Check alpha plane
> ./ffmpeg -i hevc-alpha.ts -an -vf extractplanes=planes=a -f nut - |ffplay -
> 
> b. Check Y plane
> ./ffmpeg -i hevc-alpha.ts -an -vf extractplanes=planes=y -f nut - |ffplay -
> 
> What doesn't work:
> 
> 1. Encoding with videotoolbox and output as mp4 directly, due to missing PS.
> Can be fixed by
> 
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20241210191641.676-1-timo@rothenpieler.org/
> 
> 2. vps_extension is over-engineering and decode_vps_ext() is far from complete.
> A complete implementation might take a week, and I don't have enough spare time.
> I would greatly appreciate it if someone could help implement it.

Do we need a complete implementation, when we do not intend to support
all the possible combinations of all the possible multi-layer types? I'd
prefer not to handle all the insanity until we really need to.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list