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.
Tags: ffmpeg, flv, mp3
December 9th, 2008 at 6:30 am
Convert MP3 to FLV?
Really? As far as I know, MP3 only have audio.
March 27th, 2009 at 12:47 am
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.
April 3rd, 2009 at 4:21 am
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
September 17th, 2009 at 12:48 am
This lib is required for conversion to the mp3 format,just reinstall ffmpeg with this lib included and it should be ok.
September 25th, 2009 at 6:53 am
Using Ubuntu 8.04 and got the “Unknown codec ‘libmp3′” error message.
Just change it too mp3 and it should work.
October 13th, 2009 at 5:56 pm
use what you have: you were close…
ffmpeg -y -i live.mp3 -f flv -acodec libmp3lame -ab 64 -ac 1 live.flv
December 23rd, 2009 at 10:48 pm
–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
February 16th, 2010 at 9:12 am
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 ′)
March 3rd, 2010 at 11:21 pm
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