LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-04-2009, 01:56 AM   #1
Alt-Ox
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Rep: Reputation: 0
debian 5, apache2, ffmpeg and php


Hello,

I´ve ffmpeg installed and running fine on debian 5, but I need to run ffmpeg via PHP.

with phpinfo() I have:
Quote:
Variable Value
APACHE_PID_FILE /var/run/apache2.pid
APACHE_RUN_USER www-data
PATH /usr/local/bin:/usr/bin:/bin
PWD /usr/src/ffmpeg-0.5
APACHE_RUN_GROUP www-data
LANG C
SHLVL 1
_ /usr/sbin/apache2
on php.ini I´ve included
Quote:
extension=ffmpeg.so
But I´m still receiving the message:
Quote:
Unable to load dynamic library '/usr/lib/php5/modules/ffmpeg.so'- /usr/local/lib/libavcodec.so.52: undefined symbol: av_gcd
Can't load extension ffmpeg.so
The main code I`m using is
Quote:
$extension = "php_ffmpeg";
$extension_soname = 'ffmpeg.so';

if (!extension_loaded($extension)) {
dl($extension_soname) or die("Can't load extension $extension_soname\n");
}
Then I tried using just the command which works on the shell:
Quote:
<?php
exec("/usr/local/bin/ffmpeg -i test.avi -ab 56 -ar 22050 -s 320x240 test.flv");
?>
but nothing happens, no flv file is created on the current directory

does anyone have an idea on how configure ffmpeg with apache/php?
 
Old 08-04-2009, 07:38 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
It looks like you need to install ffmpeg-php. You can try to use the debian package first and if that doesn't work try to compile the sources. Everything is documented in the project's page.

Regards
 
Old 08-04-2009, 10:27 AM   #3
Alt-Ox
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Original Poster
Rep: Reputation: 0
I did install it
Also included the extension ffmpeg.so into php.ini

Last edited by Alt-Ox; 08-04-2009 at 10:29 AM.
 
Old 08-04-2009, 10:53 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Doing a little search, I guess (since ubuntu is debian based), that you have to follow the suggestion in this post and compile ffmpeg from the latest sources.
 
Old 08-04-2009, 11:14 AM   #5
Alt-Ox
LQ Newbie
 
Registered: Nov 2007
Posts: 20

Original Poster
Rep: Reputation: 0
thanks man
I had already tried this one, actually tried a lot of google's results.. but no success.

This is what I got on phpinfo()

Environment
Variable Value
APACHE_PID_FILE /var/run/apache2.pid
APACHE_RUN_USER www-data
PATH /usr/local/bin:/usr/bin:/bin
PWD /usr/src/ffmpeg-php-0.6.0
APACHE_RUN_GROUP www-data
LANG C
SHLVL 1
_ /usr/sbin/apache2

it seems ffmpeg-php is installed

Last edited by Alt-Ox; 08-04-2009 at 11:59 AM.
 
Old 08-04-2009, 04:33 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
It's not installed. If it was you should have:
Quote:
php -i|grep ffmpeg
ffmpeg
ffmpeg-php version => 0.6.0-svn
ffmpeg-php built on => Aug 5 2009 00:07:49
ffmpeg-php gd support => enabled
ffmpeg libavcodec version => Lavc52.32.0
ffmpeg libavformat version => Lavf52.37.0
ffmpeg swscaler version => SwS0.7.1
ffmpeg.allow_persistent => 0 => 0
ffmpeg.show_warnings => 0 => 0
This is because of the "undefined symbol" error.
I have just installed ffmpeg-php from source for testing:
1st: I had to get and compile the latest ffmpeg source from svn as per the ubuntu link, along with some missing dependencies (faac, faad2).
2nd: I downloaded ffmpeg-php-0.6.0, but I got a compile error. After searching I found that due to an error in ffmpeg_frame.c the following needs to be run before compiling:
Code:
sed -i 's/PIX_FMT_RGBA32/PIX_FMT_RGB32/g' ffmpeg_frame.c
You have to run the above from inside the ffmpeg-php source tree.
3rd. Add manually "extension=ffmpeg.so" and define "extension_dir = "/usr/local/lib/php/extensions/no-debug-zts-20090626" in php.ini (of course the extensions dir may vary in your case)
After restarting apache, I've tested your code and it worked.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me in installing ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encod mitesh.ever Red Hat 5 05-16-2009 12:14 PM
Does the latest version of ffmpeg not work with ffmpeg-php? whitey4900 Linux - Software 0 08-04-2008 05:16 PM
MySQL PHP Apache2 on Debian Stormrage Debian 2 07-16-2006 03:02 PM
whats up with apache2 and php on debian? scuzzo84 Debian 2 01-16-2006 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration