Opened 2 years ago

Last modified 2 years ago

#9531 new defect

Unexpected ghosting around a transparent video encoded with hevc_videotoolbox

Reported by: Chris Patuzzo Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: hevc hevc_videotoolbox apple transparent alpha
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I am trying to convert two transparent videos from VP9 to HEVC so that I can play them in Safari. They are both videos of some particle effects. The first video that contains black pixels transcodes correctly. The second video that contains blue pixels transcodes incorrectly. The alpha values around the edges of the particles seems to be incorrect creating a ghosting effect.

The video with blue particles was generated from the one with black particles. I did this by mapping over each of the PNG files that were used to create the videos and re-mapping the color from black to blue. I believe I did this correctly. I can have attached one sample PNG of blue and black to this ticket.

How to reproduce:

This transcode produces the correct result:
ffmpeg -c:v libvpx-vp9 -i black_particles.webm -c:v hevc_videotoolbox -alpha_quality 1 -vtag hvc1 black_particles.mov

This transcode produces an incorrect result:
ffmpeg -c:v libvpx-vp9 -i blue_particles.webm -c:v hevc_videotoolbox -alpha_quality 1 -vtag hvc1 blue_particles.mov

I have attached the '-report -v 9 -loglevel 99' output for both transcodes as well as the input/output videos and screenshots that show the correct and incorrect ghosting in Apple's video preview.

Build information:

I built ffmpeg yesterday from the master branch, commit 7e9e2cf93b6e22eaec72837ab59ac654c19b8d99. I used these parameters:

./configure --enable-libfdk-aac --enable-libvpx --enable-libvorbis --enable-libx265 --enable-libx264 --enable-gpl --enable-nonfree

Many thanks

Attachments (10)

black_particles.webm (110.4 KB ) - added by Chris Patuzzo 2 years ago.
blue_particles.webm (307.4 KB ) - added by Chris Patuzzo 2 years ago.
black_particles.mov (273.6 KB ) - added by Chris Patuzzo 2 years ago.
blue_particles.mov (1.3 MB ) - added by Chris Patuzzo 2 years ago.
ffmpeg-20211125-101242.log (15.1 KB ) - added by Chris Patuzzo 2 years ago.
ffmpeg-20211125-101252.log (15.1 KB ) - added by Chris Patuzzo 2 years ago.
black_particle_screenshot_correct.png (931.5 KB ) - added by Chris Patuzzo 2 years ago.
blue_particle_screenshot_incorrect.png (779.0 KB ) - added by Chris Patuzzo 2 years ago.
original_black_sample_frame.png (317.1 KB ) - added by Chris Patuzzo 2 years ago.
mapped_blue_sample_frame.png (315.9 KB ) - added by Chris Patuzzo 2 years ago.

Change History (12)

by Chris Patuzzo, 2 years ago

Attachment: black_particles.webm added

by Chris Patuzzo, 2 years ago

Attachment: blue_particles.webm added

by Chris Patuzzo, 2 years ago

Attachment: black_particles.mov added

by Chris Patuzzo, 2 years ago

Attachment: blue_particles.mov added

by Chris Patuzzo, 2 years ago

Attachment: ffmpeg-20211125-101242.log added

by Chris Patuzzo, 2 years ago

Attachment: ffmpeg-20211125-101252.log added

by Chris Patuzzo, 2 years ago

by Chris Patuzzo, 2 years ago

by Chris Patuzzo, 2 years ago

by Chris Patuzzo, 2 years ago

in reply to:  description comment:1 by Chris Patuzzo, 2 years ago

Minor note: When attaching videos to the ticket, I changed -alpha_quality from 1 to 0.25 so that the transcoded videos would fit within the 2.5MB upload limit.

comment:2 by Balling, 2 years ago

Encoding of alpha with hevc is very beta since it is supported only with hevc_videotoolbox.

Note: See TracTickets for help on using tickets.