Video embed support

metroid48

Joined: 2006-12-30
Posts: 4
Posted: Mon, 2007-01-08 02:40

Hi,

I noticed that when Gallery plays back videos, it automatically gets the correct size for a video. What method does it use to do this, or does it store it in the database? In which case, how does it determine the size at the time of upload?

Thank you,
-Metroid48

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2007-01-08 02:47

Yes, the size of videos is detected and stored in the database.
if not detected automatically, users can change it manually in "edit movie" -> movie.

the detection is done with the ffmpeg module which calls the ffmpeg binary via php's exec() function.

--------------
Enter the Gallery 2 Theme Contest today!

 
metroid48

Joined: 2006-12-30
Posts: 4
Posted: Mon, 2007-01-08 03:38

Thanks, does this work on AVI and MPG, even MOV files? As it seems to work most of the time.

Anyway, I'm really new to php and am not sure how to utilise exec() on the ffmpeg executable to get the width/height of a video file.

Thanks!

EDIT: I used PuTTY, a SSH shell, and used this command:

Quote:
./ffmpeg -i /home/USERNAME/ADDRESS/FILENAME.mpg

And got a full response, width/height and all. And yes, I did use the actual username and filenames. However, I am unsure of how to parse the resulting array with PHP. Any suggestions?

 
metroid48

Joined: 2006-12-30
Posts: 4
Posted: Mon, 2007-01-08 04:26

If I just directly echo the output variable, I just get "Array". It seems that it is outputting an array, then, however I am unsure of how to access the array sections through PHP to get the width/height. Or anything, for that matter.