TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-01-2008, 09:26 PM   #1 (permalink)
The Contributor
 
oMIKEo's Avatar
 
Join Date: Jan 2008
Location: Leeds
Posts: 52
Thanks: 7
oMIKEo is on a distinguished road
Default 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
Send a message via MSN to oMIKEo
oMIKEo is offline  
Reply With Quote
Old 04-01-2008, 09:47 PM   #2 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

#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.
xenon is offline  
Reply With Quote
Old 04-01-2008, 10:08 PM   #3 (permalink)
The Contributor
 
oMIKEo's Avatar
 
Join Date: Jan 2008
Location: Leeds
Posts: 52
Thanks: 7
oMIKEo is on a distinguished road
Default

Thanks xenon, i thought that might be the better option. Can anyone else help with the other questions? Thanks!
Send a message via MSN to oMIKEo
oMIKEo is offline  
Reply With Quote
Old 04-03-2008, 06:58 PM   #4 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

#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).
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
The Following User Says Thank You to xenon For This Useful Post:
oMIKEo (04-03-2008)
Old 04-03-2008, 09:02 PM   #5 (permalink)
The Contributor
 
oMIKEo's Avatar
 
Join Date: Jan 2008
Location: Leeds
Posts: 52
Thanks: 7
oMIKEo is on a distinguished road
Default

Thanks xenon.

Last edited by oMIKEo : 04-07-2008 at 04:33 PM.
Send a message via MSN to oMIKEo
oMIKEo is offline  
Reply With Quote
Old 04-07-2008, 04:35 PM   #6 (permalink)
The Contributor
 
oMIKEo's Avatar
 
Join Date: Jan 2008
Location: Leeds
Posts: 52
Thanks: 7
oMIKEo is on a distinguished road
Default

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:
www.url.com/whateverPage.php?video=
The include file will then take the $video value and run video 1, I could then also do something like:

PHP Code:
www.url.com/whateverPage.php?video=top10 
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:

PHP Code:
www.url.com/whateverPage.php?video=top10&jump=
This would then play video 3 of the top10.

Is that the best way to do this or how should I approach it?

Thanks
Send a message via MSN to oMIKEo
oMIKEo is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:26 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design