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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.