Web Analytics Made Easy -
StatCounter YouTube-to-MP3 conversion - PHP class and script - CodingForum

Announcement

Collapse
No announcement yet.

YouTube-to-MP3 conversion - PHP class and script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Originally posted by chump2877 View Post
    I'm not having that problem.

    Are you using the ffmpeg.exe file that I provided? Are you using a Windows OS? XAMPP?

    Can you post the URLs of any videos that are not converting for you?

    Are you able to play the video at "videos/1342856867_500a5ea3425531.60843462.flv"? If you can't play the video, then either the file is corrupt or cURL is not downloading the video correctly.
    Yes, Windows 7, WAMP,

    None of them are, and but some will download.

    I know the files are corrupt, because they are 0Kbs.

    Link to video that failed to download earlier:
    http://www.youtube.com/watch?v=TFGtiWKy1Tk

    Comment


    • Originally posted by Nikey646 View Post
      Link to video that failed to download earlier:
      http://www.youtube.com/watch?v=TFGtiWKy1Tk
      Is that the only video that you are having problems converting?

      The url-decoded source of that video is:

      Code:
      http://o-o---preferred---lax04s10---v24---lscache6.c.youtube.com/videoplayback?upn=UPzpso4sI_w&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&fexp=916012,925000,908460,915507,907217,907335,921602,922401,922600,919804,920704,912806,924500,906831,924700,913547,920706,924402,907344,912706,902518&ms=au&itag=46&ipbits=8&signature=011CA7797C3815C56A8F4A5C200E6A1560863CB8.B9E8C520A41BB781A0918E7C965EBD04A6D5A8D8&mv=m&sver=3&mt=1342889540&ratebypass=yes&source=youtube&expire=1342911556&key=yt1&ip=84.276.124.110&cp=U0hTR1lMT19KUENOM19RRlNGOlJIZGo0ZUY3VUNt&id=4c51ad8962b2d539
      When I plug that into Firefox, I eventually get an error message:

      Video can't be played because the file is corrupt.
      That would seem to confirm that the video on YouTube's cache server is corrupt. (From the URL, you can see that the video is being downloaded from YouTube's cache server.) The video actually playing at http://www.youtube.com/watch?v=TFGtiWKy1Tk is probably coming from another source.

      I very rarely come across videos that can't be converted. If this is happening for more than one video, then I will explore this further. Otherwise, I'll chalk it up to some kind of internal YouTube error.
      Regards, R.J.

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

      Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
      [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
      Explore all products and services, view demos, review documentation, check prices, and more!
      ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

      Comment


      • Originally posted by chump2877 View Post
        I very rarely come across videos that can't be converted. If this is happening for more than one video, then I will explore this further. Otherwise, I'll chalk it up to some kind of internal YouTube error.
        Is there anyway to download it still? Or is it a no go?

        Comment


        • Originally posted by Nikey646 View Post
          Is there anyway to download it still? Or is it a no go?
          For that video, you might be out of luck unless you can find an alternate video file URL in the browser source code.

          If you absolutely needed that particular video, and all else fails, you could try using a screen recorder (i.e., VLC) to record the YouTube video while its playing inside your browser. Then you could use FFmpeg to strip the audio track from the screen recording, using code like the following:

          PHP Code:
          $cmd 'ffmpeg -i screencast.flv -y -acodec libmp3lame -ab 128k audioTrack.mp3';
          exec($cmd); 
          Last edited by chump2877; Jul 23rd, 2012, 12:24 PM.
          Regards, R.J.

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

          Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
          [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
          Explore all products and services, view demos, review documentation, check prices, and more!
          ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

          Comment


          • Soon after making my last post, I found the video URL:

            Code:
            http://o-o---preferred---ord12s12---v22---lscache8.c.youtube.com/videoplayback?upn=Epc9q7GN7Wc&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&fexp=900210,914053,910104,900222,915507,907217,907335,921602,922600,919804,920704,924500,906831,924700,913547,920706,924402,907344,912706,902518&ms=au&itag=37&ipbits=8&signature=150EBE5810B9DADA1DCFB1253E525FA90013DD0B.36A3EA92BDD8747DE995CC8EE5E35379F6262B2C&mv=m&sver=3&mt=1343060659&ratebypass=yes&source=youtube&expire=1343084356&key=yt1&ip=99.128.18.254&cp=U0hTSFBTUl9KUENOM19ITVZEOkNYOExUSmhJR1Vx&id=4c51ad8962b2d539
            Looks like I may have to modify my scripts to look for a fallback video source -- if it exists -- when the initial video file source is corrupt or unavailable. I'll keep you guys posted, and issue a fix here when it becomes available.
            Regards, R.J.

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

            Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
            [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
            Explore all products and services, view demos, review documentation, check prices, and more!
            ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

            Comment


            • The new (updated and hopefully stable) distribution of files is located at the bottom of this post.

              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) Fixed bug that causes the script to crap out when the downloaded YouTube video is corrupt and/or less than 10kb. The script now detects this issue and tries a series of alternate video URLs until one is found that does work.
              2) Some minor updates & refactoring of code
              3) Minor bug fixes

              I will soon be updating the paid-for version of the app as well, and I will send an updated (free) copy to all those who have already purchased the script. I haven't decided yet how exactly to distribute the new release to past customers. Probably via the email addresses that you guys provided at Tradebit when you purchased the script. I will keep you posted.

              As always, please let me know if you have any questions/concerns regarding the above and/or the code.
              Attached Files
              Last edited by chump2877; Jul 24th, 2012, 02:39 PM.
              Regards, R.J.

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

              Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
              [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
              Explore all products and services, view demos, review documentation, check prices, and more!
              ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

              Comment


              • I get this error in paid version, can you please look into it for me.. I have sent you a message as well

                Code:
                parse error: syntax error, unexpected T_FUNCTION in /home/video/public_html/index.php on line 168

                Comment


                • Originally posted by soofi View Post
                  I get this error in paid version, can you please look into it for me.. I have sent you a message as well

                  Code:
                  parse error: syntax error, unexpected T_FUNCTION in /home/video/public_html/index.php on line 168
                  I can't explain why you are getting parse/syntax errors with my code...I don't have that problem here, running the code on my server....

                  Have you modified my code in some way?
                  Regards, R.J.

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

                  Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                  [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                  Explore all products and services, view demos, review documentation, check prices, and more!
                  ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                  Comment


                  • Havent touched it at all bud. Just unzipped it on my server

                    Comment


                    • Hello everyone,

                      As promised, I have just finished updating the paid-for version of my software. New in this version:

                      1) Fixed bug that causes the script to crap out when the downloaded YouTube/Dailymotion video is corrupt and/or less than 10kb. The script now detects this issue and tries a series of alternate video URLs until one is found that does work.
                      2) Improved speed for YouTube video conversions to mp4 and flv
                      3) Better quality video-to-video conversions
                      4) Improved handling and speed of all video conversions to 3gp
                      5) Better error handling
                      6) Some minor updates & refactoring of code
                      7) Minor bug fixes

                      All previous customers who have purchased the paid-for version of my app will be receiving this new, updated version via the e-mail addresses that you provided at Tradebit.com.

                      Please report any issues with either the paid-for version or the free version in this forum thread.

                      Finally, I encourage you to take advantage of the current summer sales price of my software before the price goes back up. Summer is going fast (in my neck of the woods, anyway), so don't delay and miss out on 40% off the regular price!!
                      Last edited by chump2877; Jul 28th, 2012, 07:23 PM.
                      Regards, R.J.

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

                      Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                      [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                      Explore all products and services, view demos, review documentation, check prices, and more!
                      ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                      Comment


                      • Hi, just wondering when i right click and view property of the mp3 under bitrate it says 0kbps.

                        How can this be fixed?

                        Do let me know.

                        Thanks!

                        Comment


                        • Originally posted by bbrog View Post
                          Hi, just wondering when i right click and view property of the mp3 under bitrate it says 0kbps.

                          How can this be fixed?

                          Do let me know.

                          Thanks!
                          I'm not having that problem here.

                          By default, FFmpeg sets the audio bitrate to 64k if it isn't set otherwise, I believe...But my script sets the bitrate directly within the FFmpeg command, to varying bitrates...

                          So, as far as I know, in no circumstance, if the FFmpeg command was executed successfully, should the audio bitrate ever be 0k...

                          Are you able to play the mp3 file? Is any other "weirdness" occurring? Have you modified the FFmpeg command in some way? Have you modified my code in some way?
                          Regards, R.J.

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

                          Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                          [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                          Explore all products and services, view demos, review documentation, check prices, and more!
                          ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                          Comment


                          • Hi, no have no modified anything. I followed your steps to install ffmpeg, ffmpeg with php, and the extra codecs.

                            The mp3 plays just fine but in iphone you cant seek to a specific place. The bitrate appears in players such as realplayer but when you right click to view the mp3 in windows it says 0kbps.

                            Comment


                            • Originally posted by bbrog View Post
                              Hi, no have no modified anything. I followed your steps to install ffmpeg, ffmpeg with php, and the extra codecs.

                              The mp3 plays just fine but in iphone you cant seek to a specific place. The bitrate appears in players such as realplayer but when you right click to view the mp3 in windows it says 0kbps.
                              Are all of your converted mp3's showing up as 0k bitrate?

                              What version of windows did you use to check the mp3 properties?

                              Does the bitrate show up in Linux when you check mp3 properties?

                              Can you email me a converted mp3 that has 0k bitrate?
                              Regards, R.J.

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

                              Help spread the word! Like our YouTube-to-Mp3 Conversion Script on Facebook !! :-)
                              [Instructional videos and tutorials are also available on YouTube, Dailymotion, and Vimeo]
                              Explore all products and services, view demos, review documentation, check prices, and more!
                              ♪♪ …Need Web Hosting For Our YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

                              Comment


                              • Hi, yes all mp3's show up with 0kbps. I used windows 7.

                                Just sent you the email.

                                Thanks!

                                Comment

                                Working...
                                X