Jump to content

Alternate method of grabbing screenshot from video


br3nn4n

Recommended Posts

Without using FFMPEG that is, since my host refuses to allow it. I really don't want to change hosts just for this one thing, I'm happy otherwise, but I need this work.

 

I just need to grab a frame from a video when the user uploads the video. I can't use FFMPEG like I said, but I saw a suggestion someone had that said "have PHP open the video in fullscreen and take a screencap". That would work perfectly, I just have not a CLUE how to do it.

 

Does anyone have experience doing this? I just want it to grab a screenshot and have it saved as a jpg with the same filename as the video, for obvious reasons...call the video player and pass it the filename with a .jpg attached for the screenshot param.

 

Any help is appreciated! Thanks.

For any given host, it's much more likely that they'll have or allow you to use ffmpeg than you'll be able to do what that suggestion is talking about. Besides requiring a desktop environment (ie, window manager), appropriate video software and codecs, and security permissions on the server software to interact with the desktop, you'd still have to run stuff through a command line via functions like system() or exec(). Which are generally blocked on shared hosting environments.

 

Look into a remote service to get the frame(s) for you. I can't help you there but I would be surprised if there wasn't somebody offering that.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.