Converting mp3 to flv with ffmpeg

FFmpeg Add comments

Sometime last year I encountered a problem with playing mp3 flies online, The problem I had was the player which I had embedded on the page only worked for windows machines which was a problem because I work on a Linux machine all the time. I then decided to convert the mp3 files to a flv format and use a flv player on the site,this setup allowed for songs to be played on site via a flash player which worked on a Windows,Linux and Mac environments as long as the browser supported flash.

The code that did the trick:

ffmpeg -y -i myfile.mp3 -f flv -acodec libmp3 -ab 64 -ac 1 myfile.flv

This is useful if you are running a music site of some sort where you want to make sure that users can listen to the site music files online regard less of what operating system they are running.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Tags: , ,

9 Responses to “Converting mp3 to flv with ffmpeg”

  1. free mac video converter Says:

    Convert MP3 to FLV?
    Really? As far as I know, MP3 only have audio.

  2. evodanh Says:

    Convert to FLV file, that has only have audio, no video! You can’t see anything, but you can hear or listen music of this file.

  3. Amigo Says:

    Hello Mate

    I tried to execute following ffmpeg,

    ffmpeg -y -i /var/www/punehtml/streamspec/web/uploads/temp/ss_1238712868.mp3 -f flv -acodec libmp3 -ab 64 -ac 1 /var/www/punehtml/streamspec/web/uploads/temp/ss_mp3.flv

    And getting

    Duration: 00:04:27.2, start: 0.000000, bitrate: 127 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
    Unknown codec ‘libmp3′

    Can you tell me what is this ‘libmp3′ ??

    Quite Urgent!!!

    Thanks

  4. Kamran_Pakistan Says:

    This lib is required for conversion to the mp3 format,just reinstall ffmpeg with this lib included and it should be ok.

  5. George Says:

    Using Ubuntu 8.04 and got the “Unknown codec ‘libmp3′” error message.

    Just change it too mp3 and it should work.

  6. tao Says:

    use what you have: you were close…

    ffmpeg -y -i live.mp3 -f flv -acodec libmp3lame -ab 64 -ac 1 live.flv

  7. jaymin Says:

    –ffmpeg is installed fine on my server
    –when i used below php script, output is …

    define(’FFMPEG_LIBRARY’, ‘ /usr/local/bin/’);

    $exec_string = FFMPEG_LIBRARY.’ffmpeg -y -i beep.mp3 -f flv -acodec libmp3 -ab 64 -ac 1 testfl.flv’;

    exec($exec_string) or die (”ffmpeg did not work”);

    output is:
    ffmpeg did not work

    also i have used

    exec(FFMPEG_LIBRARY.’ffmpeg -i notify.wav newtest.mp3′);

    but same result

    can anyone help me in his?

    thanks

  8. Root Says:

    When executing an ffmpeg command via php, it is important to add the following ” 2>&1″ at the end of the script.
    e.g exec(FFMPEG_LIBRARY.’ffmpeg -i notify.wav newtest.mp3 2>&1 ′)

  9. Rupali Says:

    I used the command as suggested by TAO and it worked gr8.
    But i am getting a warning as mentioned below. Can someone pls suggest how i can overcome this warning.
    Can someone pls explain what if i change bitrate 64 to some higher bit rate, what effect it will have on the output file. i mean will the sound quality be affected? Please suggest.

    WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in