LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 02-09-2010, 02:42 AM   #1
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Rep: Reputation: 0
ffmpeg in virtual machine


Hi!

I try for some weeks now to install ffmpeg in a CentOS 3.9 VM. The configuration is successful, but when I try to complete the test I receive the error:
/usr/local/apache-2.0.63/bin/httpd: relocation error: /usr/local/apache-2.0.63/php5/ffmpeg.so: undefined symbol: av_picture_copy

I searched a lot regading this error, but I couldn't find any solutions.
Does anybody have any ideas?

Thanx!
 
Old 02-09-2010, 03:54 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Hi and welcome to LQ

How did you install ffmpeg and ffmpeg-php? I've always used sources from svn for both programs, and never had such problems.
You can also try this guide and see if it helps

Regards
 
Old 02-09-2010, 04:07 AM   #3
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
Hello!
Thank you for the welcome wishes.

I installed the ffmpeg and the ffmpeg-php from sources, and the installation was successful.
I looked on the guide you suggested and is basically the same thing I did.

Same error:
/usr/local/apache-2.0.63/bin/httpd: relocation error: /usr/local/apache-2.0.63/php5/ffmpeg.so: undefined symbol: av_picture_copy

Last edited by corina.pelmus; 02-09-2010 at 04:11 AM.
 
Old 02-09-2010, 04:39 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
What versions of ffmpeg and ffmpeg-php have you used? av_picture_copy is defined in libavcodec, so I guess ffmpeg is not, let's say, compatible with ffmpeg-php.
You should get the latest sources from svn for both. For reference here are the options I've used to build ffmpeg:
Code:
./configure --enable-shared --enable-libvorbis --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab
Of course you might not need all these options (at least the 3-4 last ones).
Remember to run "make distclean" before running ./configure

Regards
 
Old 02-15-2010, 07:37 AM   #5
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
Hello!

Sorry for the delay.

I tried to configure ffmpeg as you pointed, but the last 5 options are rejected, and the make command shows the following error:

"# make
make: *** No rule to make target 'libadevice/libadevice.so' , needed by 'all'. Stop. "

I must mention again that i'm trying to install it on a Centos 3.9 machine.

Regards,
Corina

Last edited by corina.pelmus; 02-15-2010 at 07:38 AM.
 
Old 02-15-2010, 08:37 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Hi,

The only important option if you want to build ffmpeg-php, is "--enable-shared". The others depend on the specific file formats you're going to deal with.
Anyway you should use the latest sources from svn for both programs. There is also a howto for Centos here.

Regards
 
Old 02-16-2010, 02:12 AM   #7
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
Hi,

After recompiling, the 'make test' command output is:

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
ffmpeg getBitRate test [tests/getBitRate.phpt]
ffmpeg getDuration test [tests/getDuration.phpt]
ffmpeg getFrame test [tests/getFrame.phpt]
ffmpeg getFrameCount test [tests/getFrameCount.phpt]
ffmpeg getFrameNumber test [tests/getFrameNumber.phpt]
ffmpeg getFrame backwards test [tests/getFramesBackwards.phpt]
ffmpeg getFrames forward test [tests/getFramesForward.phpt]
ffmpeg getFrames forward test [tests/getFramesForwardPassedEnd.phpt]
ffmpeg getFramesNoArg test [tests/getFramesNoArg.phpt]
ffmpeg getID3Info() test [tests/getID3Info.phpt]
ffmpeg get key frames test [tests/getNextKeyFrame.phpt]
ffmpeg getPTS test (Fixme: This test is no good with robot.avi) [tests/getPTS.phpt]
ffmpeg test key frame [tests/isKeyFrame.phpt]
ffmpeg persistent movie test [tests/persistentMovie.phpt]
=====================================================================


I believe that I need some more libraries, but I can't figure out which one.

regards
 
Old 02-16-2010, 02:30 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
I doesn't matter since it compiles successfully.
Run "make install" to install it and add the extension into php.ini. Then restart apache and test.
 
Old 02-16-2010, 02:42 AM   #9
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
Ok, I made it work. It shows me the ffmpeg as a loaded function in php.

But the test still fails.

Last edited by corina.pelmus; 02-16-2010 at 02:48 AM.
 
Old 02-16-2010, 03:09 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
If you want to test the installation, follow the instructions on ffmpeg-php site:
Quote:
Testing the Installation

* Put the directory test_media and test_ffmpeg.php script under your web root somewhere (put both in the same directory).
* Load test_ffmpeg.php into your browser.

RESULTS: You should get a listing of the methods provided by the ffmpeg-php module as well as some test output from the methods.
Mind that you might need to change "<?" to "<?php" in the 1st line of test_ffmpeg.php
 
Old 02-16-2010, 03:14 AM   #11
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
I already did that before:

The output is:
Quote:
'; } printf("ffmpeg-php version string: %s\n", FFMPEG_PHP_VERSION_STRING); printf("ffmpeg-php build date string: %s\n", FFMPEG_PHP_BUILD_DATE_STRING); printf("libavcodec build number: %d\n", LIBAVCODEC_BUILD_NUMBER); printf("libavcodec version number: %d\n", LIBAVCODEC_VERSION_NUMBER); print_class_methods("ffmpeg_movie"); print_class_methods("ffmpeg_frame"); // get an array for movies from the test media directory $movies = getDirFiles(dirname(__FILE__) . '/tests/test_media'); echo "--------------------\n\n"; foreach($movies as $movie) { $mov = new ffmpeg_movie($movie); printf("file name = %s\n", $mov->getFileName()); printf("duration = %s seconds\n", $mov->getDuration()); printf("frame count = %s\n", $mov->getFrameCount()); printf("frame rate = %0.3f fps\n", $mov->getFrameRate()); printf("comment = %s\n", $mov->getComment()); printf("title = %s\n", $mov->getTitle()); printf("author = %s\n", $mov->getAuthor()); printf("copyright = %s\n", $mov->getCopyright()); printf("get bit rate = %d\n", $mov->getBitRate()); printf("has audio = %s\n", $mov->hasAudio() == 0 ? 'No' : 'Yes'); if ($mov->hasAudio()) { printf("get audio stream id= %s\n", $mov->getAudioStreamId()); printf("get audio codec = %s\n", $mov->getAudioCodec()); printf("get audio bit rate = %d\n", $mov->getAudioBitRate()); printf("get audio sample rate = %d \n", $mov->getAudioSampleRate()); printf("get audio channels = %s\n", $mov->getAudioChannels()); } printf("has video = %s\n", $mov->hasVideo() == 0 ? 'No' : 'Yes'); if ($mov->hasVideo()) { printf("frame height = %d pixels\n", $mov->getFrameHeight()); printf("frame width = %d pixels\n", $mov->getFrameWidth()); printf("get video stream id= %s\n", $mov->getVideoStreamId()); printf("get video codec = %s\n", $mov->getVideoCodec()); printf("get video bit rate = %d\n", $mov->getVideoBitRate()); printf("get pixel format = %s\n", $mov->getPixelFormat()); printf("get pixel aspect ratio = %s\n", $mov->getPixelAspectRatio()); $frame = $mov->getFrame(10); printf("get frame = %s\n", is_object($frame) ? 'true' : 'false'); printf(" get frame number = %d\n", $mov->getFrameNumber()); printf(" get frame width = %d\n", $frame->getWidth()); printf(" get frame height = %d\n", $frame->getHeight()); } echo "\n--------------------\n\n"; } if (php_sapi_name() != 'cli') { echo ''; } /* FUNCTIONS */ function print_class_methods($class) { echo "\nMethods available in class '$class':\n"; $methods = get_class_methods($class); if (is_array($methods)) { foreach($methods as $method) { echo $method . "\n"; } } else { echo "No Methods Defined\n"; } } function getDirFiles($dirPath) { if ($handle = opendir($dirPath)) { while (false !== ($file = readdir($handle))) { $fullpath = $dirPath . '/' . $file; if (!is_dir($fullpath) && $file != "CVS" && $file != "." && $file != "..") $filesArr[] = trim($fullpath); } closedir($handle); } return $filesArr; } ?>

Sorry, missed the php adding thing.

Last edited by corina.pelmus; 02-16-2010 at 03:17 AM.
 
Old 02-16-2010, 03:14 AM   #12
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
It works, and the output is the mentioned one.

Thank you!

But how can I test to see that a video works well for example?


When I load the run-tests.php in the browser I get:

Quote:
ERROR: environment variable TEST_PHP_EXECUTABLE must be set to specify PHP executable!

Last edited by corina.pelmus; 02-16-2010 at 03:25 AM.
 
Old 02-16-2010, 04:20 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,174
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
When I load the run-tests.php in the browser I get:

Quote:
ERROR: environment variable TEST_PHP_EXECUTABLE must be set to specify PHP executable!
Don't bother with that. run-tests.php is used by "make test". If ffmpeg extension is loaded, then you're ok.
 
Old 02-16-2010, 05:26 AM   #14
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
Ok, I understand.

Thank you very much!

Kind regards,
Corina
 
Old 02-16-2010, 05:48 AM   #15
corina.pelmus
LQ Newbie
 
Registered: Feb 2010
Location: Romania
Posts: 13

Original Poster
Rep: Reputation: 0
Hi again!

I tried to make a test using ffmpeg and the output is:

Quote:
[@ffmpeg-test html]$ ffmpeg -i "input.avi" -ar 22050 -ab 32 -f flv -s 320X240 "output.flv"
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2006 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --disable-static --disable-strip --enable-a52 --enable-a52bin --enable-faac --enable-faad --enable-libgsm --enable-mp3lame --enable-libogg --enable-vorbis --enable-x264 --enable-xvid --enable-gpl --enable-pp --enable-pthreads --enable-shared --enable-swscaler
libavutil version: 49.1.0
libavcodec version: 51.28.0
libavformat version: 51.7.0
built on Jul 9 2009 04:10:48, gcc: 3.2.3 20030502 (Red Hat Linux 3.2.3-59)
Input #0, mpeg, from 'input.avi':
Duration: 00:00:00.3, start: 0.177778, bitrate: 4905 kb/s
Stream #0.0[0x1c0]: Audio: mp2, 32000 Hz, mono, 32 kb/s
Stream #0.1[0x1e0]: Video: mpeg1video, yuv420p, 160x112, 104857 kb/s, 25.00 fps(r)
Output #0, flv, to 'output.flv':
Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 25.00 fps(c)
Stream #0.1: Audio: mp3, 22050 Hz, mono, 32 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. Do not report crashes to FFmpeg developers.
frame= 244 q=6.6 Lsize= 496kB time=9.8 bitrate= 416.5kbits/s
video:448kB audio:38kB global headers:0kB muxing overhead 2.043570%

What might be wrong regrding the compilation?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file sharing between a virtual machine and the host machine okok Linux - Networking 3 06-21-2013 12:42 AM
ffmpeg: make: virtual memory exhausted simopal6 Linux - Software 15 05-30-2011 03:31 PM
unable to auto mount 'shared folder' iin Suse 11.2 virtual machine using Virtual Box marvinudy Linux - Virtualization and Cloud 1 02-03-2010 02:29 PM
How to configure the serial port of my virtual machine with host machine. akram Linux - Newbie 4 07-31-2009 10:39 PM
Running virtual pc files in a virtual machine in linux ... preferably virtual box biharibong Linux - Software 4 01-21-2009 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 06:52 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