![]() |
ffmpeg video converting
Hi guys,
I'm just starting a new project and wanted to know the best way to approach it. I need to take uploaded video from users (.mov, .mpeg, .avi, etc), save the filename in a mysql database and then using ffmpeg convert them to a .flv on the server. Does anyone have experience of this and can you help with these questions: 1. What is the best way to initiate the convert? Should i use a cronjob or something to run every minute and see if any videos need converting - my reason for asking is that if it was initiated when the user had just uploaded it wouldn't their screen sort of freeze until the server had finished the convert and then finish loading the page? 2. I would like to run an advert before videos, the adverts will be in a .flv format but how would i get the video to run once that had completed? My initial thought was to take the time of the advert and then have a redirect after that amount of time but this wouldn't really work as there is a loading time of the advert to take into consideration, user internet connection, etc. 3. I will have a list of say the top 10 videos and want the users to click a play all button, the .flv file names would be stored in a DB but, as in question 2, how could i get it to jump to the next video after one is complete? 4. I haven't really used ffmpeg but i believe it can be used to take a thumbnail from say the centre point of a movie and add a watermark of our logo - is that right? Think that's it - sorry if none of those make sense! Thanks for any advice, Mike |
#1: I suggest you go for a cron job. Assuming you store the file name in a database, you could also set a status for it: like 0 - not processed, 1 - processing ok, -1 - invalid file. Then, the cron job pulls the first 50 files added (or less, depending on your needs), and updates the status for each file processed. Then, you would display only the files with the status '1' on your page.
|
Thanks xenon, i thought that might be the better option. Can anyone else help with the other questions? Thanks!
|
#3: you could use a XML file. Actionscript can read from XML files easily.
#4: yes, ffmpeg can do that. You will just have to apply the watermark and output the file (e.g.: save the file to disk). |
Thanks xenon.
|
I just wanted to ask a question about the xml side of things:
I will be playing videos on a number of different pages, some will just play 1 video and others with play many. My thinking for this is that I have the player as an include (so use the same player for all sections). Then I would use something like: PHP Code:
PHP Code:
PHP Code:
Is that the best way to do this or how should I approach it? Thanks |
| All times are GMT. The time now is 01:08 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0