Go Back   CodingForums.com > :: Server side development > PHP > Post a PHP snippet

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-21-2012, 02:13 PM   PM User | #406
Nikey646
New Coder

 
Join Date: May 2012
Posts: 31
Thanks: 0
Thanked 7 Times in 7 Posts
Nikey646 is an unknown quantity at this point
Quote:
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
Nikey646 is offline   Reply With Quote
Old 07-21-2012, 07:15 PM   PM User | #407
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
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:

Quote:
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 my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 07-22-2012, 08:28 AM   PM User | #408
Nikey646
New Coder

 
Join Date: May 2012
Posts: 31
Thanks: 0
Thanked 7 Times in 7 Posts
Nikey646 is an unknown quantity at this point
Quote:
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?
Nikey646 is offline   Reply With Quote
Old 07-23-2012, 05:21 PM   PM User | #409
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
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); 
__________________
Regards, R.J.

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

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)

Last edited by chump2877; 07-23-2012 at 05:24 PM..
chump2877 is offline   Reply With Quote
Old 07-23-2012, 05:44 PM   PM User | #410
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
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 my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 07-24-2012, 07:28 PM   PM User | #411
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
The new (updated and hopefully stable) distribution of files is located at the bottom of this post.

Quote:
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
File Type: zip 7-24-12.zip (6.6 KB, 156 views)
__________________
Regards, R.J.

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

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)

Last edited by chump2877; 07-24-2012 at 07:39 PM..
chump2877 is offline   Reply With Quote
Old 07-25-2012, 03:16 PM   PM User | #412
soofi
New to the CF scene

 
Join Date: Jul 2012
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
soofi is an unknown quantity at this point
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
soofi is offline   Reply With Quote
Old 07-25-2012, 05:46 PM   PM User | #413
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
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 my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Users who have thanked chump2877 for this post:
soofi (07-25-2012)
Old 07-25-2012, 05:48 PM   PM User | #414
soofi
New to the CF scene

 
Join Date: Jul 2012
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
soofi is an unknown quantity at this point
Havent touched it at all bud. Just unzipped it on my server
soofi is offline   Reply With Quote
Old 07-29-2012, 12:19 AM   PM User | #415
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
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!!
__________________
Regards, R.J.

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

Help spread the word! Like my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)

Last edited by chump2877; 07-29-2012 at 12:23 AM..
chump2877 is offline   Reply With Quote
Old 07-31-2012, 12:27 AM   PM User | #416
bbrog
New Coder

 
Join Date: Jun 2012
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
bbrog is an unknown quantity at this point
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!
bbrog is offline   Reply With Quote
Old 07-31-2012, 01:48 AM   PM User | #417
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
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 my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 07-31-2012, 02:33 AM   PM User | #418
bbrog
New Coder

 
Join Date: Jun 2012
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
bbrog is an unknown quantity at this point
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.
bbrog is offline   Reply With Quote
Old 07-31-2012, 03:33 AM   PM User | #419
chump2877
Senior Coder

 
chump2877's Avatar
 
Join Date: Dec 2004
Location: the U.S. of freakin' A.
Posts: 2,530
Thanks: 15
Thanked 128 Times in 121 Posts
chump2877 is on a distinguished road
Quote:
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 my YouTube-to-Mp3 Web Conversion Software on Facebook !! :)
chump2877 is offline   Reply With Quote
Old 07-31-2012, 05:02 AM   PM User | #420
bbrog
New Coder

 
Join Date: Jun 2012
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
bbrog is an unknown quantity at this point
Hi, yes all mp3's show up with 0kbps. I used windows 7.

Just sent you the email.

Thanks!
bbrog is offline   Reply With Quote
Reply

Bookmarks

Tags
audio, class, conversion, dailymotion, ffmpeg, mp3, php, script, video, youtube

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:04 PM.


Advertisement
Log in to turn off these ads.