Menu

#27 ffmpeg function getFrame() not working properly

open
nobody
None
5
2006-08-24
2006-08-24
No

Hello,
I have coded a script that makes thumnails of a video.
here is my code

10) $mov = new ffmpeg_movie($videospath);
11) $duration = round($mov->getDuration(),0).'s';
12) $height = $mov->getFrameHeight();
13) $width = $mov->getFrameWidth();
14) $image = imagecreatetruecolor($width,$height);
15) $frame = new ffmpeg_frame($image);
16) print is_object($frame)." obj1 ";
17) $frame = $mov->getFrame(1);
18) print is_object($frame)." obj2 ";
19) $image = $frame->toGDImage();
20) @imagejpeg($image, $videospath.$vid.'.jpg', 100);

This code works fine for some movies and makes the
thumbnail image but for some movies it did not make
thumnails and give the following error.

1 obj1 obj2
Fatal error: Call to a member function on a non-object
in /home/iideshow/public_html/inc/makeVideoPics.php on
line 19

In try to debug the error I add two extra statements
in my code on lines 16 and 18 and u can see in the
output before the calling of function
$mov->getFrame(1); on line 17 the frame object exists
but on line 18 it is not.

Can any one guid me wht's the problem here.
Remember it works on some videos but on most of the
videos it did not.

waiting for your help.
Thanks
Junaid

Discussion

  • Todd Kirby

    Todd Kirby - 2006-08-27

    Logged In: YES
    user_id=31420

    Moving this from feature requests to bugs

     
  • Nobody/Anonymous

    Logged In: NO

    It, so far, has worked for me on all videos. It's just a matter of maxing out the frame. On some videos, the max frame I can grab is 4544, on others, it's different.

     
  • Philippe

    Philippe - 2008-07-14

    Logged In: YES
    user_id=1412144
    Originator: NO

    Hello,

    I'm having the same problem with ffmpeg-php 0.5.3.1 and ffmpeg SVN (rev 24234)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.