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 15 of 82 FirstFirst ... 513141516172565 ... LastLast
Results 211 to 225 of 1218
Like Tree7Likes

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

  1. #211
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,797
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Your AJAX response text indicates that you are getting an error in ffmpeg_progress.php -- most likely your FFMPEG command is not generating a log file. Without a log file, no conversion progress bar can be generated, and the entire process will stall (as it's doing).

    The log file is generated by the code in red:

    Code:
    $exec_string = parent::_FFMPEG.' -i '.$this->GetTempVidFileName().' -y -acodec libmp3lame -ab '.$quality.'k '.$this->GetSongFileName() . ' 2> logs/' . $this->_uniqueID . '.txt';
    Few things to try:

    1) Check that 'logs/' and 'mp3/' directories have write privileges

    2) Check to make sure cURL is not "hanging up" on exec_ffmpeg.php before the full FFMPEG command can be executed. Try increasing the number of seconds in this line in YouTubeToMp3Converter::GenerateMP3():

    PHP Code:
    curl_setopt($chCURLOPT_TIMEOUT1); 
    3) Check your 'logs/' directory. Are there text files in there?

    4) Check your 'mp3/' directory. Are there mp3 files in there?
    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!

  2. #212
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Log file are correctly located in logs folder, mp3 file in mp3 folder, permissions on folder 777

    curl_setopt($ch, CURLOPT_TIMEOUT, 1); tested

    same things

    no error on error_log from apache

    don't undertand

  3. #213
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,797
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Paste the contents of the log file that is generated.
    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!

  4. #214
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    this is the log file chum

    ffmpeg version N-38046-g278d6ab-syslint Copyright (c) 2000-2012 the FFmpeg developers
    built on Feb 20 2012 18:29:26 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
    configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint
    libavutil 51. 39.100 / 51. 39.100
    libavcodec 54. 3.101 / 54. 3.101
    libavformat 54. 1.100 / 54. 1.100
    libavdevice 53. 4.100 / 53. 4.100
    libavfilter 2. 62.101 / 2. 62.101
    libswscale 2. 1.100 / 2. 1.100
    libswresample 0. 6.100 / 0. 6.100
    libpostproc 52. 0.100 / 52. 0.100
    Input #0, matroska,webm, from 'videos/1329984973_4f45f5cd7d95c6.82276514.flv':
    Duration: 00:07:45.23, start: 0.000000, bitrate: 194 kb/s
    Stream #0:0: Video: vp8, yuv420p, 480x360, SAR 1:1 DAR 4:3, 30 fps, 59.94 tbr, 1k tbn, 1k tbc (default)
    Stream #0:1: Audio: vorbis, 44100 Hz, stereo, s16 (default)
    Output #0, mp3, to 'mp3/Autechre_-_Puch.mp3':
    Metadata:
    TSSE : Lavf54.1.100
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s (default)
    Stream mapping:
    Stream #0:1 -> #0:0 (vorbis -> libmp3lame)
    Press [q] to stop, [?] for help
    size= 325kB time=00:00:20.74 bitrate= 128.2kbits/s
    size= 683kB time=00:00:43.70 bitrate= 128.1kbits/s
    size= 1038kB time=00:01:06.42 bitrate= 128.1kbits/s
    size= 1391kB time=00:01:28.97 bitrate= 128.0kbits/s
    size= 1736kB time=00:01:51.09 bitrate= 128.0kbits/s
    size= 2089kB time=00:02:13.69 bitrate= 128.0kbits/s
    size= 2433kB time=00:02:35.68 bitrate= 128.0kbits/s
    size= 2782kB time=00:02:58.05 bitrate= 128.0kbits/s
    size= 3126kB time=00:03:20.04 bitrate= 128.0kbits/s
    size= 3471kB time=00:03:42.14 bitrate= 128.0kbits/s
    size= 3819kB time=00:04:04.37 bitrate= 128.0kbits/s
    size= 4167kB time=00:04:26.63 bitrate= 128.0kbits/s
    size= 4517kB time=00:04:49.07 bitrate= 128.0kbits/s
    size= 4868kB time=00:05:11.51 bitrate= 128.0kbits/s
    size= 5215kB time=00:05:33.71 bitrate= 128.0kbits/s
    size= 5562kB time=00:05:55.97 bitrate= 128.0kbits/s
    size= 5913kB time=00:06:18.38 bitrate= 128.0kbits/s
    size= 6262kB time=00:06:40.71 bitrate= 128.0kbits/s
    size= 6611kB time=00:07:03.05 bitrate= 128.0kbits/s
    size= 6960kB time=00:07:25.38 bitrate= 128.0kbits/s
    size= 7266kB time=00:07:45.00 bitrate= 128.0kbits/s

    video:0kB audio:7266kB global headers:0kB muxing overhead 0.006062%

  5. #215
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,797
    Thanks
    19
    Thanked 156 Times in 147 Posts
    I don't see any problems in the log file.

    Try to debug different PHP variables inside of ffmpeg_progress.php (that are causing $error == 1).

    For example, to debug $logFile in ffmpeg_progress.php, change the last line of that file to read:

    PHP Code:
    echo $newLogLength "|" $progress "|" $conversionSuccess "|" $error "|" $logFile
    (Additional variables must appear at the end of the echo statement separated by pipe characters.)

    Then check the AJAX response text in FireBug (in Firefox) to see what those variables are. Post the values of those variables 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!

  6. #216
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    chump, I've modified the file, and add your command line to see variables error, but nothing appears on the web page, in firebug I've this :

    Paramètresapplication/x-www-form-urlencoded
    logLength 5002851
    mp3File Autechre_-_Puch.mp3
    uniqueId 1329986805_4f45fcf5d35210.45294660
    Source
    uniqueId=1329986805_4f45fcf5d35210.45294660&logLength=5002851&mp3File=Autechre_-_Puch.mp3

    I think it's correct no ?

  7. #217
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Paramètresapplication/x-www-form-urlencoded
    logLength 5002851
    mp3File Autechre_-_Puch.mp3
    uniqueId 1329986805_4f45fcf5d35210.45294660
    Source
    uniqueId=1329986805_4f45fcf5d35210.45294660&logLength=5002851&mp3File=Autechre_-_Puch.mp3
    is uniqueId = xxxxx must be :

    Paramètresapplication/x-www-form-urlencoded
    logLength 5002851
    mp3File Autechre_-_Puch.mp3
    uniqueId 1329986805_4f45fcf5d35210.45294660
    Source
    uniqueId=1329986805_4f45fcf5d35210.45294660.txt&logLength=5002851&mp3File=mp3/Autechre_-_Puch.mp3
    ?

  8. #218
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I've this in post ffmeg_progress in firebug :

    2851|0|2|2|465.23|02851|0|2|2|/home/online/public_html/Dev3/phptube2/logs/1329987125_4f45fe351c6e65.65354386.txt

  9. #219
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jobsabammz View Post
    It is a free script just using Curl and PHP. It gives three options MP4, 3gp and flv. I want to try and get it to work with mp3, and was wondering if someone can take a look. I think just a little change similar to what you have done before with 3gp conversion could achieve this. I tried myself but I am just learning.

    you can change the ffmpeg command line in :

    $exec_string = 'ffmpeg -i '.$this->GetTempVidFileName().' -y -acodec libmp3lame -ab '.$quality.'k '.$this->GetSongFileName() . ' 2> logs/' . $this->_uniqueID . '.txt';

  10. #220
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,797
    Thanks
    19
    Thanked 156 Times in 147 Posts
    2851|0|2|2|465.23|02851|0|2|2|/home/online/public_html/Dev3/phptube2/logs/1329987125_4f45fe351c6e65.65354386.txt
    I don't know exactly which variables you are outputting there...time for bed for me....I'll take another look tomorrow
    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. Users who have thanked chump2877 for this post:

    bedo1975 (02-23-2012)

  12. #221
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    okay, I've reuploaded a fresh script without any modification, and I think that I have throught the error :

    200 OK
    148ms
    jquery.min.js (ligne 4)
    POST http://onlinemyclip.com/Dev3/phptube...g_progress.php

    200 OK
    71ms
    jquery.min.js (ligne 4)
    En-têtesPostRéponseHTML
    Paramètresapplication/x-www-form-urlencoded
    logLength 0
    mp3File Autechre_-_Puch.mp3
    uniqueId 1329990808_4f460c98d5f726.97547783
    Source
    uniqueId=1329990808_4f460c98d5f726.97547783&logLength=0&mp3File=Autechre_-_Puch.mp3
    you can see with the fresh script, the variable logLength in the post ffmpeg_progress is empty egals to " 0 " so I think it's the error

    Wait for you see !

  13. #222
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Again me

    2792|0|2|2

    I looked at this, the first number is le length of log file => ok

    but the second number is normaly the % progresse

    so in firebug he was always at 0 and jquery process are loop infinity

  14. #223
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,797
    Thanks
    19
    Thanked 156 Times in 147 Posts
    Ok, $progress is determined in ffmpeg_progress.php as follows:

    PHP Code:
    $progress round(($currentTime $totalTime) * 100); 
    So adjust your echo line in the same file as follows:

    PHP Code:
    echo $newLogLength "|" $progress "|" $conversionSuccess "|" $error "|" $currentTime "|" $totalTime
    Run the script and check the various AJAX responses in FireBug to see what those variables are evaluating as. That could give you a hint as to what the problem is.
    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!

  15. #224
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    okay it's do :

    result :

    $newLogLength . "|" . $progress . "|" . $conversionSuccess . "|" . $error . "|" .
    2428 | 0 | 2 | 2 |

    $currentTime . "|" . $totalTime;
    0 | 465.23
    I see the $currentTime variable are always eguals to ' 0 ' it's the coz i think

  16. #225
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    $currentTime = (float)end($times[1]);

    this is my problem with the float instruction


 
Page 15 of 82 FirstFirst ... 513141516172565 ... 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
  •