Again, You Tube Clone So Simple
YouTubeMy buddy needed to clone YouTube and asked for the the code. Yea, CodeShare !
So now presented in the glory of InstantSpots OVER THE TOP COOL CODESHARE :
Gonna need these applications:
http://ffmpeg.mplayerhq.hu/download.html
http://flowplayer.sourceforge.net/download.html
InstantSpot , this site ROCKS!
Funny video : http://www.youtube.com/watch?v=PzKGyLh_aIA
Coldfuions YouTube Clone - Super Easy
YouTube, ColdFusionI wanted to make a posting solution for my company. Needed to have a YouTube capabilbility. Could have used YouTube, but I didn’t want a YouTube bug on stuff clients were going to view.
I could not believe how TOTALLY easy this was with ColdFusion.
You need 2 things.
- FFMPEG, this INCREADABLE open source project is a headless application that can accept about 32 different type of video files and can convert them to Flash .flv format
- FlowPlayer, this great open source project is what I use as the player for the .flv. It is cool cause it streams the .flv with out having to “compile” with Flash 8. You just pass it the .flv name and your all set.
Here is my example using the form and action page example:
This could be your form uploadVideo_dsp.cmf:
<!--- start --->
<cfset myself = viewState.getValue("myself") />
<h1>Upload Video</h1>
<form action="uploadVideo_act.cfm" method="post" enctype="multipart/form-data">
<table>
<tr valign="top">
<td align="right">Video:</td>
<td><input type="file" name="video"></td>
</tr>
<tr valign="top">
<td></td>
<td><input type="submit" Value="upload"/> </td>
</tr>
</table>
</form>
<!--- end --->
This would be the uploadVideo_act.cfm code:
<!--- start --->
<cffile
action="upload"
destination = "C:\_FULL_SYSETM_PATH_TO_YOUR_VIDEO_DIR\video\video" nameconflict="overwrite"
filefield="video" />
<!--- convert the video with FFMPEG --->
<cfexecute name = "C:\_FULL_SYSETM_PATH_TO_YOUR_FFMPEG.EXE_APP\ffmpeg.exe" arguments = "-i C:\_FULL_SYSETM_PATH_TO_YOUR_VIDEO_DIR\video\#cffile.SERVERFILE# -s 320x240 -r 15 -b 2000 -ar 44100 -ab 64 -ac 2 C:\_FULL_SYSETM_PATH_TO_YOUR_VIDEO_DIR\video\#replace(cffile.SERVERFILE, ".", "")#.flv"
outputFile = "C:\"
timeout = "900">
</cfexecute>
<cfset videoName = "#replace(cffile.SERVERFILE, ".", "")#.flv">
<!--- insert the name of the file into your database --->
<!--- end --->
Then the display page for the video:
<!--- start --->
<!--- get the name of the video from the database, query or something --->
<cfset videoName = query.videoName_YouJustGotFromTheDataBase />
<object type="application/x-shockwave-flash" data="/views/video/FlowPlayer.swf" width="320" height="263" id="FlowPlayer">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="/views/video/FlowPlayer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noScale" />
<param name="wmode" value="transparent" />
<param name="flashvars" value="videoFile=../../video/#videoName#" />
</object>
<!--- end --->
How cool is ColdFusion? Really cool, again some non-programmer like myself can make a youTube clone.
I LOVE CF.





Loading....