Re: [Mlt-devel] no alpha channel for video with PIX_FMT_YUVA420P pixel format
Brought to you by:
ddennedy,
lilo_booter
From: Dan D. <da...@de...> - 2012-02-20 21:41:45
|
On Mon, Feb 20, 2012 at 12:11 PM, Dan Dennedy <da...@de...> wrote: > 2012/2/17 Maksym Veremeyenko <ve...@m1...>: >> 16.02.12 18:56, Dan Dennedy написав(ла): >> >>> 2012/2/16 Maksym Veremeyenko<ve...@m1...>: >>>> >>>> 02.02.12 19:03, Maksym Veremeyenko написав(ла): >>>>> >>>>> >>>>> Hi, >>>>> >>>>> >>>>> i am trying to decrease cpu usage, so i would like to use >>>>> PIX_FMT_YUVA420P animation instead of PIX_FMT_BGRA (or other rgb with >>>>> alpha channel) but has no luck.. >>>>> >>>>> video with such pixel format in *nut* container has detected by ffmpeg >>>>> properly, but mlt did not use it alpha channel. >>>>> >>>>> i can provide a sample if required... >>>>> >>>> >>>> alpha been ignored for PIX_FMT_YUVA420P and PIX_FMT_YUVA444P pixel >>>> format. >>>> moreover current implementation of libswscale drop alpha channel if >>>> destination format has no alpha and not planar (even if buffer specified) >>>> >>>> attached patch extract alpha plane during image decoding. it works almost >>>> fine except moments when image fetched from cache (even if *noimagecache* >>>> specified). another problem is artifact that appear if last frame in >>>> movie >>>> is not transparent but producer specifies *out* out of animation. >>>> >>>> another attempt to fix this was to fix mlt_frame_clone (patch attached) >>>> but >>>> it has no luck too... >>> >>> >>> OK, thank you for the start of this effort. I will look at it this >>> weekend. >>> >> >> attached updated version that works with cache. >> >> second patch is optional but could be usefull if frame with alpha been >> cloned. > > These look great, but I had to fix some minor formatting problems. We > tend to prefer C++ style comments in .c files (but not headers). Also, > some spacing around parenthesis. Sometimes I am OK to make these fixes > myself, which I have done here in my local repo. Now I just need to > figure out why this does not work: > > melt -profile atsc_1080i_50 noise: -track > ~/Videos/tests/now-main_aut_2011_fullHD.nut -transition composite Your nut file had an opaque alpha channel. I recreated it from the rgba avi file, and it works, so I pushed it. +-DRD-+ |