<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Money-Code &#187; youtube</title>
	<atom:link href="http://www.money-code.com/tag/youtube/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.money-code.com</link>
	<description>Coding For Online Success</description>
	<lastBuildDate>Fri, 12 Feb 2010 18:27:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using FFMpeg to create YouTube clone script</title>
		<link>http://www.money-code.com/2007/11/using-ffmpeg-to-create-youtube-clone-script/</link>
		<comments>http://www.money-code.com/2007/11/using-ffmpeg-to-create-youtube-clone-script/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 17:19:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>So this entry, I'm going to get a bit complicated. I was working on a project where administrators needed to upload Windows Media formatted videos (WMV), and wanted them converted to Flash video (FLV). This would duplicate what YouTube or GoogleVideo is currently doing. The browser would then use a Flash player to play the streamed videos. Also, I would need to capture a frame for the preview.  I thought this tutorial might be a good resource for others that might be looking for this functionality for their affiliate sites, etc.

<p>Now, I must discuss my environment a bit. This tutorial will cover Linux (specifically Gentoo Linux), using PHP and a Apache web server. Also, you will need some vital packages (<a href="http://ffmpeg-php.sourceforge.net/index.php" target="_blank">ffmpeg-php</a>, <a href="http://ffmpeg.mplayerhq.hu/" target="_blank">ffmpeg</a> and <a href="http://www.inlet-media.de/flvtool2/" target="_blank">flvtool2</a>). I'm guessing that a few web hosts our there won't have any of these packages available. This where the argument of getting a dedicated server or virtual server shines. If you had your own server you could install and configure it whatever way you want. I personally prefer dedicated servers. You can pickup dedicated hosting for approximately $100-$300/month depending on what server specifications you're looking for. All of my servers are around the $150/month rate and work great for me.



Related posts:<ol><li><a href='http://www.money-code.com/2007/11/dynamically-create-ebay-widgets-from-existing-rover-code/' rel='bookmark' title='Permanent Link: Dynamically create eBay widgets from existing rover code'>Dynamically create eBay widgets from existing rover code</a></li>
<li><a href='http://www.money-code.com/2007/10/monetizing-your-site-with-google-video-units-adsense/' rel='bookmark' title='Permanent Link: Monetizing your site with Google Video Units (AdSense)'>Monetizing your site with Google Video Units (AdSense)</a></li>
<li><a href='http://www.money-code.com/2007/10/cj-quick-stat-email-script/' rel='bookmark' title='Permanent Link: CJ Quick Stat Email Script'>CJ Quick Stat Email Script</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2007%2F11%2Fusing-ffmpeg-to-create-youtube-clone-script%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2007%2F11%2Fusing-ffmpeg-to-create-youtube-clone-script%2F" height="61" width="51" /></a></div><p>So this entry, I&#8217;m going to get a bit complicated. I was working on a project where administrators needed to upload Windows Media formatted videos (WMV), and wanted them converted to Flash video (FLV). This would duplicate what YouTube or GoogleVideo is currently doing. The browser would then use a Flash player to play the streamed videos. Also, I would need to capture a frame for the preview.  I thought this tutorial might be a good resource for others that might be looking for this functionality for their affiliate sites, etc.</p>
<p>Now, I must discuss my environment a bit. This tutorial will cover Linux (specifically Gentoo Linux), using PHP and a Apache web server. Also, you will need some vital packages (<a href="http://ffmpeg-php.sourceforge.net/index.php" target="_blank">ffmpeg-php</a>, <a href="http://ffmpeg.mplayerhq.hu/" target="_blank">ffmpeg</a> and <a href="http://www.inlet-media.de/flvtool2/" target="_blank">flvtool2</a>). I&#8217;m guessing that a few web hosts our there won&#8217;t have any of these packages available. This where the argument of getting a dedicated server or virtual server shines. If you had your own server you could install and configure it whatever way you want. I personally prefer dedicated servers. You can pickup dedicated hosting for approximately $100-$300/month depending on what server specifications you&#8217;re looking for. All of my servers are around the $150/month rate and work great for me.<br />
<!--break--></p>
<p><strong>ffmpeg-php</strong> is a fantastic PHP extension, that ties into ffmpeg and can return fantastic and incredibly useful information of a raw video file (such as frame rate, bitrate and can also grab a GD image handle of a frame in the video).</p>
<p><strong>ffmpeg</strong> is a audio/video converter (make sure it&#8217;s compiled with amr, encode, ogg, oss, sdl, truetype, vorbis, zlib).</p>
<p><strong>flvtool2</strong> is a manipulation tool for Flash Video files, but we need to use it to embed META data extracted from our WMV file.</p>
<p>You&#8217;ll also need to be sure that PHP is compiled with GD support.</p>
<p>I&#8217;m going to skip the upload piece to the server. If you need more information on how to get the source WMV file to the server, let me know.</p>
<p>Here is the main chunk of code to worry about. I&#8217;ll explain this after the code snippet.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="kw2">function</span> makeMultipleTwo <span class="br0">&#40;</span><span class="re0">$value</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$sType</span> = <a href="http://www.php.net/gettype"><span class="kw3">gettype</span></a><span class="br0">&#40;</span><span class="re0">$value</span>/<span class="nu0">2</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$sType</span> == <span class="st0">&quot;integer&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$value</span>;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#40;</span><span class="re0">$value</span><span class="nu0">-1</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<span class="re0">$flvtool2</span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;/usr/bin/flvtool2&quot;</span>;<br />
<span class="re0">$ffmpeg</span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;/usr/bin/ffmpeg&quot;</span>;<br />
<span class="re0">$FileName</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/escapeshellcmd"><span class="kw3">escapeshellcmd</span></a><span class="br0">&#40;</span><span class="re0">$FileName</span><span class="br0">&#41;</span>;<br />
<span class="re0">$justName</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st0">&quot;.&quot;</span>,<span class="re0">$FileName</span><span class="br0">&#41;</span>;<br />
<span class="re0">$wmvName</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;/path/to/videos/&quot;</span>.<span class="re0">$FileName</span><br />
<span class="re0">$flvPath</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;/path/to/videos/&quot;</span>.<span class="re0">$flvName</span>;<br />
<span class="re0">$ffmpegObj</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="kw2">new</span> ffmpeg_movie<span class="br0">&#40;</span><span class="re0">$wmvName</span><span class="br0">&#41;</span>;<br />
<span class="re0">$srcWidth</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = makeMultipleTwo<span class="br0">&#40;</span><span class="re0">$ffmpegObj</span>-&gt;<span class="me1">getFrameWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$srcHeight</span> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = makeMultipleTwo<span class="br0">&#40;</span><span class="re0">$ffmpegObj</span>-&gt;<span class="me1">getFrameHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$srcFPS</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$ffmpegObj</span>-&gt;<span class="me1">getFrameRate</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$srcAB</span> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <a href="http://www.php.net/intval"><span class="kw3">intval</span></a><span class="br0">&#40;</span><span class="re0">$ffmpegObj</span>-&gt;<span class="me1">getAudioBitRate</span><span class="br0">&#40;</span><span class="br0">&#41;</span>/<span class="nu0">1000</span><span class="br0">&#41;</span>;<br />
<span class="re0">$srcAR</span> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$ffmpegObj</span>-&gt;<span class="me1">getAudioSampleRate</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$frameSnap</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$ffmpegObj</span>-&gt;<span class="me1">getFrame</span><span class="br0">&#40;</span><span class="nu0">3</span><span class="br0">&#41;</span>;<br />
<span class="re0">$snapWidth</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$frameSnap</span>-&gt;<span class="me1">getWidth</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$snapHeight</span>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$frameSnap</span>-&gt;<span class="me1">getHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$imageSnap</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$frameSnap</span>-&gt;<span class="me1">toGDImage</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$thumbname</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$justName</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>.<span class="st0">&quot;.jpg&quot;</span>; <span class="co1">// just get the first part of the name</span><br />
<span class="re0">$imagePath</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="st0">&quot;/path/to/videos/&quot;</span>.<span class="re0">$thumbname</span>;<br />
imagejpeg<span class="br0">&#40;</span><span class="re0">$imageSnap</span>, <span class="re0">$imagePath</span>, <span class="nu0">100</span><span class="br0">&#41;</span>;<br />
<span class="re0">$cmd</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$ffmpeg</span> . <span class="st0">&quot; -i &quot;</span> . <span class="re0">$wmvName</span> . <span class="st0">&quot; -ar &quot;</span> . <span class="re0">$srcAR</span> . <span class="st0">&quot; -ab &quot;</span> . <span class="re0">$srcAB</span> . <span class="st0">&quot; -acodec mp3 -f flv -deinterlace -nr 500 -s 320&#215;240 -aspect 4:3 -r &quot;</span>.<span class="re0">$srcFPS</span>.<span class="st0">&quot; -b 270k -me_range &quot;</span>.<span class="re0">$srcFPS</span>.<span class="st0">&quot; -i_qfactor 0.71 -g 500 &quot;</span> . <span class="re0">$flvPath</span> . <span class="st0">&quot; | &quot;</span> . <span class="re0">$flvtool2</span> . <span class="st0">&quot; -U stdin &quot;</span> . <span class="re0">$flvPath</span>;<br />
<a href="http://www.php.net/exec"><span class="kw3">exec</span></a><span class="br0">&#40;</span><span class="re0">$cmd</span>, <span class="re0">$errArr</span><span class="br0">&#41;</span>;<br />
<a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$justName</span><span class="br0">&#41;</span>;<br />
imagedestroy<span class="br0">&#40;</span><span class="re0">$imageSnap</span><span class="br0">&#41;</span>;<br />
<a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$frameSnap</span><span class="br0">&#41;</span>;<br />
<a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$ffmpegObj</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>$ffmpegObj is a object we&#8217;re creating from ffmpeg-php. Here we pass the path to where our original source WMV file is. ffmpeg-php then analyzes the file and we have various methods to extract information. The makeMultipleTwo function is there, since the width and height has to be a multiple of two (this was discussed at a great resource <a href="http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/" target="_blank" rel="nofollow">here</a>). Along with the width and height information, we wan thte frame rate, audio sample rate and audio bit rate. Those are found by using the following methods (getFrameRate(), getAudioBitRate() and getAudioSampleRate()).</p>
<p>Next use the getFrame() method, which will grab a frame snap from the video. In this example, we&#8217;re grabbing the 3rd frame. This also returns a new object which we&#8217;re calling $frameSnap. We can access various methods within this new object (getWidth() which is the width of the image, getHeight() which is the height of the image, and toGDImage() which will return us a GD handle for the image). Once we have the GD handle for the image, we can simply write the image to the file system with imagejpeg() which is a method in the GD library.</p>
<p>At this point we have information about the WMV file and a frame snap for the preview image. We need to to convert the file to FLV now. Our next step is to create a command string which we&#8217;ll need to execute.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="re0">$cmd</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span class="re0">$ffmpeg</span> . <span class="st0">&quot; -i &quot;</span> . <span class="re0">$wmvName</span> . <span class="st0">&quot; -ar &quot;</span> . <span class="re0">$srcAR</span> . <span class="st0">&quot; -ab &quot;</span> . <span class="re0">$srcAB</span> . <span class="st0">&quot; -acodec mp3 -f flv -deinterlace -nr 500 -s 320&#215;240 -aspect 4:3 -r &quot;</span>.<span class="re0">$srcFPS</span>.<span class="st0">&quot; -b 270k -me_range &quot;</span>.<span class="re0">$srcFPS</span>.<span class="st0">&quot; -i_qfactor 0.71 -g 500 &quot;</span> . <span class="re0">$flvPath</span> . <span class="st0">&quot; | &quot;</span> . <span class="re0">$flvtool2</span> . <span class="st0">&quot; -U stdin &quot;</span> . <span class="re0">$flvPath</span>;<br />
<a href="http://www.php.net/exec"><span class="kw3">exec</span></a><span class="br0">&#40;</span><span class="re0">$cmd</span>, <span class="re0">$errArr</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>This converts the file to FLV, but also &#8216;pipes&#8217; the output to FLVtool2 with the &#8216;|&#8217;. ffmpeg converts the file, but then we use flvtool2 to overwrite the file, but add important META information for FLV.</p>
<p>If your PHP environment is in safe_mode you will run into a problem with the &#8216;|&#8217; in the command string. Since safe_mode runs all commands through escapeshellcmd() which will try to escape that character. To get around this is semi-tough if you do not have shell access to the server. I run safe_mode on my servers, so what I did was create a bash script with the command string in it, and passed values via exec() to my bash script. The &#8216;|&#8217; pipe command is in the bash script, so it was not being escaped by PHP. Any time you&#8217;re dealing with exec() and shell scripts, it&#8217;s incredibly important to check and sanitize user input!!!!!</p>
<p>This is a tricky project, but can be quite cool when you get it working. The next piece is to get a flash player to play your FLV file. I personnally like this one:</p>
<p>http://www.jeroenwijering.com/?item=JW_FLV_Player</p>
<div class="dean_ch" style="white-space: wrap;">
&lt;div align=<span class="st0">&quot;center&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script type=<span class="st0">&quot;text/javascript&quot;</span> src=<span class="st0">&quot;lib/swfobject.js&quot;</span>&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;p id=<span class="st0">&quot;player1&quot;</span> style=<span class="st0">&quot;padding:4px 4px 4px 4px;&nbsp;border:#999999 1px solid; width:323px;&quot;</span>&gt;&lt;br&gt;&lt;strong&gt;ERROR&lt;/strong&gt;&lt;br&gt;Looks like you <span class="kw1">do</span> not have the Flash plugin installed, or you are using a older version <span class="br0">&#40;</span><span class="nu0">7</span> is the minimum required<span class="br0">&#41;</span>&lt;br&gt;&lt;a href=<span class="st0">&quot;http://www.macromedia.com/go/getflashplayer&quot;</span>&gt;&lt;u&gt;Get the Flash Player&lt;/u&gt;&lt;/a&gt; to see this player/movie.&lt;br&gt;&lt;br&gt;&lt;/p&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script type=<span class="st0">&quot;text/javascript&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> s0 = <span class="kw2">new</span> SWFObject<span class="br0">&#40;</span><span class="st0">&quot;lib/flvplayer.swf&quot;</span>,<span class="st0">&quot;single&quot;</span>,<span class="st0">&quot;323&quot;</span>,<span class="st0">&quot;263&quot;</span>,<span class="st0">&quot;7&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addParam<span class="br0">&#40;</span><span class="st0">&quot;allowfullscreen&quot;</span>,<span class="st0">&quot;true&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&quot;showdownload&quot;</span>,<span class="st0">&quot;true&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&quot;link&quot;</span>,<span class="st0">&quot;&lt;?=$webroot?&gt;/videos/&lt;?=$FLVName?&gt;&quot;</span><span class="br0">&#41;</span>; <span class="co1">// wmv might be an option</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&quot;file&quot;</span>,<span class="st0">&quot;&lt;?=$webroot?&gt;/videos/&lt;?=$FLVName?&gt;&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&quot;image&quot;</span>,<span class="st0">&quot;&lt;?=$webroot?&gt;/videos/&lt;?=$ThumbName?&gt;&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&quot;smoothing&quot;</span>,<span class="st0">&quot;false&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&quot;backcolor&quot;</span>,<span class="st0">&quot;0xFFFFFF&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&quot;largecontrols&quot;</span>,<span class="st0">&quot;false&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&#8216;width&#8217;</span>,<span class="st0">&#8216;323&#8242;</span><span class="br0">&#41;</span>;&nbsp; <span class="co1">// reset width/height for IE issues and cache/refresh</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.addVariable<span class="br0">&#40;</span><span class="st0">&#8216;height&#8217;</span>,<span class="st0">&#8216;263&#8242;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s0.write<span class="br0">&#40;</span><span class="st0">&quot;player1&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">&lt;/script&gt;</span><br />
&lt;/div&gt;<br />
&nbsp;</div>
<p><strong style="color: red">UPDATE &#8211; 1/2/2009</strong></p>
<p>I found this hosting company that offers and promotes <a href="http://www.money-code.com/target/flvhosting.php" target="_blank" rel="nofollow">FLV hosting</a>. Could be a very good solution for some of you! Hope this helps!</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="468" height="60"><param name="movie" target="_blank" value="http://www.flvhosting.com/af/banners/468x60_banner.swf?actionURL=http://www.flvhosting.com/af/idevaffiliate.php?id=499_0_1_3"><param name=quality value=high><embed src="http://www.flvhosting.com/af/banners/468x60_banner.swf?actionURL=http://www.flvhosting.com/af/idevaffiliate.php?id=499_0_1_3" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60"></embed></object></p>


<p>Related posts:<ol><li><a href='http://www.money-code.com/2007/11/dynamically-create-ebay-widgets-from-existing-rover-code/' rel='bookmark' title='Permanent Link: Dynamically create eBay widgets from existing rover code'>Dynamically create eBay widgets from existing rover code</a></li>
<li><a href='http://www.money-code.com/2007/10/monetizing-your-site-with-google-video-units-adsense/' rel='bookmark' title='Permanent Link: Monetizing your site with Google Video Units (AdSense)'>Monetizing your site with Google Video Units (AdSense)</a></li>
<li><a href='http://www.money-code.com/2007/10/cj-quick-stat-email-script/' rel='bookmark' title='Permanent Link: CJ Quick Stat Email Script'>CJ Quick Stat Email Script</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2007/11/using-ffmpeg-to-create-youtube-clone-script/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Monetizing your site with Google Video Units (AdSense)</title>
		<link>http://www.money-code.com/2007/10/monetizing-your-site-with-google-video-units-adsense/</link>
		<comments>http://www.money-code.com/2007/10/monetizing-your-site-with-google-video-units-adsense/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 17:08:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Affiliate Marketing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Here is a great new way to monetize your site with video units from YouTube, and is available via Google AdSense Set Up! Set up was incredibily easy, just log into your AdSense account and click AdSense Setup. From there, you'll see a new item called 'Video Units'. From there you'll need to agree to the terms and 'merge' your AdSense and YouTube accounts. You must first have a YouTube account and allow the 'merge' via email confirmations. After you've completed that step, you'll be able to adjust themes, format and content of types of videos to play. I'll be testing this out over the next few months. They're only offering 3 types of player layouts (400x415, 500x510 and 780x560).. hopefully more will be available.

<div align="center">
<p align="center"><div id='_ytplayer_vjVQa1PpcFMlI4TMcTGMovVeDHGZeIihCOPH3moIepg='><a href='http://www.youtube.com/browse'>Watch the latest videos on YouTube.com</a></div><script type='text/javascript' src='http://www.youtube.com/cp/vjVQa1PpcFMlI4TMcTGMovVeDHGZeIihCOPH3moIepg='></script>
</div>
<br /><br />



Related posts:<ol><li><a href='http://www.money-code.com/2007/11/google-adsense-how-to-randomize-theme/' rel='bookmark' title='Permanent Link: Google Adsense &#8211; How to randomize theme'>Google Adsense &#8211; How to randomize theme</a></li>
<li><a href='http://www.money-code.com/2007/09/commission-junction-banners-or-google-adsense/' rel='bookmark' title='Permanent Link: Commission Junction, Banners or Google AdSense?'>Commission Junction, Banners or Google AdSense?</a></li>
<li><a href='http://www.money-code.com/2007/11/shoemoneys-google-adsense-check/' rel='bookmark' title='Permanent Link: Shoemoney&#8217;s Google Adsense Check'>Shoemoney&#8217;s Google Adsense Check</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.money-code.com%2F2007%2F10%2Fmonetizing-your-site-with-google-video-units-adsense%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.money-code.com%2F2007%2F10%2Fmonetizing-your-site-with-google-video-units-adsense%2F" height="61" width="51" /></a></div><p>Here is a great new way to monetize your site with video units from YouTube, and is available via Google AdSense Set Up! Set up was incredibily easy, just log into your AdSense account and click AdSense Setup. From there, you&#8217;ll see a new item called &#8216;Video Units&#8217;. From there you&#8217;ll need to agree to the terms and &#8216;merge&#8217; your AdSense and YouTube accounts. You must first have a YouTube account and allow the &#8216;merge&#8217; via email confirmations. After you&#8217;ve completed that step, you&#8217;ll be able to adjust themes, format and content of types of videos to play. I&#8217;ll be testing this out over the next few months. They&#8217;re only offering 3 types of player layouts (400&#215;415, 500&#215;510 and 780&#215;560).. hopefully more will be available.</p>
<div align="center">
<p align="center">
<div id='_ytplayer_vjVQa1PpcFMlI4TMcTGMovVeDHGZeIihCOPH3moIepg='><a href='http://www.youtube.com/browse'>Watch the latest videos on YouTube.com</a></div>
<p><script type='text/javascript' src='http://www.youtube.com/cp/vjVQa1PpcFMlI4TMcTGMovVeDHGZeIihCOPH3moIepg='></script>
</div>
<p><!--break--></p>


<p>Related posts:<ol><li><a href='http://www.money-code.com/2007/11/google-adsense-how-to-randomize-theme/' rel='bookmark' title='Permanent Link: Google Adsense &#8211; How to randomize theme'>Google Adsense &#8211; How to randomize theme</a></li>
<li><a href='http://www.money-code.com/2007/09/commission-junction-banners-or-google-adsense/' rel='bookmark' title='Permanent Link: Commission Junction, Banners or Google AdSense?'>Commission Junction, Banners or Google AdSense?</a></li>
<li><a href='http://www.money-code.com/2007/11/shoemoneys-google-adsense-check/' rel='bookmark' title='Permanent Link: Shoemoney&#8217;s Google Adsense Check'>Shoemoney&#8217;s Google Adsense Check</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.money-code.com/2007/10/monetizing-your-site-with-google-video-units-adsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->