Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 25 of 88 FirstFirst ... 1523242526273575 ... LastLast
Results 361 to 375 of 1313
Like Tree13Likes

Thread: YouTube-to-MP3 conversion - PHP class and script

  1. #361
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi globusut89, you use a host or vps, and its in pacifichost.com or other?
    Thank

  2. #362
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by globusut89 View Post
    My converter converts only video to mp3,
    other formats will not work here its>>www.pepzol.com
    Please check and write what is wrong, thanks
    I briefly checked your installation, and appears that only YouTube videos are not converting to video formats? I was able to convert Dailymotion to a video format.

    1) The first thing you should do is paste your FFmpeg log file here for the failed conversion. Comment out this line:

    PHP Code:
    unlink($logFile); 
    ...so that the app does not automatically delete the log file.

    2) Open up your site on Firefox and launch Firebug. Switch to the Console tab in Firebug and try to convert a file on your site. After the conversion screen appears, check the Console tab for the AJAX requests being made to ffmpeg_progress.php (the file that makes the conversion progress bar “go”). Each AJAX request is delineated by a plus sign that, when expanded, reveals the AJAX response text for that request.

    Your site, when converting a YouTube video to a video format, is asynchronously accessing ffmpeg_progress.php over and over again, to infinity, and returning the same AJAX response text each time: 0 | 0 | 2 | 1. Those numbers correspond to variables defined in ffmpeg_progress.php (log length, percent progress, conversion success, and error, respectively), and they indicate that something is wrong with the conversion.

    Open up ffmpeg_progress.php in your favorite script editor. The 1 in the sequence of numbers indicates there is an error. This error corresponds with 1 of 3 failed conditions in ffmpeg_progress.php:

    PHP Code:
    if (is_file($logFile))   // Does the new/current log file exist? 
    if (preg_match('/(Duration: )(\d\d):(\d\d):(\d\d\.\d\d)/i'$log$matches) == 1)   // Was the code able to parse the log file and find the total duration of the video to be converted? 
    if ($numTimes 0)   // Was the code able to parse the log file and find the amount of video (time) converted thus far? 
    Troubleshoot these conditions by placing additional variables at the end of this line (they must go at the end of the line):

    PHP Code:
    echo $newLogLength "|" $progress "|" $conversionSuccess "|" $error
    For example, to troubleshoot the $logFile variable, you could do the following:

    PHP Code:
    echo $newLogLength "|" $progress "|" $conversionSuccess "|" $error "|" $logFile
    After editing your ffmpeg_progress.php file, return to Firefox and try to convert a file again. Check the Firebug Console tab for the various AJAX responses to see what the $logFile variable (for example) evaluates to. So, you see, in this way, you can debug ffmpeg_progress.php as it is executed by consecutive AJAX requests.

    In this way (described above), figure out and isolate what code is failing. Once we know what code is failing, then we can troubleshoot why it is failing.
    Last edited by chump2877; 06-21-2012 at 11:45 PM.
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  3. #363
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes its right, dailymotion video convert properly.
    here it's
    http://pastebin.com/b53bnp1K
    Last edited by globusut89; 06-22-2012 at 10:05 AM.

  4. #364
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by globusut89 View Post
    Yes its right, dailymotion video convert properly.
    here it's
    http://pastebin.com/b53bnp1K
    Here's what you can try, in the order that I would try them:

    1) I don't think you have the latest stable release of FFmpeg. The top of your log file says:

    Code:
    FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
    I'm pretty sure the latest stable release of FFmpeg is at least into version 0.7.x, and the copyright reads 2000-2011? Try updating your FFmpeg to the latest stable release, and see if that fixes your problems.

    2) This line in the log file:

    Code:
    swScaler: Unknown format is not supported as input pixel format
    ...implies that the video track/stream of the video is encoded using a codec that FFmpeg doesn't recognize. And, in fact, the input video track/stream:

    Code:
    Stream #0.0(eng): Video: 0x0000, 1920x1080, PAR 1:1 DAR 16:9, 1k fps, 29.97 tbr, 1k tbn, 1k tbc
    ...doesn't even list a codec (that I can see). Kind of strange, since I assume YouTube generally re-encodes all videos that are uploaded to the site using some FFmpeg-compatible codec?

    Does this happen for all YouTube videos, or do some YouTube videos convert OK (to video formats)?

    3) The problem _might_ have something to do with this line in the log as well:

    Code:
    Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
    Perhaps FFmpeg is looking at the video container instead of the video track/stream (with regard to a video codec), and that's why FFmpeg can't find a video codec?


    Sorry I can't give you a more cut-and-dry solution to your problem here. The truth is, I'm not really sure what the problem is just by looking at the log file. Try updating FFmpeg first, and then we can analyze subsequent log files if the problem persists.
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  5. #365
    New Coder
    Join Date
    Jun 2012
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi, can you let me know which link I should download for ffmpeg

    http://ffmpeg.org/download.html

    the yum update stuff does not work with my server so I will have to manually get the link.

    Thanks!

  6. #366
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can not do update ffmpeg, because I have shared hosting.
    I contacted the help of pacifichost, they wrote that i should ordered a vps, since the shared hosting may have problem in with convert.
    May u have script, which convert but to only mp3 format ?
    anyway thanks for your help.

  7. #367
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by globusut89 View Post
    May u have script, which convert but to only mp3 format ?
    You could strip away functionality from the code so that it only converts to mp3...
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  8. #368
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by bbrog View Post
    Hi, can you let me know which link I should download for ffmpeg

    http://ffmpeg.org/download.html

    the yum update stuff does not work with my server so I will have to manually get the link.

    Thanks!
    I see that in one of my virtual machines, I have installed:

    Code:
    ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers
    I found a reference to that here: http://git.libav.org/?p=libav.git;a=...767f8fd5369859

    Link to files distribution appears to be this: http://git.libav.org/?p=libav.git;a=...5369859;sf=tgz
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  9. #369
    New Coder
    Join Date
    Jun 2012
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi, I'm running into the following problem now do you know what this can be about

    php: symbol lookup error:
    /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so: undefined
    symbol: avcodec_init

  10. #370
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by bbrog View Post
    Hi, I'm running into the following problem now do you know what this can be about

    php: symbol lookup error:
    /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so: undefined
    symbol: avcodec_init
    Looks like some kind of installation/compilation error.

    1) Did you completely remove the existing version of ffmpeg before installing a new version? Did you install multiple versions of some other software on the server?

    2) Have you added the following line to your php.ini:

    Code:
    extension=ffmpeg.so
    3) Does the file /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so exist? If so, paste the contents of the file.

    Also, I failed to ask why this is the case:

    the yum update stuff does not work with my server
    ...so why do you have to build ffmpeg from source?
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  11. #371
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When trying to convert YouTube to MP3 I do not see first step
    when video is download 1..50..100%%.
    I just see second step when video is convert 1...40...100%
    Why can not I see the first step ?

    and i got error log:
    Code:
    PHP Warning:  Division by zero in /home/pepzolco/public_html/VideoConverter.class.php on line 114
    here its line 114
    Code:
    $percent = round($downloaded/$downloadSize, 2) * 100;
    >>>
    http://videotomp3.pl


    ;
    Last edited by globusut89; 06-24-2012 at 07:52 PM.

  12. #372
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by globusut89 View Post
    When trying to convert YouTube to MP3 I do not see first step
    when video is download 1..50..100%%.
    I just see second step when video is convert 1...40...100%
    Why can not I see the first step ?
    You have modified the code, so I don't know why the code is no longer working for you. How could I know? The original code does not do that.

    That said, the download of the video is still occurring, because you can see it in the browser source code. Perhaps you deleted a flush() somewhere, which is required to flush the output buffer during the download process so that the download progress bar is visible.

    It's also possible that you have an extremely fast download speed, downloading the video from YouTube to your server. In which case, the video is downloaded before the download progress bar has a chance to display.

    Quote Originally Posted by globusut89 View Post
    and i got error log:
    Code:
    PHP Warning:  Division by zero in /home/pepzolco/public_html/VideoConverter.class.php on line 114
    That warning is irrelevant, and not the source of your problem. It is a harmless side effect of calculating the percentages for the progress bar. If you have disabled PHP error reporting, which you should (and it is disabled, by default), then PHP warnings like that will not be displayed in the browser.
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  13. #373
    New Coder
    Join Date
    Jul 2012
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Does your script support using proxy to connect to youtube?

  14. #374
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,845
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by zhanly View Post
    Does your script support using proxy to connect to youtube?
    Neither of the versions of my app (free or paid-for version) currently includes proxy functionality, but I have programmed this before using the Tor project. Tor, in general, leverages a large proxy network that enables you to anonymize your IP address and location while surfing the internet. You can install it on Linux and take advantage of the command line interface provided to programmatically (and anonymously) connect to YouTube via the Tor proxy network. (You need to create a socket connection to the Tor proxy first -- to establish a new identity -- before connecting to YouTube via cURL to download a video, if I recall correctly.)

    The problem with proxies (any proxy network) is that they are notoriously slow. So the download times of your videos will suffer, and that inconvenience will be passed on to the consumer of your website/application.

    If the demand for proxy connections to YouTube becomes great, I might add this feature to my app here. Can I ask exactly why you need to use a proxy to connect to YouTube?
    Regards, R.J.

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

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !! ♪♪

  15. #375
    New Coder
    Join Date
    Jun 2012
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi, just wondering how much cpu and memory this script uses? Does it use a good amount?

    Lets say we are getting hit by 20 downloads every minute or 1000 a day or something.

    My server specs:

    2.0ghz quad core
    8GB Ram

    has many other sites on it also.

    Do let me know.

    Thanks!


 
Page 25 of 88 FirstFirst ... 1523242526273575 ... LastLast

LinkBacks (?)

  1. 08-24-2014, 05:09 AM
  2. 07-21-2014, 06:32 PM
  3. 07-12-2014, 06:59 PM
  4. 06-26-2014, 04:39 PM
  5. 05-31-2014, 10:13 PM
  6. 04-24-2014, 08:53 PM
  7. 04-19-2014, 11:22 AM
  8. 04-04-2014, 09:33 PM
  9. 04-04-2014, 02:58 AM
  10. 03-28-2014, 07:03 AM
  11. 03-20-2014, 07:11 PM
  12. 03-16-2014, 02:22 AM
  13. 03-08-2014, 05:56 PM
  14. 03-07-2014, 07:21 PM
  15. 03-01-2014, 01:48 PM
  16. 02-22-2014, 09:40 PM
  17. 02-22-2014, 01:02 AM
  18. 02-21-2014, 09:15 PM
  19. 02-21-2014, 01:00 AM
  20. 02-20-2014, 09:37 PM
  21. 02-20-2014, 07:53 PM
  22. 02-20-2014, 04:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •