I would like to know if you or someone from here knows the answer to the following.
I compiled from source ffmpeg with all the necessary codecs, uploaded and reconfigured your script. I chmod 777 to ffmpeg bin and chown www-data to ffmpeg.
When executing command manually from bin folder I successfully encode flv to mp3 using lame but your script fails to access bin file.
So I made a php script
exec('~/bin/ffmpeg -i "/var/www/test/youtube/videos/1376995108_52134724adcbf4.88584827.flv" -acodec libmp3lame -ac 2 -ab 128 -vn -y "/var/www/test/youtube/videos//filename3.mp3"');
and placed it into youtube test folder... when accessing via browser it doesn't work but if I try using terminal "php test.php" it initiates and finishes conversion successfully.
-rwxrwxr-x 1 www-data www-data 15511760 Aug 20 11:45 ffmpeg
and path is correct, otherwise conversion wouldn't worked over php test.php
Can someone explain me why lighttpd (web server) gets
sh: 1: /root/bin/ffmpeg: Permission denied
when accessing ffmpeg?
Solution was to move ffmpeg bin to same folder as script but I want to know why it doesn't work with /root/bin/ffmpeg bin and how to make script work with /root/bin/ffmpeg bin.
Tutorial to install ffmpeg with lame mp3 support on Ubuntu from terminal (SSH)
I already have webserver installed along with mysql and php.
If you don't know how to install and configure web server giyf, type lamp ubuntu (if you are using ubuntu) and follow the first tutorial that makes sense...
I use lighttpd instead of apache so some of my paths my be different, consult if you get stuck somewhere with phpinfo();
apt-get install php5-ffmpeg
add extension=ffmpeg.so in php.ini by typing
use ctrl+insert or right click to insert text into editor
I installed few lame libraries, I usually tend to install all that has to do with extension or product when installing first time so I don't have to bother in future, I removed those I know that are not necessary but I might leave some that are not needed, few mb more or less...
apt-get install libmp3lame0
apt-get install libmp3lame-dev
apt-get install libavcodec-extra-52
apt-get install subversion
How to compile ffmpeg with lame mp3 encoder?
If you get stuck with error about asm install it by
apt-get install nasm
you can test from terminal if you successfully installed ffmpeg with lame by issuing following command
~/bin/ffmpeg -i path_to_flv_file/filename.flv -acodec libmp3lame -ac 2 -ab 128 -vn -y path_to_output_dir/filename3.mp3
After you have successfully compiled ffmpeg with lame support do following
chown -R www-data:www-data ~/bin/
chmod 755 ~/bin/ffmpeg
and change const _FFMPEG = '/root/bin/ffmpeg'; in config.class.php file of your script
I tried even with 777 but didn't work until I moved file to my server document root folder (/var/www/)
so do following
cp ~/bin/ffmpeg /var/www/path_to_script_folder/
and change const _FFMPEG = '/var/www/path_to_script_folder/ffmpeg'; in config.class.php file of your script
it should work flawlessly now... if you stuck somewhere in process send me a pm or email I will be glad to help