Problem with playtime string

Locked
dheeraj
User
Posts:3
Joined:Tue Sep 20, 2011 9:06 am
Are you a spambot?:no
Problem with playtime string

Post by dheeraj » Tue Sep 20, 2011 9:14 am

Hello Guys,
I have a problem in fetching out the playtime string. Its working fine for file sized less than 60MB or 65MB, but when I tried for 90 MB file its not showing good output. My code looks like below:

Code: Select all

$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze("testimonies.flv");
getid3_lib::CopyTagsToComments($ThisFileInfo);
echo $ThisFileInfo['playtime_string']; 
please guys help me...

Thanks.

James Heinrich
getID3() v1 developer
Posts:1477
Joined:Fri May 04, 2001 4:00 pm
Are you a spambot?:no
Location:Northern Ontario, Canada
Contact:

Re: Problem with playtime string

Post by James Heinrich » Tue Sep 20, 2011 1:16 pm

What do you mean by "not good output"?

The FLV module does have some breakout code that if it gets stuck in a long loop it will abort; this doesn't normally happen but if you have a particularly large/long FLV file it may be causing that. Are you able to provide a link to the 90MB file that is causing problems? (PM me the link, or post here if you like)

dheeraj
User
Posts:3
Joined:Tue Sep 20, 2011 9:06 am
Are you a spambot?:no

Re: Problem with playtime string

Post by dheeraj » Tue Sep 20, 2011 1:31 pm

Hello,
Thanks for the reply..

Here is a link: http://projects.pronixtech.net/kindcampaign/documentary

Look out the part called "Watch More Kind Videos", there you will see couple of videos thumbnail with title and playtime and navigation at the right side... navigate through the videos and you will see the 6th and 9th videos playtime some thing bad i mean its showing me like "104185:54" and "51446:07"

Thanks

James Heinrich
getID3() v1 developer
Posts:1477
Joined:Fri May 04, 2001 4:00 pm
Are you a spambot?:no
Location:Northern Ontario, Canada
Contact:

Re: Problem with playtime string

Post by James Heinrich » Tue Sep 20, 2011 2:32 pm

I see 4 video thumbnails under the "Watch More Kind Videos" banner, and I see some < > navigation buttons on the right side that would seem to be what you're talking about, but those buttons don't do anything (tried Chrome, Firefox, even IE). Is there some secret to seeing these other videos?

But what I really need is a link to the actual FLV file(s) that's causing the problem.

dheeraj
User
Posts:3
Joined:Tue Sep 20, 2011 9:06 am
Are you a spambot?:no

Re: Problem with playtime string

Post by dheeraj » Wed Sep 21, 2011 5:11 am

Hey I am sorry we just removed few videos and now the fourth video is the first one and last video is 4th... right now I have just given playtime as static for for both problematic videos and its a link of video http://projects.pronixtech.net/kindcamp ... monies.flv

James Heinrich
getID3() v1 developer
Posts:1477
Joined:Fri May 04, 2001 4:00 pm
Are you a spambot?:no
Location:Northern Ontario, Canada
Contact:

Re: Problem with playtime string

Post by James Heinrich » Wed Sep 21, 2011 2:47 pm

I've confirmed the bug in getID3.

There's two ways of determining the duration of a FLV file:
a) look at the metadata chunk near the beginning of the file (usually the first chunk, but not always, but almost always within the first 10 chunks). This chunk gives basic information about the file (duration, bitrate, resolution, etc) and is by far the preferred method to extract that info, since it involves reading very little of the file to get all the needed info. If the metachunk isn't found, getID3 has to fall back to the second duration calculation method:
b) step through every chunk of audio and video data in the file. Each chunk has a timestamp associated with it, so look for the largest timestamp and that's your file duration (give or take the length of one frame, or roughly 0.03s in this case).

In the case of your sample file, the meta chunk existed, but the duration field was zero (most commonly this would happen on live encodes, when the encoder doesn't know file duration before the encoding starts, and can't go back to rewrite the header later). getID3 now checks that the meta-chunk exists and it non-zero, and if it doesn't find a usable duration in the meta-chunk is now allowed to examine up to 100,000 frames (configurable) rather than the previous limit of 20 (which was plenty to find the meta-chunk, but not to scan the whole file).

The patched version of module.audio-video.flv.php is attached, and will be included in v1.9.2
Attachments
module.audio-video.flv.php
(22.36KiB)Downloaded 1086 times

Locked