FFmpeg

Problems with the Windows version of XAMPP, questions, comments, and anything related.

FFmpeg

Postby jjhiggi » 11. June 2008 17:23

Does anyone know how to install FFmpeg in XAMPP? I was able to get the latest download of FFmpeg using the svn command on their site; however, I'm wondering how I get the dll built to drop in my php/ext folder?
jjhiggi
 
Posts: 9
Joined: 07. June 2008 22:39

Postby Milligan » 12. June 2008 03:08

Last edited by Milligan on 17. July 2008 04:56, edited 2 times in total.
Milligan
 
Posts: 136
Joined: 03. March 2008 06:23

Postby Wiedmann » 12. June 2008 04:28

Code: Select all
exec("START c:/xampp/apache/bin/ffmpeg/ffmpeg -vcodec png -i movie.avi -ss 00:00:00 -vframes frames picname%d.png");

This command will not work if you installed XAMPP in a directory with a space in the name for example C:\Program Files\xampp

Code: Select all
exec('START "" "C:/program files/xampp/apache/bin/ffmpeg/ffmpeg" -vcodec png -i movie.avi -ss 00:00:00 -vframes frames picname%d.png');


(BTW: should this not also work without the start command?)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby jjhiggi » 12. June 2008 05:15

Thank you for taking the time to help point me in the right direction. Your time and effort is much appreciated.
jjhiggi
 
Posts: 9
Joined: 07. June 2008 22:39

Postby jjhiggi » 12. June 2008 18:10

What happened to the Milligan post? I'm really confused. Did the administrator remove the post? I had bookmarked this page so that I could continue investigating how to install FFmpeg to XAMPP.

Why did they take the post down?
jjhiggi
 
Posts: 9
Joined: 07. June 2008 22:39

Postby Web-Man » 23. June 2008 11:44

It's possible to install ffmpeg?
Web-Man
 
Posts: 2
Joined: 23. June 2008 11:37

Postby jjhiggi » 23. June 2008 15:16

I kind of pieced together something that works.

I installed the ffmpeg binary directly to my xampp folder. However, on a secure server, you would probably not want it to be executing commands in this location.

I think I downloaded my exe from here...
http://arrozcru.no-ip.org/ffmpeg_builds/

Wherever you download ffmpeg from, the method below needs the ffmpeg.exe to point to.

Then in my PHP, I can call it like this...
exec(c:/xampp/ffmpeg/bin/ffmpeg.exe -i /xampp/htdocs/video/1/originals/omp_movie_test_sm.mpg -ar 22050 -ab 64k -f flv -s 330x248 /xampp/htdocs/video/1/converted/2.flv);

Lastly, this was a huge help to me. The previous reply from Milligan was removed, but here is much of what she had replied to me...

[BELOW IS FROM MULLIGAN REPLY WHICH WAS REMOVED]
To compile source files into Windows binary executable files you need to be familiar with this process and it requires you to have a compiler program installed on your PC - most don't.

For FFmpeg Win32 compilation, perhaps use MSYS and MINGW - ./configure, make, - from http://mingw.org.


In XAMPP you will have more chance of Apache executing a binary file if it is contained in the \xampp\apache\bin directory.


However you can download a pre compiled Windows binary executable file from any of these links:
http://ffdshow.faireal.net/mirror/ffmpeg/
http://arrozcru.no-ip.org/ffmpeg_builds
http://ffdshow.faireal.net/mirror/ffmpeg/
http://www.paehl.com/open_source/?Convert_Tools:FFMPEG
http://oss.netfarm.it/mplayer-win32.php


Other useful links (remember that FFmpeg is primarily for Linux breeds and so some of the links provided in this post may only relate to the Linux OS):
http://arrozcru.no-ip.org/ffmpeg_wiki/t ... page=Links
http://www.videohelp.com/tools/ffmpeg
http://arrozcru.no-ip.org/ffmpeg_forum/


There is also a GUI for FFmpeg - download and info can be found here:
http://forum.videohelp.com/topic343287.html


Here is a Google for ffmpeg php extension dll
http://www.google.com/search?q=ffmpeg+php+extension+dll




Unpack the pre-compiled Windows binary ffmpeg.exe file into a directory called ffmpeg in your apache\bin directory.
\xampp\apache\bin\ffmpeg

Then configure your scripts - in Gallery2 for example - to know where the ffmpeg.exe file resides.

If writing your own PHP script, you will need to learn all about the exec() command, and any possible security issues, coupled with the commands for FFmpeg.
http://www.php.net/function.exec
http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html

Using the apache\bin directory to exec() a binary file should eliminate any major security issues relating to your home server - executing a file outside this bin directory would no doubt be a security risk as this would mean that your server could execute any .exe file on your system with possible disastrous consequences.


An example bit of PHP code, which by the way may well be wrong in relation to the way PHP is implemented in XAMPP and has been amended by the mod in your thread, can be found here
http://www.phpbuilder.com/board/showthr ... t=10327812:
Code:

<?php
// movie.avi.... name of the movie you want to take a screenshot from
// 00:00:00.... Where in the movie do you wanna take your screenshot, 10 seconds from start? ex: 00:00:10
// picname..... name your generated pic
exec("START c:/xampp/apache/bin/ffmpeg/ffmpeg -vcodec png -i movie.avi -ss 00:00:00 -vframes frames picname%d.png");
?>


This command will not work if you installed XAMPP in a directory with a space in the name for example C:\Program Files\xampp

Always install XAMPP in the root of a drive - C:\xampp for example - and this problem will not exist now and in the future and Vista users should pay particular attention to this fact.
jjhiggi
 
Posts: 9
Joined: 07. June 2008 22:39


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 145 guests