7 August 2010

Tutorial about converting flv to mp3 format in Linux or Windows, using ffmpeg.

Get ffmpeg:

If you are using windows then you have to get it from here. It's a bit harder than in Linux. Linux users can get it from repos, by using yum, apt-get or package manager. Example:
Source code viewer
  1. sudo apt-get install ffmpeg
Programming Language: Bash
Convert flv to mp3
Flv files contain audio with mp3 encoding, so we just need to get the file. Then we need to make the audio file.
Source code viewer
  1. cd folder/of/flv/files
  2. ffmpeg -i input_file_name.flv -acodec copy output_file_name.mp3
Programming Language: Bash
You can also use ffmpeg to convert audio to other formats, but then you need right libs. Example:
Source code viewer
  1. user@unknown:~$ cd Videos/
  2. user@unknown:~/Videos$ ffmpeg -i FlashXXZuL8ki -acodec copy flash.mp3
  3. FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  4. configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  5. libavutil 49.15. 0 / 49.15. 0
  6. libavcodec 52.20. 1 / 52.20. 1
  7. libavformat 52.31. 0 / 52.31. 0
  8. libavdevice 52. 1. 0 / 52. 1. 0
  9. libavfilter 0. 4. 0 / 0. 4. 0
  10. libswscale 0. 7. 1 / 0. 7. 1
  11. libpostproc 51. 2. 0 / 51. 2. 0
  12. built on Mar 4 2010 12:35:30, gcc: 4.4.3
  13.  
  14. Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 23.98 (24000/1001)
  15. Input #0, flv, from 'FlashXXZuL8ki':
  16. Duration: 00:43:53.74, start: 0.105000, bitrate: N/A
  17. Stream #0.0: Video: h264, yuv420p, 416x224 [PAR 21:22 DAR 39:22], 23.98 tbr, 1k tbn, 47.95 tbc
  18. Stream #0.1: Audio: aac, 48000 Hz, stereo, s16
  19. Output #0, mp3, to 'flash.mp3':
  20. Stream #0.0: Audio: 0x0000, 48000 Hz, stereo, s16
  21. Stream mapping:
  22. Stream #0.1 -> #0.0
  23. Press [q] to stop encoding
  24. size= 30864kB time=2633.66 bitrate= 96.0kbits/s
  25. video:0kB audio:30864kB global headers:0kB muxing overhead 0.000101%
  26. user@unknown:~/Videos$
Programming Language: Bash
You have successfully completed this tutorial.