i would like to use PHP and FFMPEG to get the DURATION of the VIDEO so i can save into the Database.. I found some examples but could not get to work
my path to my FFMPEG is
*/usr/local/bin/ffmpeg*
here is the example of of snippet but it looks to be local for the ffmpeg??
so much help appreciated if you can fix the php code and fix the proper path i provided above to grab the DURATION in a php file.. thanks for any help to get this properly working as i do not want to have to use ffmpeg-php
bc.. if (isset($_GET['percent'])) { $percent = $_GET['percent'];
when i convert any media file into flv through ffmpeg. orignal file have metadata but the converted flv file have not complete metadata which some information lost. such as duration.which i need. for copy metadata input file to output file this command is used (-map_meta_data output file:input file) but this parameter does not work. which always movie file duration show 00:00:00. please help me. thanks
in which movie file duration show different from the orignal file duration which is showing by any player. please help me why this code show wrong different file duration. i have experienced with multiple file. please help thanks Rana muhammad Saleem
when i convert any media file into flv through ffmpeg. orignal file have metadata but the converted flv file have not complete metadata which some information lost. such as duration.which i need. for copy metadata input file to output file this command is used (-map_meta_data output file:input file) but this parameter does not work. which always movie file duration show 00:00:00. please help me. thanks
now what ever video format ffmpeg supports, on file selection the player file will then interogate the file for duration then parse this out the the jw player under $duration_in_seconds string
I am new to PHP. I use xampp and Window XP. I want to know how to convert video files to flv file type using ffmpeg. I find this information everywhere. But I can not find. Now here I find. Your informations are so cool. So can you guide me how to convert movies to flv file type using ffmpeg on XAMPP.
Just in case anyone was wondering .. you can also get the video width and height if you wanted to set the video to its original width and height or work out if its widescreen so you can set the video settings to show widescreen. (I am new to PHP by the way)
This seems to work fine for me. This script is most useful when you can call it with the filename of a video file and it returns the duration. bc.. <?php
If you have full access to bash app you could use the following script: $ /usr/bin/ffmpeg -i /path/to/file.flv 2>&1 |grep Duration |awk '{print $2}' |awk -F: '{print ($1 * 3600) + ($2 * 60 ) + $3}'
This command will return the time in seconds with milli precision. If you like, you could replace the math formula and do what you want (eg return the time expressed in hh:mm:ss)
Note that you also get an "average" bit rate as well as a "real" frame rate (along with all sorts of neat stuff) but that it needs to be computed. In this case the real frame rate (r_frame_rate) comes out to 29.97 fps.
The "pretty" options formats the numbers in a way that makes sense; the "-v quiet" drops the debug info that you've been using with ffmpeg -i. There are other "print_formats" available.