OK, the new (updated and hopefully stable) distribution of files is located at the bottom of this post.
File system structure for XAMPP for Windows (you will need to download ffmpeg.exe from the FFMPEG site, as instructed earlier in this thread):
C:\xampp\htdocs\VideoToMp3Converiter\logs
C:\xampp\htdocs\VideoToMp3Converiter\mp3
C:\xampp\htdocs\VideoToMp3Converter\videos
C:\xampp\htdocs\VideoToMp3Converter\config.class.php
C:\xampp\htdocs\VideoToMp3Converter\exec_ffmpeg.php
C:\xampp\htdocs\VideoToMp3Converter\ffmpeg.exe
C:\xampp\htdocs\VideoToMp3Converter\ffmpeg_progress.php
C:\xampp\htdocs\VideoToMp3Converter\index.php
C:\xampp\htdocs\VideoToMp3Converter\YouTubeToMp3Converter.class.php
File system structure for Apache on Ubuntu 11.10 (Linux):
/home/user/public_html/youtube/logs
/home/user/public_html/youtube/mp3
/home/user/public_html/youtube/videos
/home/user/public_html/youtube/config.class.php
/home/user/public_html/youtube/exec_ffmpeg.php
/home/user/public_html/youtube/ffmpeg_progress.php
/home/user/public_html/youtube/index.php
/home/user/public_html/youtube/YouTubeToMp3Converter.class.php
In Config class in config.class.php, set _FFMPEG constant to:
1) For XAMPP for Windows:
PHP Code:
const _FFMPEG = 'ffmpeg.exe';
2) For Ubuntu (Linux):
PHP Code:
const _FFMPEG = '/usr/bin/ffmpeg';
(Note to Linux users: If the above is not the correct path to FFMPEG, you can type "whereis ffmpeg" into a command line for the correct path on your system.)
For Ubuntu (Linux) users, I will try to explain the additional steps required to configure this application.
Warning: I am not a Linux expert nor am I a command line expert! Also, I installed the application on a full, desktop version of Ubuntu on my development machine. Thus, the burden falls on you to adapt these instructions for a commercially hosted VPS (that may only provide a command line interface):
1) Move the web root to /home/user/public_html/ from /var/www/ if you haven't already (if it's not already done for you) by following directions here (scroll to the "Changing the default localhost folder" subhead):
http://maketecheasier.com/install-an...ntu/2011/03/09. (Doing this helped me solve all kinds of file permissions headaches when not operating as the 'root' user.)
2) A history of the packages I installed:
Installed the following packages:
apache2 (2.2.20-1ubuntu1.1)
apache2-mpm-worker (2.2.20-1ubuntu1.1)
apache2-utils (2.2.20-1ubuntu1.1)
apache2.2-bin (2.2.20-1ubuntu1.1)
apache2.2-common (2.2.20-1ubuntu1.1)
libapr1 (1.4.5-1)
libaprutil1 (1.3.12+dfsg-2)
libaprutil1-dbd-sqlite3 (1.3.12+dfsg-2)
libaprutil1-ldap (1.3.12+dfsg-2)
Removed the following packages:
apache2-mpm-worker
Installed the following packages:
apache2-mpm-itk (2.2.20-1ubuntu1.1)
libapache2-mod-php5filter (5.3.6-13ubuntu3.5)
php5 (5.3.6-13ubuntu3.5)
php5-cli (5.3.6-13ubuntu3.5)
php5-common (5.3.6-13ubuntu3.5)
Installed the following packages:
curl (7.21.6-3ubuntu3.2)
libcurl3 (7.21.6-3ubuntu3.2)
Installed the following packages:
ffmpeg (4:0.7.3-0ubuntu0.11.10.1)
libavcodec53 (4:0.7.3-0ubuntu0.11.10.1)
libavdevice53 (4:0.7.3-0ubuntu0.11.10.1)
libavfilter2 (4:0.7.3-0ubuntu0.11.10.1)
libavformat53 (4:0.7.3-0ubuntu0.11.10.1)
libavutil51 (4:0.7.3-0ubuntu0.11.10.1)
libdc1394-22 (2.1.3-4)
libgsm1 (1.0.13-3)
libpostproc52 (4:0.7.3-0ubuntu0.11.10.1)
libschroedinger-1.0-0 (1.0.10-2.1)
libswscale2 (4:0.7.3-0ubuntu0.11.10.1)
libva1 (1.0.12-2)
libvpx0 (0.9.6-1)
Installed the following packages:
php5-curl (5.3.6-13ubuntu3.5)
Installed the following packages:
php5-ffmpeg (0.6.0-2ubuntu2)
php5-gd (5.3.6-13ubuntu3.5)
Installed the following packages:
libmp3lame0 (3.98.4-0ubuntu1)
Removed the following packages:
libavcodec53
libavutil51
Installed the following packages:
libavcodec-extra-53 (4:0.7.3ubuntu0.11.10.1)
libavutil-extra-51 (4:0.7.3ubuntu0.11.10.1)
libdirac-encoder0 (1.0.2-4)
libopenjpeg2 (1.3+dfsg-4)
libvo-aacenc0 (0.1.1-1)
libvo-amrwbenc0 (0.1.1-1)
libx264-116 (2:0.116.2042+git178455c-1ubuntu1)
libxvidcore4 (2:1.3.2-3)
3) You may need to restart Apache after all packages have been installed (or in between installations?) via the command line:
$sudo service apache2 stop
$sudo service apache2 start
4) Make sure the following lines appear in your php.ini:
extension=curl.so
extension=ffmpeg.so
5) Set write permissions on the following directories: chmod 777 mp3, chmod 777 videos, chmod 777 logs
Finally,
zemaitis, or anyone else familiar with the Linux command line interface, it would be great if you could adapt all of this for the command line and publish the result here! It would certainly help me and any others using this script on commercially hosted servers.
As always, please let me know if you have any questions/concerns regarding the above and/or the code.
See the new zip file below:
Quote:
. . . !! ALERT !!- Windows and XAMPP users, you MUST read this post first (before installing/configuring my app)! The latest static builds of ffmpeg.exe will not work with my code!
- Please download the older build of ffmpeg.exe required for my app HERE.
- (Because the file is over 4 MB and this forum doesn't allow large file attachments, the file is being hosted at PutLocker.com instead.)
- This does NOT affect Linux users.
|