How to display the duration of a bd video with the getid3 extension?

Asked

Viewed 110 times

0

<?php
 Include ("getid3/getid3.php");

 $filename="nome_do_video.mp4";
 $getID3 = new getID3;
 $file = $getID3->analize($filename);
 echo $file['playtime_string'];

 ?>

It’s just that when I try to pull from the database I can’t, for example the video path that’s saved in the comic book is like this "videos/files/nomedovideo.mp4".

How could I display the way in the $filename="nome_do_vídeo.mp4";

Could someone help me?

  • Welcome Gabriel, please format the code because it’s a little hard to read.

  • Ready now you can understand.

  • "videos/files/nomedovideo.mp4" is the relative path, tell me which is the absolute path to the videos folder?

  • When I upload the video it is saved in the videos/files/ folder and saved in the database the video path which is videos/files/filename video.mp4 I wanted the script to recognize ce if the video path of the database because if I specify manually the video path it works ex: $filename = "videos/files/filename.mp4"; how could I make the script recognize the video path?

  • So the problem is that if the script is in a different folder than the level relative to the "video" folder. This is why when running a script it is best to use the absolute path instead of the relative path. Tell you what, how you’re getting the data from the bank?

  • <?php Include ("getid3/getid3.php"); $getID3 = new getID3; $file = $getID3->parse($videosrc); echo $file['playtime_string']; ? > being $videosrc is the path value of the exe database. $videosrc = Row ['file_location']; so that of the error in the path check

  • Gabriel row ['file_location'] is wrong the right is $row ['file_location']

  • But still I could not get the script to display the duration of the comic video

  • if you do so echo ':', $row ['file_location'], ':'; what is displayed on the screen?

  • even from the error in the most file verifcaçao what I will do in ffmpeg ai I get the duration of the video in the upload and saved in bd ai then I only give an echo in the variable more still thanks for the help.

  • But what the echo show on screen? it shows exactly what is in the bank?

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.