Using PHP to Create a Poster Frame from a Video

I have a PHP script which I am using to grab a poster frame from an arbitrary video ($video). Currently it breaks the video into all its frames, counts the files, and grabs the middle one...
system("mplayer -vo png $video");
system("mv " . sprintf("%08d.png", floor(system("ls -1 | wc -l") / 2)) . " /home/.");
The issue with the code above is that, until completion, it fills up a large portion of the hard drive on the server. I know I can figure out the number of the middle frame with the code below, but I do not know of a way to pull out the middle frame without pulling out all the other frames too...
$fps = system("x=$(mplayer -msglevel all=0 -identify -vo null -frames 0 $video 2>&1 | grep ID_VIDEO_FPS) ; echo ${x#*=}");
$length = system("x=$(mplayer -msglevel all=0 -identify -vo null -frames 0 $video 2>&1 | grep ID_LENGTH) ; echo ${x#*=}");
$midframe = floor($fps * $length / 2);
Does anyone have any ideas? At the very least, is there a way I can read each frame but only save the middle one?

tony5429 wrote:Yeah; I may end up going with a solution like that. I had hoped to be able to seek to a specific frame. Really I'd like the script to be very robust - for example, if I pass it a 30-fps video that is one second long, I'd like to get the #15 frame...
Google told me mplayer can't seek to a specific frame, but does 1/100th of a second seeks. I'm not sure how precise the duration estimates are.

Similar Messages

  • Can Anyone give me a step by step on how to create a poster frame?

    I am trying to create a poster frame for a video I edited with Final Cut Express HD. I have read all kinds of topics but they seem complicated. Does anyone know a simple way of creating a poster frame ?
    Thanks!

    QDigital wrote:
    I am trying to create a poster frame for a video I edited with Final Cut Express HD. I have read all kinds of topics but they seem complicated. Does anyone know a simple way of creating a poster frame ?
    Thanks!
    Poster frame can mean a few things.
    More info please on what exactly you mean.
    Al

  • How do i create a still frame from a clip in iMovie 11? thanks

    Good morning. How do I create a still frame from a clip in iMovie 11.  Thanks

    First, get an app called MPEG Streamclip, which is free. (google MPEG Streamclip from Squared 5)
    Open MPEG Streamclip.
    In iMovie, select the clip you need. Then, right-click/Reveal in Finder.
    Drag this clip into MPEG Streamclip
    In MPEG Streamclip, move the playhead to the frame you want.
    In MPEG Streamclip, click FILE/EXPORT FRAME.
    Choose JPEG, TIFF, or PNG and give it a name.
    You can then drag this photo into iPhoto.
    Here is a video I made that steps through this...

  • How do you create a still image from a video using IMovies 11?

    How do you create a still image from a video using IMovies 11 on a Pro Mac?

    The simplest way is to do a simple screen capture.  

  • How do I create a still photo from a video in the new iMovie?

    How do I creat a still photo from a video in the new iMovie?

    I'll assume you want to create a still to use outside FCPX, not a still frame within FCPX.  It's kinda hidden in the "share."  Go File/Share/Add Destination.  You want "Save Current Frame."  After you've created that destination, it'll be there for you in the future under Share.

  • Creating a time lapse from a video

    Is there a way in iMovie 09 to discard frames in order to create a time lapse from a video that has already been shot? I realize that the normal way to create a time lapse is to assemble a group of stills into a video. What I'm looking for is sort of the other way around. If this is not possible in iMovie, does anyone know of other software that can do this?
    Thanks,
    Bob

    Yes. For example, you can set the speed to 800%.
    Also see [this article in MacWorld|http://www.macworld.com/article/143736/2009/11/speedimovie_video.html?lsrc=rssmain]

  • Print Out Still Frames From HD Video

    I am importing HD video into iMovie 08. I have made a few still frames from the video for printing. I could not export them to iPhoto or Photoshop Elements 2.
    How can I make HD video prints? Do I need new software?

    I have made a few still frames from the video for printing. I could not export them to iPhoto or Photoshop Elements 2.
    Select the "still frame" sequence and use the "Reveal in Finder" option to take you to the saved "still image" in the named_Project package. If you then double-click the image, it will open in Preview. Using Preview, you can print the image or save it to any of the available image formats in any "visible" location for later access by whatever graphic application you wish to use.

  • How do i export a single jpeg frame from a video file in final cut x

    how do i export a single jpeg frame from a video file in final cut x

    You can also use the 3 finger method of COMMAND+SHIFT+4, then drag across what you want to copy from the image. That will show up on your desktop, which then you can edit using Photoshop, if you want too.
    You can then change the file format from a PNG to either a .JPG or TIFF or even a Photoshop image.
    Make sure, you have stopped the playback, to what you want to save as a still.
    Either method works, to make a still image from video.

  • Capture a frame from a video clip and save as a photo

    I create a freeze frame in a video clip, select it, and cut it, but it doesn't go into the general copy/paste buffer. How can I export the frame as a photo?

    See my post here for full instructions.
    https://discussions.apple.com/docs/DOC-3231

  • I cannot save a frame from a video following the recent Apple recall to replace my hard drive. There is no menu option with share  and save frame. Do I need to reinstall Final Cut Pro?

    Since the recent replacement of my hard drive, I cannot save a frame from a video. There is no menu option with share and "save frame"  I used to be able to do this.
    Please help

    In the Share popup select Add Destionation to go to the Destination preference. Drag still image to the sidebar to make it available in the popup.

  • Creating a PAL DVD  from NTSC Video camcorder

    Can the latest version of iMovie create a PAL DVD from NTSC Video camcorder? What are best practices and workflow to create a PAL DVD from NTSC sources.

    iMovie doesn't create DVDs, iDVD does..
    in iM's prefs, set Video to 30fps = NTSC
    quit and relaunch to take changes in effect
    in iDVD's prefs, set Video to 25fps = PAL
    quit and relaunch to take changes in effect
    when finished with editing in iM, Share to Mediabrowser
    in iDVD, select a theme, grab movies from Mediabrowser
    burned DVD will be PAL ..

  • How to automate creating movie poster frames?

    Hello.
    I have a fairly large movie library in itunes now, about 500 movies. I know how to right click a frame of a movie and set a poster frame. However this seems very slow and doesn't always work perfectly. Does anyone have any ideas or scripts that would automate the process? Even if it just sets the poster frame at 2 minutes into every movie it would be better than the 1st frame, Thanks for any ideas.

    I have not had my question answered yet. I am guessing its not possible. However the problem you mentioned is not an issue for me. I can pause a video, right click on it, and the bottom choice is to set a poster frame.
    What I want is to have something automate the process of picking a different point as the poster frame without having to select it on each and every video. I have 500 videos and this could take way too long. I would imagine there is an easier way to set all videos to use the 30 second mark as the poster frame.

  • Using RMAN to create single instance standby from 2 node rac

    Any advice on the RMAN command to take a non catalog full rman backup from a two node 11gr2 rac node and use it to create the STANDBY single instance.
    The RAC two node instance is in ASM (Linux)
    The Physical Standby is Normal File System (Linux)
    The command that I get from Metalink suggests:
    rman target sys/passwd@primary catalog RMAN/RMAN@RMAN auxiliary sys/passwd
    RMAN> run {
    allocate auxiliary channel C1 device type disk;
    duplicate target database for standby;
    When I took the rman backup I did not use catalog. Please suggest how to accomplish the same task without catalog. Thanks

    Listener.ora
    SID_LIST_STANDBY_LSNR =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = KEMETRAC.respecti.com)
    (SID_NAME = STANDBY)
    (ORACLE_HOME = /u02/standby/11.2.0.3/STANDBY)
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u02/standby/11.2.0.3/STANDBY)
    (PROGRAM = extproc)
    ADR_BASE_STANDBY = /u02/standby/11.2.0.3
    TRACE_LEVEL_STANDBY = OFF
    STANDBY_LSNR =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby.respecti.com)(PORT = 2012))
    LOGGING_STANDBY = OFF
    ...... Tnsnames.ora
    STANDBY.RESPECTI.COM,STANDBY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = standby.respecti.com)(PORT = 2012))
    (CONNECT_DATA =
    (SERVICE_NAME = STANDBY.respecti.com)
    KEMETRAC1.respecti.com, KEMETRAC1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.respecti.com)(PORT = 2012))
    (CONNECT_DATA =
    (SERVICE_NAME = kemetrac1.respecti.com)
    KEMETRAC2.respecti.com, KEMETRAC2 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.respecti.com)(PORT = 2012))
    (CONNECT_DATA =
    (SERVICE_NAME = kemetrac2.respecti.com)
    # TAF 2 Node RAC
    KEMETRAC.respecti.com, KEMETRAC =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (FAILOVER = ON)
    (LOAD_BALANCE = ON)
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.respecti.com)(PORT = 2012))
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.respecti.com)(PORT = 2012))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = kemetrac.respecti.com)
    (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
    (RETRIES = 180)
    (DELAY = 5)
    The Standby has been started up with nomount.
    standby> rman target sys/[email protected] auxiliary sys/pw
    Recovery Manager: Release 11.2.0.3.0 - Production on Wed Jan 18 18:16:46 2012
    Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
    connected to target database: KEMETRAC (DBID=1448030790)
    connected to auxiliary database: KEMETRAC (not mounted)
    RMAN>
    RMAN> run {
    2> duplicate target database for standby from active database dorecover nofilenamecheck;}
    Starting Duplicate Db at 18-JAN-12
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 01/18/2012 18:23:06
    RMAN-05501: aborting duplication of target database
    RMAN-06217: not connected to auxiliary database with a net service name
    RMAN>

  • How do I create a freeze frame from footage and extend that for 5 seconds?

    I have a quicktime screen grab movie I've imported, and I want to hold on a certain frame that's at the very beginning of the clip, and then proceed with the movie when the voiceover (separate soundtrack) gets to a certain point.
    iMovie 11.
    Thanks
    doug

    Hi Doug,
    Position the playhead/skimmer (vertical red line) at the very beginning of the clip. The playhead should snap to the first frame, provided you have this turned on in the menu item View > Snap to Ends.
    Without moving the playhead, right-click (or Control-click) and select Add Freeze Frame from the pop-up menu. The default duration is 4 seconds (although this setting can be changed for individual projects in File > Project Properties). To adjust the duration in the timeline, double-click on the freeze frame to open the Inspector. In the Clip tab you can change the duration by typing in a new time.
    John

  • Poster Frames on Ripped Videos Lost, Not Synced to iPad or iPhone

    iTunes 10.2.1 on latest Mac OS X 10.6.7.
    I have videos which I've ripped from Blu-ray via MakeMKV and Handbrake. When I import them into iTunes and then set a poster frame, more often than not:
    1. The poster frame is easily lost, especially if I do a Get Info on a movie. Sometimes the poster frame disappears without me having done anything.
    2. The poster frame is not included when I sync the movie onto my iPad or iPhone.
    3. Also, chapter thumbnails for chapters appear in all black on the iPad or iPhone.
    This is seriously lame. Does anyone know of a solution for these problems? Is ANYONE from Apple working on this? This USED to work in the days before iOS 4.2 and iTunes 10.

    I've just experienced  similar problem at work and found a solution to some extent. Initially we got the video artwork looking correct in itunes by right clicking on the video window whilst it was playing and clicking 'set poster frame', however although this worked for itunes the artwork dissappeared once on the iPad. The solution I have found is to use metaX on the pc to set the .mp4 video artwork and then use itunes on my mac to sync the videos. It's worth noting that every time I tried to use the mac version of metaX to add the artwork it made the entre video into a black screen.
    Basically it seems itunes fails to proerly tag the metadata of some files, luckily other programs like metaX seem to do it ok.

Maybe you are looking for

  • OB52 or S_ALR_87003642

    Dear Friends, We wanted to schedule job for open and close FI period. I did it many times manually through OB52 or S_ALR_87003642. I also did it with ABAP program as backgroudn job. Can we schedule job with OB52 or S_ALR_87003642 as SAP standard tras

  • IPhone on-screen info suddenly too BIG to fit screen

    My iphone 5 went NUTS overnight.  Can't use it today.  Why? It worked flawlessly yesterday, even while charging.  Today, I tried to use it and it's impossible.  Everything I see on screen is now, suddenly, too big to fit on screen  --  icons, text, n

  • MBP increasingly slower when not connected to network

    When connected to the network at work (either through WiFi or ethernet cable) my macbook pro works OK. However, when I am travelling or take my MBP home performance starts degrading to a point where launching something like Dictionary can take 15-20

  • Flash Builder 4: "Flex 2 is not supported; use Flex 3.0.0 or higher "

    In our project we have to maintain an application developed in Flex 2, but we have licensed Flash Builder 4, which is now available for Adobe only. When we tried to configure Flash Builder 4 with Flex 2 SDK we get the following error: "Flex 2 is not

  • Language Update/Installation during EHP7 Upgrade

    Hi guys, during an EHP7 Upgrade, we are facing the following issue. Chinese Traditional Language was installed like 5 years ago but it was left inconsistent, since its a Non-Unicode SAP. So, during the upgrade, we would like to uninstall it, as SUM s