[FFmpeg-user] YUV with alpha channel

Maksym Veremeyenko verem at m1stereo.tv
Fri Feb 3 11:56:15 CET 2012


03.02.12 12:03, Carl Eugen Hoyos написав(ла):
> Maksym Veremeyenko<verem<at>  m1stereo.tv>  writes:
>
>> has anybody success with encoding video from RGB with alpha channel
>> (rgba) into YUV with alpha channel ("AYUV" or "AVUI") with ffmpeg?
>
> I have now implemented AYUV locally but I don't know how to test it.
> If anybody has a sample or can test it, please mail me / answer here.

i have successfully converted my *rgba* video into *yuva420p* with:

[root at dev-5 resource]# ffmpeg -i now-main_aut_2011_fullHD.avi -vcodec 
rawvideo -pix_fmt yuva420p test.nut
ffmpeg version N-37489-gde05e41 Copyright (c) 2000-2012 the FFmpeg 
developers
   built on Feb  2 2012 18:11:34 with gcc 4.6.2 20111027 (Red Hat 4.6.2-1)
   configuration: --prefix=/usr/local/enctools 
--extra-cflags=-I/usr/local/enctools/include 
--extra-ldflags=-L/usr/local/enctools/lib --enable-shared --enable-gpl 
--enable-version3 --enable-nonfree --enable-postproc --enable-avfilter 
--enable-pthreads --enable-bzlib --enable-zlib --enable-libvo-amrwbenc 
--enable-libfaac --enable-libmp3lame --enable-libspeex 
--enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid 
--enable-debug --enable-vdpau
   libavutil      51. 36.100 / 51. 36.100
   libavcodec     54.  0.102 / 54.  0.102
   libavformat    54.  0.100 / 54.  0.100
   libavdevice    53.  4.100 / 53.  4.100
   libavfilter     2. 60.100 /  2. 60.100
   libswscale      2.  1.100 /  2.  1.100
   libswresample   0.  6.100 /  0.  6.100
   libpostproc    52.  0.100 / 52.  0.100
Input #0, avi, from 'now-main_aut_2011_fullHD.avi':
   Duration: 00:00:09.32, start: 0.000000, bitrate: 1658927 kb/s
     Stream #0:0: Video: rawvideo, bgra, 1920x1080, 25 tbr, 25 tbn, 25 tbc
[buffer @ 0x20e1920] w:1920 h:1080 pixfmt:bgra tb:1/1000000 sar:0/1 
sws_param:
[buffersink @ 0x20dc4e0] auto-inserting filter 'auto-inserted scale 0' 
between the filter 'src' and the filter 'out'
[scale @ 0x20dcdc0] w:1920 h:1080 fmt:bgra -> w:1920 h:1080 fmt:yuva420p 
flags:0x4
Output #0, nut, to 'test.nut':
   Metadata:
     encoder         : Lavf54.0.100
     Stream #0:0: Video: rawvideo (Y4[11][8] / 0x80B3459), yuva420p, 
1920x1080, q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> rawvideo)
Press [q] to stop, [?] for help
frame=  233 fps=  5 q=0.0 Lsize= 1179569kB time=00:00:09.32 
bitrate=1036805.8kbits/s
video:1179562kB audio:0kB global headers:0kB muxing overhead 0.000563%


also converting png with alpha into the *yuva420p* and back to png saves 
alpha correctly.

but *AVUI* file detects as *uyvy422*
[...]
   Duration: 00:00:09.32, start: 0.000000, bitrate: 345911 kb/s
     Stream #0:0(eng): Video: rawvideo (AVUI / 0x49555641), uyvy422, 
720x576, 345834 kb/s, SAR 768:702 DAR 160:117, 25 fps, 25 tbr, 25 tbn, 
25 tbc
[...]

PS
the only *nut* container save properly Y4[11][8] tag. saving *yuva420p* 
into the *avi* container detected as *yuv420p*

-- 
________________________________________
Maksym Veremeyenko


More information about the ffmpeg-user mailing list