2

I have a bit of a problem with ffmpeg-php. I'm trying to get some information from video files and it works pretty fine with file formats like .avi, .mpg or .flv but when I try to use .3gp or .mp4 in:

$movie = new ffmpeg_movie('path/to/file/test.3gp');

I get error like this :

ffmpeg_movie::__construct() []: ISO: File Type Major Brand: 3gp5 

or

ffmpeg_movie::__construct() []: ISO: File Type Major Brand: mp42 

I installed ffmpeg-php on WAMP using instructions found here: How to install FFMpeg in WampServer 2.0 (Windows XP)

I need those information to send them to ffmpeg using exec(). Anyone could help me with this?

Community
  • 1
  • 1
Neltharian
  • 115
  • 1
  • 8
  • Um... Are you sure these are errors and not the regular output of the program? Is nothing else output? – Pekka May 12 '10 at 07:30
  • Yup. Kohana crashes and shows those two errors when I try to use 3.gp or .mp4. In any other case everything works fine. On ffmpeg-php website I've seen that maybe it happens so because ffmpeg have to be complied with zlib library. But if that is the case then I don't know how to do it :( – Neltharian May 12 '10 at 12:06

2 Answers2

1

You could also use a pure php approach using PHP media reader

Jon Skarpeteig
  • 4,118
  • 7
  • 34
  • 53
0

While installing ffmpeg plugin on server, Mostly we will be having "ffprobe" library with it. By using ffprobe, we can get details/metadata about videos.

$ffprobe_path="ffprobe"; //path to installation of ffprobe
$video_file="/home/testsite/public_html/videos/mytest_video.mp4"; //path to the specific video file

$ffprobe_cmd=$ffprobe_path." -v quiet -print_format json -show_format -show_streams ".$video_file;  
$outputprobe = shell_exec($ffprobe_cmd);  
$result_video_meta = json_decode($outputprobe);
echo "<pre>";
print_r($result_video_meta);
echo "</pre>";
Muthu kumar
  • 162
  • 1
  • 2
  • 12