开发者

mp3 to flv on the server side how to?

开发者 https://www.devze.com 2023-02-03 16:56 出处:网络
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 t开发者_开发问答he ab

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 t开发者_开发问答he 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


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


There is no "automatic" way to do this. You'll have to have the user upload the 2 pieces of data, then run them through ffmpeg. There is tons of documentation for ffmpeg out there, just research the command you'll need to run, test it outside of php first, then once you get it working, implement it in your script. After its gone through ffmpeg, delete the files used for creation, and let them download the resulting flv.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号