Skip Menu |

This queue is for tickets about the FLV-Info CPAN distribution.

Report information
The Basics
Id: 29831
Status: open
Priority: 0/
Queue: FLV-Info

People
Owner: Nobody in particular
Requestors: gosukenator [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Flv files of ustrem have 0 length audio body.
I got flv files from ustream and tried to get information of these files. (How to get flv files from ustream desccribed here: http://use.perl.org/~miyagawa/journal/34603) But I got an error like this: Failed to read FLV file: Tag size is too small (0) at byte 193 (0xc1) at /usr/local/lib/perl5/site_perl/5.8.7/FLV/Tag.pm line 81. Because of ustream flv files have 0 length audio body. So I wrote a patch to fix it. It is not a bug, but I with that it will be fixed. Thanks. === lib/FLV/AudioTag.pm ================================================================== --- lib/FLV/AudioTag.pm (revision 2255) +++ lib/FLV/AudioTag.pm (local) @@ -44,6 +44,8 @@ my $file = shift; my $datasize = shift; + return unless $datasize; + my $flags = unpack 'C', $file->get_bytes(1); my $format = (($flags >> 4) & 0x0f); === lib/FLV/Tag.pm ================================================================== --- lib/FLV/Tag.pm (revision 2255) +++ lib/FLV/Tag.pm (local) @@ -76,10 +76,10 @@ warn "Funny timestamp: @timestamp -> $timestamp\n"; } - if ($datasize < 11) - { - die "Tag size is too small ($datasize) at byte " . $file->get_pos(-10); - } + #if ($datasize < 11) + #{ + # die "Tag size is too small ($datasize) at byte " . $file->get_pos(-10); + #} my $payload_class = $TAG_CLASSES{$type}; if (!$payload_class)
(this is a duplicate of RT #29830)
oops, closed the wrong one
On Mon Oct 08 00:37:02 2007, MIZZY wrote: Show quoted text
> I got flv files from ustream and tried to get information of these files. > > (How to get flv files from ustream desccribed here: > http://use.perl.org/~miyagawa/journal/34603) > > But I got an error like this: > Failed to read FLV file: Tag size is too small (0) at byte 193 (0xc1) at > /usr/local/lib/perl5/site_perl/5.8.7/FLV/Tag.pm line 81. > > Because of ustream flv files have 0 length audio body. > So I wrote a patch to fix it. > > It is not a bug, but I with that it will be fixed. > > Thanks. >
This is a tough call. Technically, your FLV files are invalid according to the specification. The audio tag is not allowed to have size zero. But, I have come across FLV files like this, and Flash plays them OK. I'm going to think about this for a while...
From: jnicholl [...] rim.com
On Mon Oct 08 01:13:55 2007, CDOLAN wrote: Show quoted text
> On Mon Oct 08 00:37:02 2007, MIZZY wrote:
> > I got flv files from ustream and tried to get information of these
files. Show quoted text
> > > > (How to get flv files from ustream desccribed here: > > http://use.perl.org/~miyagawa/journal/34603) > > > > But I got an error like this: > > Failed to read FLV file: Tag size is too small (0) at byte 193 (0xc1) at > > /usr/local/lib/perl5/site_perl/5.8.7/FLV/Tag.pm line 81. > > > > Because of ustream flv files have 0 length audio body. > > So I wrote a patch to fix it. > > > > It is not a bug, but I with that it will be fixed. > > > > Thanks. > >
> > This is a tough call. Technically, your FLV files are invalid according > to the specification. The audio tag is not allowed to have size zero. > But, I have come across FLV files like this, and Flash plays them OK. > > I'm going to think about this for a while...
Actually, this problem also applies to valid tags that have non-zero length, but have length < 11. The calculation of datasize gives the length of the body *excluding* the header, so there is no reason why the datasize must be >= 11. Thanks.