Convert .flv to .swf in Linux

By | 2013/08/10

ffmpeg in Linux can convert .flv or any other video format to .swf. Here is how it works!


First install ffmpeg:

$ sudo apt-get install ffmpeg

Convert your file:

$ ffmpeg -i original.flv new.swf

Done!


The output looks as follows:

stmiller@brahms:~/$ ffmpeg -i 'Nyan Cat [original]-QH2-TGUlwu4.flv' nyancat.swf
ffmpeg version 1.0.7 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 19 2013 07:14:44 with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libfdk-aac --enable-libdc1394 --disable-altivec --dis  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, flv, from 'Nyan Cat [original]-QH2-TGUlwu4.flv':
  Metadata:
    starttime       : 0
    totalduration   : 217
    totaldatarate   : 454
    bytelength      : 12306056
    canseekontime   : true
    sourcedata      : BADC20742HH1376153374913816
    purl            : 
    pmsg            : 
  Duration: 00:03:36.81, start: 0.000000, bitrate: 454 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p, 720x480, 324 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc
    Stream #0:1: Audio: aac, 44100 Hz, stereo, s16, 131 kb/s
Output #0, swf, to 'nyancat.swf':
  Metadata:
    starttime       : 0
    totalduration   : 217
    totaldatarate   : 454
    bytelength      : 12306056
    canseekontime   : true
    sourcedata      : BADC20742HH1376153374913816
    purl            : 
    pmsg            : 
    encoder         : Lavf54.29.104
    Stream #0:0: Video: flv1, yuv420p, 720x480, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
    Stream #0:1: Audio: mp3, 44100 Hz, stereo, s16
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> flv)
  Stream #0:1 -> #0:1 (aac -> libmp3lame)
Press [q] to stop, [?] for help
frame= 6499 fps=403 q=31.0 Lsize=   13960kB time=00:03:37.00 bitrate= 527.0kbits/s    
video:10388kB audio:3391kB subtitle:0 global headers:0kB muxing overhead 1.315485%
stmiller@brahms:~/$