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!
#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.
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
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:
The include file will then take the $video value and run video 1, I could then also do something like:
The include file would then play the top10, and use something like a $jump variable to say which video in the top10 to play like this:
This would then play video 3 of the top10.
Is that the best way to do this or how should I approach it?