Sunday, October 4, 2009

AVI to SWF using FFmpeg

AVI container file with Video Codex: mpeg4 & Audio Codex: mp3)
In Ubuntu, For a quick and dirty way to convert AVI  files to SWF files I use:
Command line (open terminal)
ffmpeg -i input.avi -acodec copy -vcodec flv output.swf
Note:
you might have to add extra options to change parameters as frame rate, bit rate, ....)

Example output on screen:
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Mar 16 2009 21:16:26, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 29.97 (30000/1001)

Input #0, avi, from 'input.avi':
Duration: 00:00:39.7, start: 0.000000, bitrate: 1192 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 520x340, 29.97 fps(r)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 128 kb/s

Output #0, swf, to 'output.swf':
Stream #0.0: Video: flv, yuv420p, 520x340, q=2-31, 200 kb/s, 29.97 fps(c)
Stream #0.1: Audio: 0x0055, 44100 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 1190 q=31.0 Lsize=    2132kB time=39.7 bitrate= 439.9kbits/s
video:1479kB audio:621kB global headers:0kB muxing overhead 1.568774%
There is also a GUI-version available (cross-platform) @ http://code.google.com/p/winff/

No comments:

Post a Comment

Please be courteous, even if you do not share the same view.