Go Back   CodingForums.com > :: Server side development > PHP > Post a PHP snippet

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-24-2012, 09:44 AM   PM User | #556
slaine
New Coder

 
Join Date: Nov 2012
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
slaine is an unknown quantity at this point
Quote:
Originally Posted by chump2877 View Post

Note: When installing my software, I recommend that you 'apt-get install' to get the stable versions of each package. I advise against building each (or any) of the packages from the git source.
sure i´ll get the Ubuntu 11.10 and try, and yes i use the terminal to install using "sudo apt-get install whatever i need'" via SSH. I let u know how it work out.
slaine is offline   Reply With Quote
Old 11-26-2012, 02:14 AM   PM User | #557
mujtabak
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mujtabak is an unknown quantity at this point
I've installed it on my site mp3roach.com/dl it is converting videos as i saw in FTP folders but its not displaying download link after conversion please help.
mujtabak is offline   Reply With Quote
Old 11-26-2012, 06:22 AM   PM User | #558
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by mujtabak View Post
I've installed it on my site mp3roach.com/dl it is converting videos as i saw in FTP folders but its not displaying download link after conversion please help.
Hi,

After visiting your page, please check the following:

1) Are permissions set correctly on the 'logs', 'output', 'videos', and 'ringtones' folders? (Verify that the correct server user owns these folders as well -- see chown command.)

2) Are videos being saved to the 'videos' folder? Full videos or only partial videos?

3) I never see a download progress bar, but I do see the download progress bar code in your page. If the videos are actually being saved in the 'videos' folder, then do you have a really fast download speed from Youtube? That would explain why it skips past the download progress bar to the conversion progress bar.

4) The AJAX response text that corresponds to the conversion progress bar is generating an error code. Please see this post for how to troubleshoot that.

5) Are any FFmpeg log files created in the 'logs' directory for failed conversions? If so, please paste the output of a log file for a given failed conversion.

6) Please take advantage of the search feature for this forum thread. I have answered questions like this countless times before and provided clues for how to troubleshoot similar issues.

So give those things a try, and then we'll go from there...
__________________
Regards, R.J.

---------------------------------------------------------

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)

Last edited by chump2877; 11-26-2012 at 06:26 AM..
chump2877 is offline   Reply With Quote
Old 11-27-2012, 12:41 PM   PM User | #559
mujtabak
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mujtabak is an unknown quantity at this point
I've tried everything on this forum too but no result. Its not failing any where its just not displaying download link. Videos are converting.

Go to mp3roach.com/dl convert any video then go to mp3roach.com/dl/videos or /output you will find videos are converting and downloading on server but it doesn't display link so that user can download. Thanks



PHP Code:
FFmpeg version SVN-r10635Copyright (c2000-2007 Fabrice Bellardet al.
  
configuration: --enable-gpl --enable-liba52 --enable-libgsm --enable-libxvid --enable-libamr_nb --enable-libamr_wb --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libfaac --enable-shared --prefix=/usr --enable-libfaad --libdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg
  libavutil version
49.5.0
  libavcodec version
51.44.0
  libavformat version
51.14.0
  built on Oct  1 2007 15
:21:19gcc3.4.6 20060404 (Red Hat 3.4.6-8)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videos/1354018061_50b4ad0d6f5806.44504070.flv':
  
Duration00:07:45.1start0.000000bitrate482 kb/s
  Stream 
#0.0(und): Audio: mpeg4aac, 44100 Hz, stereo
  
Stream #0.1(und): Video: h264, yuv420p, 480x360, 30.00 fps(r)
Output #0, mp3, to 'output/Autechre_-_Puch_uuid-50b4ad17b34c3.mp3':
  
Stream #0.0(und): Audio: libmp3lame, 44100 Hz, stereo, 128 kb/s
Stream mapping:
  
Stream #0.0 -> #0.0
Press [qto stop encoding
size
=     130kB time=8.3 bitrate128.0kbits/s    
size
=     264kB time=16.9 bitrate128.0kbits/s    
size
=     397kB time=25.4 bitrate128.0kbits/s    
size
=     533kB time=34.1 bitrate128.0kbits/s    
size
=     674kB time=43.1 bitrate128.0kbits/s    
size
=     811kB time=51.9 bitrate128.0kbits/s    
size
=     956kB time=61.2 bitrate128.0kbits/s    
size
=    1104kB time=70.7 bitrate128.0kbits/s    
size
=    1253kB time=80.2 bitrate128.0kbits/s    
size
=    1391kB time=89.0 bitrate128.0kbits/s    
size
=    1534kB time=98.2 bitrate128.0kbits/s    
size
=    1653kB time=105.8 bitrate128.0kbits/s    
size
=    1795kB time=114.9 bitrate128.0kbits/s    
size
=    1929kB time=123.5 bitrate128.0kbits/s    
size
=    2048kB time=131.1 bitrate128.0kbits/s    
size
=    2172kB time=139.0 bitrate128.0kbits/s    
size
=    2300kB time=147.2 bitrate128.0kbits/s    
size
=    2439kB time=156.1 bitrate128.0kbits/s    
size
=    2579kB time=165.0 bitrate128.0kbits/s    
size
=    2720kB time=174.1 bitrate128.0kbits/s    
size
=    2861kB time=183.1 bitrate128.0kbits/s    
size
=    3000kB time=192.0 bitrate128.0kbits/s    
size
=    3138kB time=200.8 bitrate128.0kbits/s    
size
=    3247kB time=207.8 bitrate128.0kbits/s    
size
=    3384kB time=216.6 bitrate128.0kbits/s    
size
=    3526kB time=225.6 bitrate128.0kbits/s    
size
=    3670kB time=234.9 bitrate128.0kbits/s    
size
=    3808kB time=243.7 bitrate128.0kbits/s    
size
=    3946kB time=252.6 bitrate128.0kbits/s    
size
=    4082kB time=261.3 bitrate128.0kbits/s    
size
=    4211kB time=269.5 bitrate128.0kbits/s    
size
=    4349kB time=278.3 bitrate128.0kbits/s    
size
=    4482kB time=286.9 bitrate128.0kbits/s    
size
=    4626kB time=296.1 bitrate128.0kbits/s    
size
=    4774kB time=305.5 bitrate128.0kbits/s    
size
=    4914kB time=314.5 bitrate128.0kbits/s    
size
=    5056kB time=323.6 bitrate128.0kbits/s    
size
=    5197kB time=332.6 bitrate128.0kbits/s    
size
=    5336kB time=341.5 bitrate128.0kbits/s    
size
=    5478kB time=350.6 bitrate128.0kbits/s    
size
=    5619kB time=359.6 bitrate128.0kbits/s    
size
=    5763kB time=368.8 bitrate128.0kbits/s    
size
=    5904kB time=377.9 bitrate128.0kbits/s    
size
=    6050kB time=387.2 bitrate128.0kbits/s    
size
=    6182kB time=395.7 bitrate128.0kbits/s    
size
=    6305kB time=403.5 bitrate128.0kbits/s    
size
=    6438kB time=412.0 bitrate128.0kbits/s    
size
=    6587kB time=421.6 bitrate128.0kbits/s    
size
=    6734kB time=431.0 bitrate128.0kbits/s    
size
=    6870kB time=439.7 bitrate128.0kbits/s    
size
=    7009kB time=448.6 bitrate128.0kbits/s    
size
=    7140kB time=457.0 bitrate128.0kbits/s    
size
=    7268kB time=465.1 bitrate128.0kbits/s    
video
:0kB audio:7268kB global headers:0kB muxing overhead 0.000430
mujtabak is offline   Reply With Quote
Old 11-28-2012, 11:17 AM   PM User | #560
mujtabak
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mujtabak is an unknown quantity at this point
Bro im waiting. please help me out. Its not displaying download link
mujtabak is offline   Reply With Quote
Old 11-28-2012, 12:42 PM   PM User | #561
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by mujtabak View Post
I've tried everything on this forum too but no result. Its not failing any where its just not displaying download link. Videos are converting.

Go to mp3roach.com/dl convert any video then go to mp3roach.com/dl/videos or /output you will find videos are converting and downloading on server but it doesn't display link so that user can download. Thanks



PHP Code:
FFmpeg version SVN-r10635Copyright (c2000-2007 Fabrice Bellardet al.
  
configuration: --enable-gpl --enable-liba52 --enable-libgsm --enable-libxvid --enable-libamr_nb --enable-libamr_wb --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libfaac --enable-shared --prefix=/usr --enable-libfaad --libdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg
  libavutil version
49.5.0
  libavcodec version
51.44.0
  libavformat version
51.14.0
  built on Oct  1 2007 15
:21:19gcc3.4.6 20060404 (Red Hat 3.4.6-8)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videos/1354018061_50b4ad0d6f5806.44504070.flv':
  
Duration00:07:45.1start0.000000bitrate482 kb/s
  Stream 
#0.0(und): Audio: mpeg4aac, 44100 Hz, stereo
  
Stream #0.1(und): Video: h264, yuv420p, 480x360, 30.00 fps(r)
Output #0, mp3, to 'output/Autechre_-_Puch_uuid-50b4ad17b34c3.mp3':
  
Stream #0.0(und): Audio: libmp3lame, 44100 Hz, stereo, 128 kb/s
Stream mapping:
  
Stream #0.0 -> #0.0
Press [qto stop encoding
size
=     130kB time=8.3 bitrate128.0kbits/s    
size
=     264kB time=16.9 bitrate128.0kbits/s    
size
=     397kB time=25.4 bitrate128.0kbits/s    
size
=     533kB time=34.1 bitrate128.0kbits/s    
size
=     674kB time=43.1 bitrate128.0kbits/s    
size
=     811kB time=51.9 bitrate128.0kbits/s    
size
=     956kB time=61.2 bitrate128.0kbits/s    
size
=    1104kB time=70.7 bitrate128.0kbits/s    
size
=    1253kB time=80.2 bitrate128.0kbits/s    
size
=    1391kB time=89.0 bitrate128.0kbits/s    
size
=    1534kB time=98.2 bitrate128.0kbits/s    
size
=    1653kB time=105.8 bitrate128.0kbits/s    
size
=    1795kB time=114.9 bitrate128.0kbits/s    
size
=    1929kB time=123.5 bitrate128.0kbits/s    
size
=    2048kB time=131.1 bitrate128.0kbits/s    
size
=    2172kB time=139.0 bitrate128.0kbits/s    
size
=    2300kB time=147.2 bitrate128.0kbits/s    
size
=    2439kB time=156.1 bitrate128.0kbits/s    
size
=    2579kB time=165.0 bitrate128.0kbits/s    
size
=    2720kB time=174.1 bitrate128.0kbits/s    
size
=    2861kB time=183.1 bitrate128.0kbits/s    
size
=    3000kB time=192.0 bitrate128.0kbits/s    
size
=    3138kB time=200.8 bitrate128.0kbits/s    
size
=    3247kB time=207.8 bitrate128.0kbits/s    
size
=    3384kB time=216.6 bitrate128.0kbits/s    
size
=    3526kB time=225.6 bitrate128.0kbits/s    
size
=    3670kB time=234.9 bitrate128.0kbits/s    
size
=    3808kB time=243.7 bitrate128.0kbits/s    
size
=    3946kB time=252.6 bitrate128.0kbits/s    
size
=    4082kB time=261.3 bitrate128.0kbits/s    
size
=    4211kB time=269.5 bitrate128.0kbits/s    
size
=    4349kB time=278.3 bitrate128.0kbits/s    
size
=    4482kB time=286.9 bitrate128.0kbits/s    
size
=    4626kB time=296.1 bitrate128.0kbits/s    
size
=    4774kB time=305.5 bitrate128.0kbits/s    
size
=    4914kB time=314.5 bitrate128.0kbits/s    
size
=    5056kB time=323.6 bitrate128.0kbits/s    
size
=    5197kB time=332.6 bitrate128.0kbits/s    
size
=    5336kB time=341.5 bitrate128.0kbits/s    
size
=    5478kB time=350.6 bitrate128.0kbits/s    
size
=    5619kB time=359.6 bitrate128.0kbits/s    
size
=    5763kB time=368.8 bitrate128.0kbits/s    
size
=    5904kB time=377.9 bitrate128.0kbits/s    
size
=    6050kB time=387.2 bitrate128.0kbits/s    
size
=    6182kB time=395.7 bitrate128.0kbits/s    
size
=    6305kB time=403.5 bitrate128.0kbits/s    
size
=    6438kB time=412.0 bitrate128.0kbits/s    
size
=    6587kB time=421.6 bitrate128.0kbits/s    
size
=    6734kB time=431.0 bitrate128.0kbits/s    
size
=    6870kB time=439.7 bitrate128.0kbits/s    
size
=    7009kB time=448.6 bitrate128.0kbits/s    
size
=    7140kB time=457.0 bitrate128.0kbits/s    
size
=    7268kB time=465.1 bitrate128.0kbits/s    
video
:0kB audio:7268kB global headers:0kB muxing overhead 0.000430
You are using a very old version of FFmpeg. Update your version of FFmpeg to the latest "stable" version. Do not get the "newest" version by compiling FFmpeg from git source. Use the default package install commands (will vary depending on your version of Linux) to get the most recent "stable" version.

You also seem like you might be missing at least the libx264 codec (which enables conversion to video formats). Ensure that you have all the necessary codecs for FFmpeg.

Do these things, and then we'll go from there...
__________________
Regards, R.J.

---------------------------------------------------------

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 12-07-2012, 02:27 AM   PM User | #562
bbrog
New Coder

 
Join Date: Jun 2012
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
bbrog is an unknown quantity at this point
Hey, looks like youtube changed up there code again.

So can no longer convert youtube videos into mp3.

Please do let me know about this asap.

Thanks!
bbrog is offline   Reply With Quote
Old 12-07-2012, 02:36 AM   PM User | #563
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by bbrog View Post
Hey, looks like youtube changed up there code again.

So can no longer convert youtube videos into mp3.

Please do let me know about this asap.

Thanks!
I can confirm this. I will work on a fix and publish it here as soon as possible. Thanks for the heads up...
__________________
Regards, R.J.

---------------------------------------------------------

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 12-07-2012, 02:40 AM   PM User | #564
bbrog
New Coder

 
Join Date: Jun 2012
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
bbrog is an unknown quantity at this point
No problem Thanks let us know asap
bbrog is offline   Reply With Quote
Old 12-07-2012, 03:31 AM   PM User | #565
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by bbrog View Post
Hey, looks like youtube changed up there code again.

So can no longer convert youtube videos into mp3.

Please do let me know about this asap.

Thanks!
Are you using the free version of the software? The paid-for version? Linux or Windows?

My tests indicate that this is only an issue for the free version. The paid-for version of the software is still functioning perfectly!

For the free version, in YouTubeToMp3Converter.class.php, please change the following code accordingly:

PHP Code:
        function ExtractSongTrackName($vidSrc$srcType)
        {
            
$name '';
            
$vidSrcTypes $this->GetVidSrcTypes();
            if (
in_array($srcType$vidSrcTypes))
            {
                
$vidSrc = ($srcType == $vidSrcTypes[1]) ? file_get_contents($vidSrc) : $vidSrc;
                if (
$vidSrc !== false)
                {
                    if (
preg_match('/(<title>)(.+?)( - YouTube)(<\/title>)/'$vidSrc$matches) == 1)
                    {
                        
$name trim($matches[2]);
                        
$name iconv("UTF-8""ISO-8859-1//TRANSLIT"$name);
                        
$name = (!empty($name)) ? html_entity_decode($name) : 'unknown_'.time();
                    }
                }
            }
            return 
$name;
        } 
Do let me know if that solves your problem...
__________________
Regards, R.J.

---------------------------------------------------------

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 12-07-2012, 03:51 AM   PM User | #566
bbrog
New Coder

 
Join Date: Jun 2012
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
bbrog is an unknown quantity at this point
Hi, thanks this solved the problem. And yes I was using the free version.

Also you had created me custom backend stuff will changing this effect the backend operations in any way?

Let me know thanks!
bbrog is offline   Reply With Quote
Old 12-07-2012, 04:14 AM   PM User | #567
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by bbrog View Post
Also you had created me custom backend stuff will changing this effect the backend operations in any way?
I doubt it, but let me know if it does...
__________________
Regards, R.J.

---------------------------------------------------------

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 12-07-2012, 04:58 AM   PM User | #568
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
The new (updated and hopefully stable) distribution of files is located at the bottom of this post.

Quote:
PLEASE SEE THIS POST FOR IMPORTANT INFO REGARDING THE USE AND INSTALLATION OF THIS SCRIPT.

DO NOT USE THE ZIP DISTRIBUTION LOCATED AT THE ABOVE LINKED PAGE. USE ONLY THE ZIP FILE ATTACHED TO THE BOTTOM OF THIS POST.
New in this release:

1) Per recent changes to YouTube's site front end, I fixed the script's ability to determine a given video's title.

The paid-for version of the app is not affected by YouTube's recent changes. The full version of the software will continue to function as before -- perfectly!!

As always, please let me know if you have any questions/concerns regarding the above and/or the code.
Attached Files
File Type: zip 12-6-12.zip (6.9 KB, 85 views)
__________________
Regards, R.J.

---------------------------------------------------------

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 12-19-2012, 06:15 AM   PM User | #569
bbrog
New Coder

 
Join Date: Jun 2012
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
bbrog is an unknown quantity at this point
Hi, getting errors again when downloading videos. Think youtube changed its code again
bbrog is offline   Reply With Quote
Old 12-19-2012, 11:23 AM   PM User | #570
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
Originally Posted by bbrog View Post
Hi, getting errors again when downloading videos. Think youtube changed its code again
Hi, I can confirm this. Neither the free nor paid version appears to be working. I will work on a fix and post it here as soon as I can. Thanks for your patience.
__________________
Regards, R.J.

---------------------------------------------------------

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Reply

Bookmarks

Tags
audio, class, conversion, dailymotion, ffmpeg, mp3, php, script, video, youtube

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:30 PM.


Advertisement
Log in to turn off these ads.