Search code examples
phpmp3flvserver-side

mp3 to flv on the server side how to?


I googled it for a long time, all I found was the ffmpeg php api, and a site called mp32tube .. now I was to have the exact same functionality of mp32tube I want to give my users the ability to upload an mp3 add a picture, then compile an FLV on the server that contains the picture and the mp3...

the rest I can do, like uploading the video to youtube, it's simple with their own API ..

can anyone please guide me to something that automatically does this on my server? (a centos powered VPS)

thank you very much.

Rami


Solution

  • You should read FAQ first. http://www.ffmpeg.org/faq.html#SEC14

    then to add sound you may try;

     ffmpeg -ar 22050 -ab 128k -i song.mp3 -i videoHaveNoSound.flv VideoWithSound.flv
    

    Let me know the result.

    in addition:

    you findout a shorter way;

     ffmpeg -r 12 -b 1800 -i img.jpg -i yourSound.mp3 -acodec copy outVideo.flv