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-03-2012, 05:18 AM   PM User | #376
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 how much cpu and memory this script uses? Does it use a good amount?
Given the server specs that you provided, I've seen this script work fine on a less powerful server. But I've also never actually quantified the amount of cpu and memory required based on X number of downloads/conversions in a day.

And if you are running this script on a shared server, then those server specs are relatively meaningless. Because processing power and memory are being divvied up by multiple web sites, and if one or more web sites uses a lot of either, then the performance of your site will suffer.

If I were you, I would go with a dedicated server or VPS. You can start with a relatively modest server (in terms of cpu, memory, and bandwidth), and then upgrade to something more powerful as the need arises (when your site becomes more popular). If you are with a web hosting company, they make this pretty easy for you.

Finally, you shouldn't forget about bandwidth -- specifically the speed in which your server connects to and downloads from YouTube. I'd say you'll want at least 100 mbps download speed on your server. And be careful: Many web hosting companies advertise 100 mbps or more, but their server download speeds are not close to that (in my experience). So you may have to wrestle with your hosting company to ensure that their product performs as advertised.
__________________
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-07-2012, 12:35 AM   PM User | #377
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, I am now getting this message

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@site.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
bbrog is offline   Reply With Quote
Old 07-07-2012, 02:46 AM   PM User | #378
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
fixed the previous problem now when i try to download it never gets past downloading video
bbrog is offline   Reply With Quote
Old 07-07-2012, 03:35 AM   PM User | #379
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
ok got the download part to work now the converting is not working below is my output (EDIT: When trying to convert it just doesent do anything)

Code:
ffmpeg version 0.11.1-syslint Copyright (c) 2000-2012 the FFmpeg developers
  built on Jul  6 2012 23:30:51 with gcc 4.1.2 20080704 (Red Hat 4.1.2-52)
  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
  WARNING: library configuration mismatch
  avutil      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
  avcodec     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
  avformat    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
  avdevice    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. 54.100 / 51. 64.100
  libavcodec     54. 23.100 / 54. 33.100
  libavformat    54.  6.100 / 54. 15.100
  libavdevice    54.  0.100 / 54.  1.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'videos/1341632749_4ff7b0ed8c0e53.57108456.flv':
  Duration: 00:04:39.48, start: 0.000000, bitrate: 4993 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p, 1920x1080, SAR 1:1 DAR 16:9, 1k fps, 1k tbr, 1k tbn, 1k tbc (default)
    Stream #0:1: Audio: vorbis, 44100 Hz, stereo, s16 (default)
[buffer @ 0x14a9c700] w:1920 h:1080 pixfmt:yuv420p tb:1/1000 sar:1/1 sws_param:flags=2
[buffersink @ 0x14a9cf60] No opaque field provided
[format @ 0x14ab9680] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'format'
[scale @ 0x14abab00] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1920 h:1080 fmt:rgb24 sar:1/1 flags:0x4
Output #0, mp3, to 'mp3/Maroon_5_-_Payphone_Explicit_ft_Wiz_Khalifa.mp3':
  Metadata:
    TSSE            : Lavf54.15.100
    Stream #0:0(eng): Video: png, rgb24, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 1k tbc (default)
    Stream #0:1: Audio: mp3, 44100 Hz, stereo, s16, 262 kb/s (default)
Stream mapping:
  Stream #0:0 -> #0:0 (vp8 -> png)
  Stream #0:1 -> #0:1 (vorbis -> libmp3lame)
Press [q] to stop, [?] for help
[mp3 @ 0x14ab7a20] Got more than one picture in stream 0, ignoring.
frame=   43 fps=8.5 q=0.0 size=       8kB time=00:00:00.04 bitrate=1618.0kbits/s dup=41 drop=0    
frame=   84 fps=8.3 q=0.0 size=      10kB time=00:00:00.08 bitrate= 987.5kbits/s dup=81 drop=0    
frame=  126 fps=6.7 q=0.0 size=      11kB time=00:00:00.12 bitrate= 711.4kbits/s dup=122 drop=0

Last edited by bbrog; 07-07-2012 at 06:14 AM..
bbrog is offline   Reply With Quote
Old 07-07-2012, 06:37 AM   PM User | #380
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
bbrog, you're still not using a stable version of ffmpeg: http://www.codingforums.com/showpost...&postcount=357
__________________
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-07-2012, 06:54 AM   PM User | #381
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, latest stable version is Stable release 0.11.1 (June 7, 2012; 29 days ago

That is the one im using

The message you see built on Jul 6 2012 23:30:51 is when i built the ffmpeg on my server.

Let me know thanks!
bbrog is offline   Reply With Quote
Old 07-07-2012, 06:17 PM   PM User | #382
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, latest stable version is Stable release 0.11.1 (June 7, 2012; 29 days ago

That is the one im using

The message you see built on Jul 6 2012 23:30:51 is when i built the ffmpeg on my server.

Let me know thanks!
I updated all packages in my installation of Ubuntu 11.10 (just to be sure), and I am not having any problems converting videos with ffmpeg.

My ffmpeg log file header looks like so:

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
Information about that package version is located here: http://packages.ubuntu.com/oneiric/ffmpeg

I do not build/compile ffmpeg from the source myself. I get the latest stable version of ffmpeg via "apt-get install" on Ubuntu.
__________________
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-09-2012, 05:59 AM   PM User | #383
annejefferson
New to the CF scene

 
Join Date: Jul 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
annejefferson is an unknown quantity at this point
Hello chump2877. I'm new to this forum and I'm quite happy to see brilliant people in a specific forum. If you don't mind will you share with me what kind of script does this site xenra[.]com use? It looks really clean and stable.

Since I'm with the cool coders in here, I hope you guys don't mind if I'm asking this question. I really want to know what script does this site busuk[.]org use? Sorry if I'm a bit off topic.

Really want to know this and I'm happy if I can get both script for free. Please help. Thanks in advance.





*please delete [ and ] thank you.
annejefferson is offline   Reply With Quote
Old 07-09-2012, 06:49 AM   PM User | #384
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 annejefferson View Post
Hello chump2877. I'm new to this forum and I'm quite happy to see brilliant people in a specific forum. If you don't mind will you share with me what kind of script does this site xenra[.]com use? It looks really clean and stable.

Since I'm with the cool coders in here, I hope you guys don't mind if I'm asking this question. I really want to know what script does this site busuk[.]org use? Sorry if I'm a bit off topic.

Really want to know this and I'm happy if I can get both script for free. Please help. Thanks in advance.

*please delete [ and ] thank you.
Hi there. xenra.com appears to be pretty similar to the paid-for version of my script (with some additional customization to, for example, accommodate the extra file types, editing ID3 tags, and some additional audio-level controls). All of these customizations are easily added to my script. And contrary to xenra.com, my script converts ringtones directly on site instead of forwarding user to another site. In any event, it looks like the site is also using FFmpeg conversion of videos to generate their files.

The second site, busuk.org, doesn't appear to be a conversion site? But they do appear to be using the YouTube API to index, search, and display YouTube videos.

I already offer a free version of my script here. It does just the basics of converting a YouTube video to mp3 format.

Example implementations of the YouTube API can be found here.

I have experience using the YouTube API, but I don't have any of my own code snippets for you offhand here, at the moment...I might post an example implementation of the YouTube API later, if it would help...I have leveraged the YouTube API in the past to add a search feature to my existing app -- so a person enters a search term or valid YouTube URL, and a list of results comes up from YouTube. Then a person can convert any of the search results to mp3 format. See the mp3ify.com site for an example of this functionality.
__________________
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-09-2012, 07:25 AM   PM User | #385
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, and what php version are you running? I am running PHP version 5.3.8
bbrog is offline   Reply With Quote
Old 07-09-2012, 08:18 AM   PM User | #386
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, and what php version are you running? I am running php version 5.3.8
5.3.6, but the PHP version should not be an issue...
__________________
Regards, R.J.

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

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

Last edited by chump2877; 07-09-2012 at 08:20 AM..
chump2877 is offline   Reply With Quote
Old 07-10-2012, 06:37 AM   PM User | #387
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, switched to a ubuntu server

So for installing ffmpeg and codecs this command should be enough sudo apt-get install ffmpeg ?

Is there anything else that we will need to do? Any other commands you can point me to would be great.

Thanks!
bbrog is offline   Reply With Quote
Old 07-10-2012, 09:10 AM   PM User | #388
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, switched to a ubuntu server

So for installing ffmpeg and codecs this command should be enough sudo apt-get install ffmpeg ?

Is there anything else that we will need to do? Any other commands you can point me to would be great.

Thanks!
For installing FFmpeg capability and codecs:

Code:
sudo apt-get install ubuntu-restricted-extras  [gives you the codecs]
sudo apt-get install ffmpeg  [gives you ffmpeg]
sudo apt-get install php5-ffmpeg  [gives you the ffmpeg-php PHP extension]
Then you need to add the following line:

Code:
extension=ffmpeg.so
...to the server's php.ini, and finally restart apache....
__________________
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-10-2012, 08:45 PM   PM User | #389
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, great!

Now when i download a video it works fine and it converts it to mp3 but however the download progress bar works fine but once we get to the conversion progress bar it does not do anything.

The mp3 is converted perfectly in the backend though as I can see it in the mp3 folder.
bbrog is offline   Reply With Quote
Old 07-10-2012, 10:16 PM   PM User | #390
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
Finally got the script working

Thanks for the great help!!!!!
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 11:13 AM.


Advertisement
Log in to turn off these ads.