icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » Converting video with PHP?

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old April 9th, 2008, 3:43 PM   #1 (permalink)
DemonicAngel
Super #1
 
twirp's Avatar
 
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
1,807 posts
Gave thanks: 25
Thanked 33 times
Converting video with PHP?

'alo!
So I have a few questions before I kill something.
If I have PHP convert a video, does it keep the script active while it's converting, or does the converting go into a background process?
If it does go into a background process, is there a way to make it e-mail me when it's done?
I was also wondering if someone could give me a quick and dirty rundown of ffmpeg and using it to convert videos...
I noticed that a lot of the tutorials I've seen don't specify the -f, is it optional or something?

Thanks for any help or advice.
__________________
You wear Vans so high school kids will think that you can skate. He wears Vans because he can skate. TwiRp wears Vans because they were on sale. Pass76 wants Vans.
twirp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 10th, 2008, 1:31 AM   #2 (permalink)
Registered User
Seasoned Poster
 
Joined in Sep 2003
51 posts
Gave thanks: 4
Thanked 5 times
Hi,
I am not sure about your first question but for your next questions:
-if you are doing the conversion with a command like exec calling the ffmpeg utility on the server, you can just add an email function after the exec line.
-if you are doing the conversion by calling a server-side script such as python, you can add an email function on to that script. I saw python scripts written for video conversion.
-you can use ffmpeg.so as an php extension and then use ffmpeg-php library to utilize this extension.
from my bookmarks:
Upload and convert video server side
Yet Another Blog from Luar One-stop Installation Guide for Create a Linux Server-side FLV conversion environment
ffmpeg-php API documentation
[DB75]: FLV Encoding with FFmpeg
video converter - ffmpeg Linux by Examples

hope it helps..
__________________
server: pass40
sascoms is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks sascoms for this great post!
twirp (April 10th, 2008)
Old April 10th, 2008, 10:13 PM   #3 (permalink)
DemonicAngel
Super #1
 
twirp's Avatar
 
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
1,807 posts
Gave thanks: 25
Thanked 33 times
Does anyone have suggestions for reasonable frame rates and audio rates. I don't want to have the person waiting forever for the video to load, but I don't want it to sound or look crappy.
__________________
You wear Vans so high school kids will think that you can skate. He wears Vans because he can skate. TwiRp wears Vans because they were on sale. Pass76 wants Vans.
twirp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 10th, 2008, 10:46 PM   #4 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Hosted on Gojira
8,027 posts
Gave thanks: 48
Thanked 129 times
What resolution will the videos be at... and what will your keyframe setting be? If you're transcoding to FLV, keyframes are insanely important as they have to be balanced between panning the video and file size.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 10th, 2008, 11:12 PM   #5 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,218 posts
Gave thanks: 18
Thanked 86 times
If you go look here: DVD - 300 | Mark R Headrick's Website

You'll see Trailer 1 done in several versions. The audio in all of them is 128bit, 44.1Khz, Stereo. The bps setting in the filename is the Video bitrate. With the hires versions, some of the lower-speed broadband connections will start buffering, such as AT&T's lowest speed DSL offering, which my parents have.

I do all my conversions on the PC. Video conversion takes up too much CPU resources for a shared environment.. unless you can force it to run in some low priority mode so as to not impact others.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 11th, 2008, 12:18 AM   #6 (permalink)
minor deity
Super #1
 
Bigjohn's Avatar
 
Joined in Apr 2004
Lives in Georgia
Hosted on XEON
7,332 posts
Gave thanks: 23
Thanked 93 times
most pc's can do a good job with flash at 15fps, 32k audio (22k sample) and 96k video frame rate for a 320x240 video.
__________________
Proud to be a Surmunity Mod!
XEON PASS60 PASS61
Make a fundamental difference!
My Sites:
Curious about Brewing Beer? Join the community!
>>>>> Some Change is GOOD! Keep your paycheck! Support the Fair Tax
Get into an Art museum
Victorian London
It's your brain -ON WEB - mybrainhost.com (under development)
What SHOULD Government do? Much Less than it Does!
Bigjohn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 11th, 2008, 12:30 AM   #7 (permalink)
DemonicAngel
Super #1
 
twirp's Avatar
 
Joined in Aug 2004
Lives in Wherever The World Takes Me
Hosted on Pass76
1,807 posts
Gave thanks: 25
Thanked 33 times
Quote:
Originally Posted by MarkRH View Post
I do all my conversions on the PC. Video conversion takes up too much CPU resources for a shared environment.. unless you can force it to run in some low priority mode so as to not impact others.
It's not on a shared server, so there's no need to worry. I was converting some videos earlier and didn't notice too much of an impact (it's adds the video to a queue and does one video from the queue every 30 minutes or so and the videos are under 10 minutes). The first few times I was testing it, the image quality was low, but that was because of a low bitrate (I think). I'm still trying different settings. I almost have the quality and file size I want. One problem I'm running into though is that the the duration and other metadata (I guess?) isn't being written, so now I'm looking up info on the flvtool2...
__________________
You wear Vans so high school kids will think that you can skate. He wears Vans because he can skate. TwiRp wears Vans because they were on sale. Pass76 wants Vans.
twirp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Rate This Thread
Rate This Thread:

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

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