Search code examples
phplinuxffmpegtranscodingffprobe

FFMPEG retrieve time duration not working for MOV files


So I am in php running an ffprobe command on files and grabbing the output (to get duration, time, etc)

exec("usr/bin/ffprobe -v quiet-print_format json -show_format -show_streams $location", $output, $exitCode); 

Where $location is the files location + filename. Now this command works 100% perfectly for .mp4 / .avi / everything else I have tried. Except .mov, when using .mov my "output" variable is empty. Is there any way to fix this / change this?


Solution

  • I finally fixed this issue by converting only audio out of the video file, this is extremely fast in ffmpeg and you can set quality very low and get the duration from that consistently. Even if there is no audio it will still grab an audio file the same length as the film. Takes less than a second and gives you reliable data.