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 19 of 81 FirstFirst ... 917181920212969 ... LastLast
Results 271 to 285 of 1211
Like Tree7Likes

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

  1. #271
    New Coder
    Join Date
    Feb 2012
    Posts
    24
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Chump, I just wanted to say thank you for the awesome script, my djs love it after some customization. mine is private, not public like some are.

  2. #272
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,795
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Quote Originally Posted by drakus View Post
    PS: I custom compile all my stuff, i do not use the distros releases.
    Are you familiar with the Linux command line interface then? I'm looking for a list of commands to install all of this script's dependencies, for those who only have access to the CLI and nothing else on the server. Or for different versions of Linux. I don't have the time at the moment to figure this out myself.
    Last edited by chump2877; 02-27-2012 at 12:16 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!

  3. #273
    New Coder
    Join Date
    Feb 2012
    Posts
    24
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by chump2877 View Post
    Are you familiar with the Linux command line interface then? I'm looking for a list of commands to install all of this script's dependencies, for those who only have access to the CLI and nothing else on the server. Or for different versions of Linux. I don't have the time at the moment to figure this out myself.
    yes I am familiar with debian & centos. Ubuntu is based on debian so should be about the same. .

    PM on exactly what you want it to do.
    I am guessing a shell script of some sort to install all software and libraries needed...

  4. #274
    New Coder
    Join Date
    Feb 2012
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by chump2877 View Post
    If you are having problems with people abandoning conversions, my suggestion to you is to run a cron job periodically that purges both the '/logs/' and '/videos/' directories. You can check the 'last modified' dates of each of the files in those directories to verify that the files are older than a certain date, and therefore OK to delete.

    That will get rid of the files. If you are looking to stop the downloads midstream to save bandwidth, then that's a different problem. Offhand, I don't know how that would be accomplished. You'd have to find a way to stop the cURL process at any time, and not just after a certain period or when the connection times out, i.e.:

    PHP Code:
    curl_setopt($ciCURLOPT_CONNECTTIMEOUT5);
    curl_setopt($ciCURLOPT_TIMEOUT5); 
    hi,
    i will check for your suggestions. there is one more thing with the script, it suddenly stopped showing download progress bar as well. i mean it used to show the progress of downloading of video earlier but not now but the video keeps on downloading and it converts into mp3 later but page stuck on the downloading video window....any idea what has got wrong with the script??

  5. #275
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,795
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Quote Originally Posted by umang.goyal View Post
    hi,
    i will check for your suggestions. there is one more thing with the script, it suddenly stopped showing download progress bar as well. i mean it used to show the progress of downloading of video earlier but not now but the video keeps on downloading and it converts into mp3 later but page stuck on the downloading video window....any idea what has got wrong with the script??
    It sounds like you are having problems with output buffering.

    Try replacing the following code (in all files except inside YouTubeToMp3Converter::UpdateVideoDownloadProgress()):

    PHP Code:
    flush(); 
    ...with...

    PHP Code:
    ob_end_flush(); 
    ob_flush(); 
    flush(); 
    If that doesn't work, check that you have installed/compiled/configured PHP correctly as it pertains to output buffering.
    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!

  6. #276
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello chump2877 great job, I work on linux server with ffmpeg, I noted two problems,
    1) to the line of YouTubeToMp3Converter.class.php
    #region Public Methods
    function __construct()
    {
    //$this->_uniqueID = time() . "_" . uniqid('', true); comented
    }
    //because this forces the server to store the flv on the server, and do not want that maybe is not even legal, and fills up too much space on the server

    2) in the same file at line 127 =

    //curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, array($this, 'UpdateVideoDownloadProgress'));
    commented because this is my error logs from: PHP Warning: curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: Invalid curl configuration option

    I do not know why but if someone can serve, for the rest everything works ok, thanks for your excellent work

  7. #277
    New Coder
    Join Date
    Feb 2012
    Posts
    24
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Brunob View Post
    Hello chump2877 great job, I work on linux server with ffmpeg, I noted two problems,
    1) to the line of YouTubeToMp3Converter.class.php
    #region Public Methods
    function __construct()
    {
    //$this->_uniqueID = time() . "_" . uniqid('', true); comented
    }
    //because this forces the server to store the flv on the server, and do not want that maybe is not even legal, and fills up too much space on the server

    2) in the same file at line 127 =

    //curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, array($this, 'UpdateVideoDownloadProgress'));
    commented because this is my error logs from: PHP Warning: curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: Invalid curl configuration option

    I do not know why but if someone can serve, for the rest everything works ok, thanks for your excellent work
    curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, array($this, 'UpdateVideoDownloadProgress'));

    if you are getting an error with that, your curl may not be installed properly. I have a few minor errors but they are warnings, nothing like you said.


    The flv should be getting deleted from the videos directory, if it isn't you have a permission problem or something not right in script. only thing stored is the mp3s and I wipe them weekly with a cron job.

    here is my code for the cron

    Code:
    <?php
        header("Pragma: no-cache");
        header("cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    
        $dir = '/YOU/DIRECTORY/TO THE/mp3/';
        foreach(glob($dir.'*.*') as $v){
      	  unlink($v);
        }
    ?>
    Last edited by drakus; 03-03-2012 at 02:42 PM.

  8. #278
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,795
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Quote Originally Posted by Brunob View Post
    Hello chump2877 great job, I work on linux server with ffmpeg, I noted two problems,
    1) to the line of YouTubeToMp3Converter.class.php
    #region Public Methods
    function __construct()
    {
    //$this->_uniqueID = time() . "_" . uniqid('', true); comented
    }
    //because this forces the server to store the flv on the server, and do not want that maybe is not even legal, and fills up too much space on the server

    That code generates a unique id for FLV files...in itself, it does nothing to force the storage of FLV files on the server...

    The AJAX in index.php that runs ffmpeg_progress.php at intervals, if working, removes FLV and log files....If the AJAX doesn't delete a file every now and then, then you can run a cron job to periodically purge the corresponding directories...


    2) in the same file at line 127 =

    //curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, array($this, 'UpdateVideoDownloadProgress'));
    commented because this is my error logs from: PHP Warning: curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: Invalid curl configuration option

    Like drakus said, you may have cURL installed/configured incorrectly...Or maybe you have a version of cURL or PHP that doesn't support that cURL option?

    I do not know why but if someone can serve, for the rest everything works ok, thanks for your excellent work
    see above...
    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!

  9. #279
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi!

    First off, thank you so much for this project! Once I get things up and rolling I will send a donation over. I just purchased a couple conversion scripts but I like the basics of this one.

    I am testing the script on cirtex hosting have changed the path of ffmpeg to
    /usr/local/bin/ffmpeg

    It wasn't working prior to this but once I made the above change it started converting. The problem, the conversion gets stuck at 98%. I checked the mp3 folder and I see the converted file in there. I downloaded it off of the server and it appears to work well.

    When I check the log file, at the end says Audio encoding failed. Any suggestions to this problem?

  10. #280
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,795
    Thanks
    19
    Thanked 156 Times in 147 Posts
    When I check the log file, at the end says Audio encoding failed. Any suggestions to this problem?
    Can you paste the log file? Also, please use Firebug to find out what is happening with the conversion progress bar -- why it gets stuck...check the various AJAX responses from ffmpeg_progress.php at the point that the progress bar gets stuck at 98%...paste the response(s) here...
    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!

  11. #281
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by chump2877 View Post
    Can you paste the log file? Also, please use Firebug to find out what is happening with the conversion progress bar -- why it gets stuck...check the various AJAX responses from ffmpeg_progress.php at the point that the progress bar gets stuck at 98%...paste the response(s) here...
    Thank you, the log is below, I will look into the firebug and update. I have never used firebug so may take me a few to figure it out.


    Code:
    FFmpeg version SVN-r24695, Copyright (c) 2000-2010 the FFmpeg developers
      built on Aug  4 2010 09:33:43 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
      configuration: --enable-gpl --enable-libmp3lame --enable-shared --enable-libxvid --enable-libvorbis --enable-libfaac --enable-nonfree --enable-libx264 --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-avfilter
      libavutil     50.23. 0 / 50.23. 0
      libavcore      0. 2. 0 /  0. 2. 0
      libavcodec    52.84. 2 / 52.84. 2
      libavformat   52.78. 0 / 52.78. 0
      libavdevice   52. 2. 0 / 52. 2. 0
      libavfilter    1.27. 0 /  1.27. 0
      libswscale     0.11. 0 /  0.11. 0
    [matroska,webm @ 0x9eed470] Estimating duration from bitrate, this may be inaccurate
    Input #0, matroska,webm, from 'videos/1330806869_4f52805589f8d1.35404814.flv':
      Duration: 00:04:26.40, start: 0.000000, bitrate: N/A
        Stream #0.0: Video: vp8, yuv420p, 640x480, PAR 1:1 DAR 4:3, 25 fps, 25 tbr, 1k tbn, 25 tbc
        Stream #0.1: Audio: vorbis, 44100 Hz, stereo, s16
    Output #0, mp3, to 'mp3/Pitbull_Feat_Flo_Rida_-_Move_Shake_Drop_HQ.mp3':
      Metadata:
        TSSE            : Lavf52.78.0
        Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s
    Stream mapping:
      Stream #0.1 -> #0.0
    Press [q] to stop encoding
    size=      92kB time=11.76 bitrate=  64.0kbits/s    
    size=     149kB time=19.04 bitrate=  64.0kbits/s    
    size=     242kB time=31.01 bitrate=  64.0kbits/s    
    size=     337kB time=43.18 bitrate=  64.0kbits/s    
    size=     435kB time=55.69 bitrate=  64.0kbits/s    
    size=     529kB time=67.71 bitrate=  64.0kbits/s    
    size=     602kB time=77.09 bitrate=  64.0kbits/s    
    size=     695kB time=88.92 bitrate=  64.0kbits/s    
    size=     790kB time=101.12 bitrate=  64.0kbits/s    
    size=     878kB time=112.43 bitrate=  64.0kbits/s    
    size=     966kB time=123.69 bitrate=  64.0kbits/s    
    size=    1054kB time=134.90 bitrate=  64.0kbits/s    
    size=    1145kB time=146.57 bitrate=  64.0kbits/s    
    size=    1239kB time=158.59 bitrate=  64.0kbits/s    
    size=    1332kB time=170.45 bitrate=  64.0kbits/s    
    size=    1426kB time=182.47 bitrate=  64.0kbits/s    
    size=    1519kB time=194.38 bitrate=  64.0kbits/s    
    size=    1613kB time=206.42 bitrate=  64.0kbits/s    
    size=    1707kB time=218.54 bitrate=  64.0kbits/s    
    size=    1800kB time=230.35 bitrate=  64.0kbits/s    
    size=    1893kB time=242.26 bitrate=  64.0kbits/s    
    size=    1987kB time=254.28 bitrate=  64.0kbits/s    
    size=    2037kB time=260.73 bitrate=  64.0kbits/s    
    [libmp3lame @ 0x9fbf490] lame: output buffer too small (buffer index: 9404, free bytes: 388)
    Audio encoding failed
    Last edited by mikevic80; 03-03-2012 at 09:24 PM.

  12. #282
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,795
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Quote Originally Posted by mikevic80 View Post
    Thank you, the log is below, I will look into the firebug and update. I have never used firebug so may take me a few to figure it out.
    From the log, and a quick google search for that error message, it looks like you need to see if your hosting provider can update the versions of ffmpeg and/or libmp3lame...

    https://www.google.com/search?client...w=1916&bih=915
    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!

  13. #283
    New Coder
    Join Date
    Feb 2012
    Posts
    24
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Make sure that your host is running php 5.3.x and latest ffmpeg & libmp3lame and make sure they are running php-ffmpeg as well

    latest version of ffmpeg is FFmpeg 0.10 "Freedom" http://ffmpeg.org/download.html
    latest version of php is 5.3.10 http://www.php.net
    latest of libmp3lame is 3.99 http://lame.sourceforge.net/

    php-ffmpeg is 0.4.9_pre1 http://ffmpeg-php.sourceforge.net/ - Old but latest.

    i have noticed problems with older version of ffmpeg, php5.2 and the version of libmp3lame with the distro should be ok, but i suggest to go with the latest.

  14. #284
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you! I will give this a try and post an update.

  15. #285
    New Coder
    Join Date
    Feb 2012
    Posts
    15
    Thanks
    4
    Thanked 0 Times in 0 Posts
    finaly script working: http://zaap.ch
    only problem are converting taking to long time...

    Any ide why?

    My server:
    Dualcore 2.93GHz
    2GB Ram


 
Page 19 of 81 FirstFirst ... 917181920212969 ... LastLast

LinkBacks (?)

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