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 29 of 86 FirstFirst ... 1927282930313979 ... LastLast
Results 421 to 435 of 1286
Like Tree9Likes

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

  1. #421
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by bbrog View Post
    Hi, yes all mp3's show up with 0kbps. I used windows 7.

    Just sent you the email.

    Thanks!
    Hi, I received your mp3 file, and I can verify that the bitrate displays as 0k in Windows 7. However, when I open the mp3 file in VLC media player it shows 32K bitrate.

    I tried to reproduce the problem here. I accessed my software (running on an Ubuntu server, over the internet) on my Windows 7 machine using FireFox. The downloaded mp3 was 320k bitrate, just like I requested.

    I can't explain why this is happening to you, and I can't reproduce the problem.

    If others start to have this problem, then I will reassess the situation at that time. At this point, though, my guess is the problem is isolated to your installation on your server. Sorry I couldn't help more.

    Edit: One last thing to try: Paste a copy of the log file generated by FFmpeg when converting your mp3's, and I will take a quick look to see if something funny is going on...
    Last edited by chump2877; 07-31-2012 at 06:46 AM.
    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 !! ♪♪

  2. #422
    New Coder
    Join Date
    Jun 2012
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi, thanks. On other players such as realplayer it shows 320kbps as bitrate. Below is my log file

    Code:
    ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
      built on Jun 12 2012 16:52:09 with gcc 4.6.3
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [matroska,webm @ 0x13109c0] Estimating duration from bitrate, this may be inaccurate
    
    Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 23.98 (24000/1001)
    Input #0, matroska,webm, from 'videos/1343690527_5017171faa34e3.89176466.flv':
      Duration: 00:03:46.82, start: 0.000000, bitrate: N/A
        Stream #0.0(eng): Video: vp8, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 1k fps, 23.98 tbr, 1k tbn, 1k tbc (default)
        Stream #0.1: Audio: vorbis, 44100 Hz, stereo, s16 (default)
    Output #0, mp3, to 'mp3/We_Are_Young_-_Fun_Ft_Janelle_Monae_Alvin_Risk_Remix_Part_2.mp3':
      Metadata:
        TSSE            : Lavf53.21.0
        Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, s16, 327 kb/s (default)
    Stream mapping:
      Stream #0.1 -> #0.0
    Press ctrl-c to stop encoding
    size=     455kB time=11.65 bitrate= 320.1kbits/s    
    size=     925kB time=23.67 bitrate= 320.0kbits/s    
    size=    1407kB time=36.02 bitrate= 320.0kbits/s    
    size=    1878kB time=48.07 bitrate= 320.0kbits/s    
    size=    2344kB time=60.00 bitrate= 320.0kbits/s    
    size=    2807kB time=71.86 bitrate= 320.0kbits/s    
    size=    3263kB time=83.54 bitrate= 320.0kbits/s    
    size=    3716kB time=95.14 bitrate= 320.0kbits/s    
    size=    4093kB time=104.78 bitrate= 320.0kbits/s    
    size=    4544kB time=116.32 bitrate= 320.0kbits/s    
    size=    5011kB time=128.29 bitrate= 320.0kbits/s    
    size=    5464kB time=139.89 bitrate= 320.0kbits/s    
    size=    5929kB time=151.77 bitrate= 320.0kbits/s    
    size=    6387kB time=163.50 bitrate= 320.0kbits/s    
    size=    6846kB time=175.26 bitrate= 320.0kbits/s    
    size=    7307kB time=187.06 bitrate= 320.0kbits/s    
    size=    7716kB time=197.54 bitrate= 320.0kbits/s    
    size=    8122kB time=207.91 bitrate= 320.0kbits/s    
    size=    8553kB time=218.96 bitrate= 320.0kbits/s    
    size=    8862kB time=226.87 bitrate= 320.0kbits/s    
    video:0kB audio:8862kB global headers:0kB muxing overhead 0.001510%

  3. #423
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    What happens when you modify the existing FFmpeg command in YouTubeToMp3Converter.class.php:

    PHP Code:
    $exec_string parent::_FFMPEG.' -i '.$this->GetTempVidFileName().' -vol '.parent::_VOLUME.' -y -acodec libmp3lame -ab '.$quality.'k '.$this->GetSongFileName() . ' 2> logs/' $this->_uniqueID '.txt'
    ...and change:

    PHP Code:
    -ab '.$quality.'k  
    to one of the following:

    PHP Code:
    -'.$quality.'k  
    PHP Code:
    -b:'.$quality.'k  
    PHP Code:
    -b:a:'.$quality.'k  
    PHP Code:
    -b:a:'.$quality.'k  
    What I'm reading is that Libav (what you and I are both running under the guise of FFmpeg) is actually a fork of FFmpeg that has become the standard package installed for Debian/Ubuntu machines (when you do an apt-get install ffmpeg)....

    Libav and FFmpeg are being developed in parallel and are very, very similar...but there are some nuances between the two projects, and I expect they are more evident as the projects continue to diverge...

    You are using a later version of Libav...I am running the following:

    Code:
    ffmpeg version 0.7.6-4:0.7.6-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers
      built on Jun 12 2012 16:28:10 with gcc 4.6.1
    So perhaps the old FFmpeg audio bitrate flag -ab is behaving strangely in your version of Libav, and instead, the Libav implementation of audio bitrate should be used instead:

    http://libav.org/avconv.html#Stream-specifiers-1
    http://libav.org/avconv.html#Codec-AVOptions

    Let me know if implementing any of my suggestions helps, and if so, I will make adjustments to my code accordingly. Perhaps I can put the FFmpeg command in the config file, and provide different FFmpeg command options depending on the version of FFmpeg and/or Linux platform being used. We'll see...
    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 !! ♪♪

  4. #424
    New Coder
    Join Date
    Jun 2012
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi, I tried all 4 alternatives that you posted and they did not solve the issue.

    Do let me know.

    Thanks!

  5. #425
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by bbrog View Post
    Hi, I tried all 4 alternatives that you posted and they did not solve the issue.

    Do let me know.

    Thanks!
    That was my best guess as to how to fix your problem. If it's still not working for you, then I do not know what your issue is, and I will assume that the problem is exclusive to your installation on your server.
    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 !! ♪♪

  6. #426
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    This is a total noob question, but I wanted to make sure before I started. If I wanted to use this for personal use only, I could set up an apache server and do all the set-up, and still use the app connected to
    Code:
    localhost
    only correct?

  7. #427
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by appletown View Post
    This is a total noob question, but I wanted to make sure before I started. If I wanted to use this for personal use only, I could set up an apache server and do all the set-up, and still use the app connected to
    Code:
    localhost
    only correct?
    Yup, if the index.php resides in the web root directory of your server, then you only need to type "localhost" in browser address bar...Of course, I'm assuming that you are using the app on the same machine where it is installed..If you're on a network, and accessing a remote (network) installation, then you would put the IP address of the machine where the app is installed in the address bar...
    Last edited by chump2877; 08-03-2012 at 10:51 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 !! ♪♪

  8. Users who have thanked chump2877 for this post:

    appletown (08-03-2012)

  9. #428
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by chump2877 View Post
    Yup, if the index.php resides in the web root directory of your server, then you only need to type "localhost" in browser address bar...Of course, I'm assuming that you are using the app on the same machine where it is installed..If you're on a network, and accessing a remote (network) installation, then you would put the IP address of the machine where the app is installed in the address bar...
    Super, just as i suspected/hoped. Thanks so much for the source as well man. <internetHighFive />!

  10. #429
    New Coder
    Join Date
    Jun 2012
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi, today my script all of the sudden just stopped working. It downloads the video and when it gets to converting nothing happens at all.

    Please do let me know asap thanks!

  11. #430
    New Coder
    Join Date
    Jun 2012
    Posts
    45
    Thanks
    3
    Thanked 0 Times in 0 Posts
    hmm strange it started working again. Get a lot of complaints from my users that at times the script does not work the way its suppose to below are the problems that we have run into so far incase it helps you in your future release:

    1.) Video downloads and converts to 100% and nothing happens
    2.) Video downloads and converting part does nothing.
    3.) video does not download and does not convert

    This stuff happens randomly but then automatically starts working.

    Do let me know thanks!

  12. #431
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by bbrog View Post
    hmm strange it started working again. Get a lot of complaints from my users that at times the script does not work the way its suppose to below are the problems that we have run into so far incase it helps you in your future release:

    1.) Video downloads and converts to 100% and nothing happens
    2.) Video downloads and converting part does nothing.
    3.) video does not download and does not convert

    This stuff happens randomly but then automatically starts working.

    Do let me know thanks!
    I'm not having any of these problems. Everything is working ok for me. If I can't reproduce the problem, then I can't fix the problem.

    What specific video (or videos) are you trying to convert? If you enable error reporting with PHP, do you see any errors in the browser? In the server error log? Can you paste the AJAX response text(s) that you are receiving during conversion? (hint: Check the Console tab of Firebug in Firefox.) Can you paste the FFmpeg log or logs? What software and version numbers do you have installed on your server? Are directories set to the correct permissions? If your code is publicly available, what is the URL of your web site?

    Again, it's entirely possible that all of these problems you are having are isolated to your installation on your server. So instead of troubleshooting the code (which is working elsewhere), we may need to troubleshoot your installation and server configuration.
    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. #432
    New Coder
    Join Date
    May 2012
    Posts
    75
    Thanks
    1
    Thanked 0 Times in 0 Posts
    hi chump i want add some limit on my script like i want when video increase 10 min lenght
    or 10mb size its not convert what i do? please fast reply

  14. #433
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by blacktiger786 View Post
    hi chump i want add some limit on my script like i want when video increase 10 min lenght
    or 10mb size its not convert what i do? please fast reply
    Someone else was wanting a way to do this earlier, and I sent the following message to him/her at that time. Perhaps it will help you:

    I see 2 ways to get remote file size and cancel the download/conversion if the file is too big (per some predefined MAX_FILE_SIZE constant in your script):

    1) Try the solution suggested here: http://www.codingforums.com/showpost...&postcount=112. That post links to some example code here: http://www.php.net/manual/en/functio...size.php#92462. This method allows you to gauge file size before actually downloading the file (by only downloading the HTTP headers).

    2) Another way to do this is to leverage the CURLOPT_WRITEFUNCTION callback to gauge file size as the download is in progress. See these links:

    http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
    http://curl.haxx.se/libcurl/php/examples/callbacks.html

    The CURLOPT_WRITEFUNCTION callback receives the number of bytes written -- either since the last time the callback fired, or the total number of bytes received during the cURL session -- i'm not sure which.

    If the CURLOPT_WRITEFUNCTION receives the total number of bytes received for the current download, then it's just a matter of returning something other than the number of bytes received inside the callback function -- when the total bytes received exceeds the maximum download size -- to force the cURL download to abort with an error. (This callback must return the number of bytes received in order to sustain the cURL process.)

    If the CURLOPT_WRITEFUNCTION receives the number of bytes received since the last time the callback was executed, then the strategy is a little more complex. You'll need to set up a class field/variable to store the growing number of bytes downloaded. And every time the callback fires, you'll need to increment this class variable by the current number of bytes received by the callback -- and then check to see if the class variable exceeds your maximum download size. When your class variable exceeds maximum download size, after many calls to the callback function, then in the final call to the callback function you can return something other than the number of bytes received to cause the cURL process to abort.

    Once you have determined that the downloaded file is too large, and you have aborted the cURL process, then you can delete the partially downloaded file off the server. And serve an error message to the user.
    The person said he/she tried the above, but couldn't get it to work. (I haven't tried any of the above solutions, but in theory, it seems like they could work.) Instead, he/she offered the following alternative:

    I came up with a simple solution by using the duration of the video

    Here is my code: http://pastie.org/private/t2tsxrxfd351ohbfd9njka

    The first part extracts the video ID and the second part gets the length of it.
    Once the length has been fetched it multiplies it with 23 which is the average size for 1 second on a medium quality FLV video. If the size then is larger than the limit it will echo an error.
    I'm just quickly regurgitating an old conversation here and hoping you can glean some benefit from it. It seems like it applies to your situation...
    Last edited by chump2877; 08-24-2012 at 07:04 PM. Reason: fixed links
    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. #434
    New Coder
    Join Date
    May 2012
    Posts
    75
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Code:
    Here is my code: http://pastie.org/private/t2tsxrxfd351ohbfd9njka
    maybe its code working fine but i don't know where i put this code file name and fuction name etc

  16. #435
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Quote Originally Posted by blacktiger786 View Post
    Code:
    Here is my code: http://pastie.org/private/t2tsxrxfd351ohbfd9njka
    maybe its code working fine but i don't know where i put this code file name and fuction name etc
    If you want me to write the code for you, then I am available to do so at my hourly rate/fee. I simply don't have the time at the moment to do this for free.

    In lieu of paying me or someone else to do the work, I would hope that you would take the suggestions that I've provided you here and try to run with them. Let me know how it goes, and you can return here if you need further assistance during the process.
    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 !! ♪♪


 
Page 29 of 86 FirstFirst ... 1927282930313979 ... 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
  •