First of all, you are using FFmpeg-php, not php-FFmpeg. These are two different projects, where your FFmpeg-php project is (extremely) old.
The process difference when changing the frame to the 10,000th or 1,000th frame is way too high, probably caused by the poor php-ffmpeg image-extracting function. You can try out the 200,000th frame where I expect it is taking like 80 seconds? If this is true, then the toGDImage()
function is seriously way too slow!
Then you have some options to improve performance:
- Try to find out if you can adjust the
toGDImage()
function or use commands directly from FFmpeg-php, likeffmpeg -ss 00:10:00 -i input.avi -vframes 1 output.jpg
- Or try to implement the php-FFmpeg library, which contains a fast
extractImage()
function, which uses the command from above.