getId3 to get video duration in seconds

codernoob8

How do i get getId3's playtime_string duration in seconds? Is there away to get directly in seconds? Without using other php functions to look at the string and pull it out of the value?

  <?php require_once('getid3/getid3.php');
    $filename='uploads/4thofJuly_184.mp4';
    $getID3 = new getID3;
    $file = $getID3->analyze($filename);
    echo("Duration: ".$file['playtime_string'].
    " / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
    " / Filesize: ".$file['filesize']." bytes<br />");
    $getID3 = new getID3;
    $filename='uploads/25PercentOff_710.wmv';
    $file = $getID3->analyze($filename);
    echo("Duration: ".$file['playtime_string'].
    " / Dimensions: ".$file['video']['resolution_x']." wide by ".$file['video']['resolution_y']." tall".
    " / Filesize: ".$file['filesize']." bytes<br />");

    // Calling getimagesize() function 
    $filename="uploads/25PercentOff_960.jpg";
    list($width, $height) = getimagesize($filename); 

    // Displaying dimensions of the image 
    echo "Width of image : " . $width . "<br>"; 

    echo "Height of image : " . $height . "<br>"; 
codernoob8

in this situation use $file['playtime_seconds'] it will give you the seconds directly with a decimal point. Which you can format using php's round() or floor() functions depending on how you want it to display.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get video duration in seconds?

From Dev

How to use getid3 if installed with apt-get install getid3?

From Dev

Get duration of video with AVFoundation

From Dev

Get the accurate duration of a video

From Dev

Javascript: get video duration

From Dev

Get number of seconds in specific duration

From Dev

Converting Youtube Data API V3 video duration format to seconds in Python3

From Dev

Converting Youtube Data API V3 video duration format to seconds in Dart

From Java

How to get the duration of a video in Python?

From Dev

Php ffmpeg get video duration

From Javascript

Get video duration when input a video file

From Dev

R: Formatting youtube video duration into proper time (seconds)

From Dev

Write 2 images into a video using OpenCV (Python) of 10 seconds duration

From Dev

Get Mp3 total duration in seconds (or millisecond) using Media Foundation

From Dev

How to get video thumbnail for starting duration in android?

From Java

How to get video/audio info such as Duration and with and height?

From Java

How to get current duration of video in exo player?

From Dev

Get duration of video file from command line?

From Dev

How to get duration of active storage video attachment?

From Dev

Get total duration of video files in a directory

From Dev

php-ffmpeg get video duration

From Dev

Trying to get full video duration but returning as Nan

From Dev

Get video duration with YouTube Data API?

From Dev

get video duration from URL in android app

From Dev

How to get the duration of video from MediaStore?

From Dev

how to get duration of multiple video while uploading?

From Dev

Get total duration of video files in a directory in hours

From Dev

How to get video from UIImagePickerController with maximum duration

From Dev

Get duration from multiple video files?

Related Related

  1. 1

    How to get video duration in seconds?

  2. 2

    How to use getid3 if installed with apt-get install getid3?

  3. 3

    Get duration of video with AVFoundation

  4. 4

    Get the accurate duration of a video

  5. 5

    Javascript: get video duration

  6. 6

    Get number of seconds in specific duration

  7. 7

    Converting Youtube Data API V3 video duration format to seconds in Python3

  8. 8

    Converting Youtube Data API V3 video duration format to seconds in Dart

  9. 9

    How to get the duration of a video in Python?

  10. 10

    Php ffmpeg get video duration

  11. 11

    Get video duration when input a video file

  12. 12

    R: Formatting youtube video duration into proper time (seconds)

  13. 13

    Write 2 images into a video using OpenCV (Python) of 10 seconds duration

  14. 14

    Get Mp3 total duration in seconds (or millisecond) using Media Foundation

  15. 15

    How to get video thumbnail for starting duration in android?

  16. 16

    How to get video/audio info such as Duration and with and height?

  17. 17

    How to get current duration of video in exo player?

  18. 18

    Get duration of video file from command line?

  19. 19

    How to get duration of active storage video attachment?

  20. 20

    Get total duration of video files in a directory

  21. 21

    php-ffmpeg get video duration

  22. 22

    Trying to get full video duration but returning as Nan

  23. 23

    Get video duration with YouTube Data API?

  24. 24

    get video duration from URL in android app

  25. 25

    How to get the duration of video from MediaStore?

  26. 26

    how to get duration of multiple video while uploading?

  27. 27

    Get total duration of video files in a directory in hours

  28. 28

    How to get video from UIImagePickerController with maximum duration

  29. 29

    Get duration from multiple video files?

HotTag

Archive