FLV width x height broken

Locked
rdeman
User
Posts:4
Joined:Tue May 15, 2007 11:28 pm
FLV width x height broken

Post by rdeman » Tue May 15, 2007 11:56 pm

hi,

I tried a youtube video with getID3() 2.0.0b4
Im unable to extact the width and height (did not even try framerate)
also te resoluation_x, resolution_y is set but does not conatin any usable info. Also the keyframes in metadata contains binary stuff, could not paste it here

See below:

Code: Select all

array(1) {
  ["Filedata"]=>
  array(5) {
    ["name"]=>
    string(11) "youtube.flv"
    ["type"]=>
    string(24) "application/octet-stream"
    ["tmp_name"]=>
    string(14) "/tmp/phptKuVS1"
    ["error"]=>
    int(0)
    ["size"]=>
    int(7558352)
  }
}


getID3 data (full): array(13) {
  ["GETID3_VERSION"]=>
  string(7) "2.0.0b4"
  ["filesize"]=>
  int(7558352)
  ["avdataoffset"]=>
  int(0)
  ["avdataend"]=>
  int(7558352)
  ["mime_type"]=>
  string(11) "video/x-flv"
  ["flv"]=>
  array(3) {
    ["header"]=>
    array(5) {
      ["signature"]=>
      string(3) "FLV"
      ["version"]=>
      int(1)
      ["hasAudio"]=>
      bool(true)
      ["hasVideo"]=>
      bool(true)
      ["videoSizeType"]=>
      int(1)
    }
    ["audio"]=>
    array(4) {
      ["audioFormat"]=>
      int(2)
      ["audioRate"]=>
      int(2)
      ["audioSampleSize"]=>
      int(0)
      ["audioType"]=>
      int(0)
    }
    ["video"]=>
    array(1) {
      ["videoCodec"]=>
      int(2)
    }
  }
  ["fileformat"]=>
  string(3) "flv"
  ["meta"]=>
  array(1) {
    ["onMetaData"]=>
    array(9) {
      ["duration"]=>
      float(184.895)
      ["videodatarate"]=>
      float(326.97459639255)
      ["lastkeyframetimestamp"]=>
      float(179.96)
      ["lastkeyframelocation"]=>
      float(7272534)
      ["creator"]=>
      string(13) "YouTube, Inc."
      ["metadatacreator"]=>
      string(26) "YouTube Metadata Injector."
      ["haskeyframes"]=>
      bool(true)
      ["hasmetadata"]=>
      bool(true)
      ["keyframes"]=>
      array(1) {
        ["s
<< BINARY STUFF HERE>> =>
        int(0)
      }
    }
  }
  ["video"]=>
  array(6) {
    ["frame_rate"]=>
    NULL
    ["resolution_x"]=>
    int(16384)
    ["resolution_y"]=>
    int(-4318)
    ["codec"]=>
    string(14) "Sorenson H.263"
    ["dataformat"]=>
    string(3) "flv"
    ["lossless"]=>
    bool(false)
  }
  ["playtime_seconds"]=>
  float(184.895)
  ["bitrate"]=>
  float(40879.158441277)
  ["audio"]=>
  array(8) {
    ["codec"]=>
    string(3) "mp3"
    ["sample_rate"]=>
    int(22050)
    ["bits_per_sample"]=>
    int(8)
    ["channels"]=>
    int(1)
    ["lossless"]=>
    bool(false)
    ["dataformat"]=>
    string(3) "flv"
    ["channelmode"]=>
    string(4) "mono"
    ["streams"]=>
    array(1) {
      [0]=>
      array(7) {
        ["codec"]=>
        string(3) "mp3"
        ["sample_rate"]=>
        int(22050)
        ["bits_per_sample"]=>
        int(8)
        ["channels"]=>
        int(1)
        ["lossless"]=>
        bool(false)
        ["dataformat"]=>
        string(3) "flv"
        ["channelmode"]=>
        string(4) "mono"
      }
    }
  }
  ["playtime_string"]=>
  string(4) "3:05"
}


Allan Hansen
getID3() v2 developer
Posts:445
Joined:Sun May 04, 2003 2:22 pm
Location:Holmegaard, Denmark

Post by Allan Hansen » Wed May 16, 2007 6:10 am

Could this be the same bug as reported here?
http://www.getid3.org/phpBB2/viewtopic.php?t=703

rdeman
User
Posts:4
Joined:Tue May 15, 2007 11:28 pm

Post by rdeman » Thu May 17, 2007 11:57 am

yes and no: that is about V1.7.8 and it says it should be fixed (?)
in V2beta its still not fixed.

Allan Hansen
getID3() v2 developer
Posts:445
Joined:Sun May 04, 2003 2:22 pm
Location:Holmegaard, Denmark

Post by Allan Hansen » Thu May 17, 2007 12:59 pm

The error applies to the 2.0.x branch as well. Error not yet fixed due to lack of documentation on the FLV format.

rdeman
User
Posts:4
Joined:Tue May 15, 2007 11:28 pm

Post by rdeman » Fri May 18, 2007 12:56 pm

but what about other opensource projects such as ffmpeg? They tend to correctly detect the width x height of FLV files when I convert FLV to MPEG-4 for example?
Ans also http://www.osflash.org/flv ?

Allan Hansen
getID3() v2 developer
Posts:445
Joined:Sun May 04, 2003 2:22 pm
Location:Holmegaard, Denmark

Post by Allan Hansen » Fri May 18, 2007 1:25 pm

rdeman wrote:but what about other opensource projects such as ffmpeg? They tend to correctly detect the width x height of FLV files when I convert FLV to MPEG-4 for example?
Ans also http://www.osflash.org/flv ?
Thank you for that documentation link. Here is a quote from it:

>>In some cases it is also useful to decode some of the body of the video packet, such as to acquire its resolution (if the initial onMetaData META tag is missing, for example).<<

This is exactly the case and what the author of that module attempts. However it does not work properly. If you are willing to spend a little time helping us with the problem, take a look at module.audio-video.flv.php (from 2.0.0b4) line 131 and 135.

Locked