CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2004
    Posts
    187

    Angry Find out the width and height of a video

    Is there anything similar to getimagesize to get the width and the height of a video?
    I´ve uploaded some videos to my server and would like to find out those infos using php.
    Any ideas?

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Find out the width and height of a video

    I have yet to see this done. I even checked at PHP Classes.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Aug 2002
    Posts
    879

    Re: Find out the width and height of a video

    Well depending on the video formats you have you can use

    http://getid3.sourceforge.net/

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Find out the width and height of a video

    That gets tag information. Dimensions are not stored in ID3 tags.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Aug 2002
    Posts
    879

    Re: Find out the width and height of a video

    getid3() is not only about id3 tags!

    From the HP
    "getID3() is a PHP script that extracts useful information from MP3s & other multimedia file formats"

    e.g.
    PHP Code:
    <?php
    require_once('getid3-2.0.0b4/getid3/getid3.php');

    $getID3 = new getID3;
    $filename "vid/clock.avi";
    $fileinfo $getID3->analyze($filename);

    echo 
    "<pre>";
    print_r($fileinfo);
    echo 
    "</pre>";
    ?>
    will give you back
    PHP Code:
    .............................
    .............................
    [
    video] => Array
            (
                [
    bitrate_mode] => vbr
                
    [dataformat] => avi
                
    [resolution_x] => 321
                
    [resolution_y] => 321
                
    [total_frames] => 12
                
    [frame_rate] => 1
                
    [fourcc] => RLE 
                
    [codec] => Microsoft Run Length Encoder
                
    [pixel_aspect_ratio] => 1
                
    [lossless] => 
                [
    bits_per_sample] => 8
                
    [bitrate] => 43622.6666667
                
    [compression_ratio] => 0.0529190645795
            
    )
    ......................
    ...................... 
    check-out
    http://getid3.sourceforge.net/source/structure.txt
    for the whole structure

    Here you can find more examples
    http://getid3.org/phpBB2/viewforum.php?f=3
    Last edited by blueday54555; December 12th, 2007 at 05:18 AM.

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: Find out the width and height of a video

    Ah, I missed that. Nice work!!!
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured