-
How to convert an image sequence to a PNG encoded MOV with alpha channel
Hi Guys,
I’ve searched the whole web and RTFM but couldn’t find an answer to the simple question:
How can I convert an image sequence with an alpha channel (eg TGA) to a MOV file using the PNG codec while preserving alpha channel.I know this is possible because I can export such a MOV out of other software. But I need ffmpeg to do it.
Again:
—————–
What I have:
32bit TGA files including alpha channelWhat I want:
A lossless but as small as possible Quicktime file which includes the alpha channel
—————–What I was able to achieve:
A MOV file holding raw uncompressed data including alpha channel. But that is sometimes 10 times bigger than the (lossless) compressed PNG codec in Quicktime. So I really need it to be smaller. I would be also happy with some other lossless (but compressed) alternative.
What I used to achieve the uncompressed huge MOV file:ffmpeg.exe -r 30 -i C:\temp\test_%04d.tga -y -r 30 -vcodec rawvideo -pix_fmt rgba test.movffmpeg version N-37208-g01fcbdf Copyright (c) 2000-2012 the FFmpeg developers
built on Jan 27 2012 18:34:52 with gcc 4.6.2
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enab
le-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --en
able-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
libavutil 51. 34.101 / 51. 34.101
libavcodec 53. 60.100 / 53. 60.100
libavformat 53. 31.100 / 53. 31.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, image2, from 'C:\temp\test\nounderscore%04d.tga':
Duration: 00:00:01.03, start: 0.000000, bitrate: N/A
Stream #0:0: Video: targa, bgra, 1920x1080, 30 tbr, 30 tbn, 30 tbc
[buffer @ 01E39C80] w:1920 h:1080 pixfmt:bgra tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 03C302C0] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
[scale @ 03C311E0] w:1920 h:1080 fmt:bgra -> w:1920 h:1080 fmt:rgba flags:0x4
Output #0, mov, to 'nounderscore.mov':
Metadata:
encoder : Lavf53.31.100
Stream #0:0: Video: rawvideo (RGBA / 0x41424752), rgba, 1920x1080, q=2-31, 200 kb/s, 30 tbn, 30 tbc
Stream mapping:
Stream #0:0 -> #0:0 (targa -> rawvideo)
Press [q] to stop, [?] for help
frame= 31 fps= 19 q=0.0 Lsize= 251101kB time=00:00:01.03 bitrate=1990663.1kbits/s
video:251100kB audio:0kB global headers:0kB muxing overhead 0.000325%But when I change “-vcode rawvideo” to “-vcode png” it drops the alpha channel alltogether.
I played around with
-pix_fmt rgba
-pix_fmt argb
-pix_fmt bgra
-pix_fmt abgrbut nothing worked…
On the web there are different solutions but nothing worked for me. It seems my ffmpeg version (which is a fairly new build) doesn’t support it because other people claimed they did it by using exactly the same command.
Are there any other suggested builds?
Or am I missing something here?Any help is very much appreciated indeed.
Thanks
Uli