February 23, 2005

first thoughts on ffmpeg-php

1. this, esp as a php extension, is not made to pull 300+ images out of a video file on the file. it takes upwards of 6+ minutes to get through those 300.

2. it seems to slow the entire server to a crawl when it runs through the process. this obviously bears more investigation (and im sure marientina will let me know if im already destroying the speed).

3. this is all after compressing the movie to a smaller size - taking a 90 minute / 130 meg movie down to 30 megs. this was done by compressing the quality, the size and dumping the audio.

4. a solution would be the following: get the frame number. see if there is a file existing already for said frame. if so, output the existing frame. if not, create a new file and output the frame into it. then display that new file. the problem with this solution is this: its no better in the long run than dumping every frame out into a directory to start with. this new way requires some file system checks which might be faster than outputting the frame. but they system is predicated on the weighted good moments coming to the surface before you save out every frame of the movie. if we do it this way even for 1 frame a minute, the entire movie could be saved out in as few as 900 reloads. if we do it for 20 second intervals, then its 300 reloads. i am not convinced this is worth it. esp when you end up with 80,000 images in the folder. filesystems dont seem to like this.

so what do i do? well, for now my design shifts slightly and i see what happens with 1 frame per minute and letting the page take a little longer ot load. its a balance and if everyone complains, then i keep trying to find a solution. but this is one of those 'in 5 years...' kind of issues that doesnt seem truly within my scope this year to solve. i have bigger fish to fry right now than making lightning fast webpages. unless everyone starts complaining.

in the meantime, back to rewriting code....

Posted by tripp at February 23, 2005 09:04 PM



Comments

Try version 0.4.3 of ffmpeg-php and turn on persistent resources. This will tell ffmpeg-php to keep movies open in between requests. This should give you at least a 6x speed up when pulling multiple frames from a single movie and will be alot less stress on your server.

Posted by: Todd Kirby at March 14, 2005 10:16 AM


Hi there,

I would like to use ffmpeg-php for generating thumbnails of videos on my site. Do you know where I can find a hosting provider for that ? My current hosting provider does not allow installation of this php extension...

Thanks

Posted by: David Pooxi at May 20, 2005 10:02 AM


Post a comment




Remember Me?