Path

ez projects / ezvideoflv / forum / general / frame count fails on some f...


frame count fails on some files - fatal error

You need to be logged in to post messages in the forums. New users may register here.

Marko Žmak

Member since:
09 January 2008

Posts: 52

Tuesday 07 September 2010 2:57:29 am

On some files (I have tried with some wmv samples) the getFrameCount() of FFMPEG_movie object returns the value of -1 although the movie is OK and converted to flv without problems (this is probably some bug in the ffmpeg php extension).

But the consequence is that the $frame_number for the preview thumb is less than 1 which produces eZ fatal error when displaying video preview thumb - because of using this $frame_number value with $ffmpeg->getFrame().

The possible sollution would be to add this code:




       // If the frame number is less than 1 we fall back to the first frame


       if ($frame_number < 1) $frame_number = 1;




to the line 156 of datatypes/ezvideoflv/ezvideoflv.php.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Up

Denitsa M.

Member since:
09 January 2008

Posts: 11

Tuesday 07 September 2010 9:42:28 am

Also, here can be said that getFrameCount() does not count correctly for some files for reasons that I cannot imagine. This has always been a problem in the ffmpeg and was presented in flv extension since the beginning. It can cause improper preview generation and/or error from GD during conversion process, especially if you want to add a preview frame field into the datatype so editor can put manually preview frame number during edition/creation of object. This can be easily avoided by adding own php code for counting frames and comparing and correcting the result from getFrameCount() method.
Up

You need to be logged in to post messages in the forums. New users may register here.