Wednesday, July 29, 2009

Stream a wmv file

If you upload a .wmv file to a library in SharePoint you will be asked if you want to "Open" or "Save" the file, as usual:


















But if you want the user to be able to stream the file directly, without being presented that message box, then you must perform some more steps. Create a new virtual directory on your SharePoint site inside the IIS (in the inetpub folder, wss, virtual directores, and then the sites folder), I named mine to "Webcasts". Upload the wmv file to that Webcasts directory. Edit the directory security on the Virtual directory to Anonymous so that the user doesn't get a login prompt.

Then create a new file inside the Webcasts-directory with the extension .wvx. This will trigger the wmv file and stream it directly inside Windows Media Player.

Open a text editor, such as Notepad. Type the following metafile script, but replace the URL with that of your file. Reference the audio or video file just as you would any other Web file:



You can place the metafile in the same folder as that of your digital media file. If you do so, you can use a relative path, which is simply the name of the file. The REF line would look like this:

add a href tag with only the filename: yourfile.wmv

Save the text file using the name of your digital media file followed by the .wvx extension if the metafile points to a file with a .wmv extension, or .wax if the metafile points to a file with a .wma extension, such as YourFile.wvx. You can also use the .asx file name extension for either audio or video.

Now, when you add the link to this wvx file by typing http://yoursharepointsite/webcasts/yourfile.wvx then the media file will stream in Media Player.

2 comments:

andy said...

Web casting, or broadcasting over the internet, is a media file (audio-video mostly) distributed over the internet using streaming media technology. Streaming implies media played as a continuous stream and received real time by the browser (end user). Streaming technology enables a single content source to be distributed to many simultaneous viewers. Streaming video bandwidth is typically calculated in gigabytes of data transferred. It is important to estimate how many viewers you can reach, for example in a live webcast, given your bandwidth constraints or conversely, if you are expecting a certain audience size, what bandwidth resources you need to deploy.

To estimate how many viewers you can reach during a webcast, consider some parlance:
One viewer: 1 click of a video player button at one location logged on
One viewer hour: 1 viewer connected for 1 hour
100 viewer hours: 100 viewers connected for 1 hour…

Typically webcasts will be offered at different bit rates or quality levels corresponding to different user’s internet connection speeds. Bit rate implies the rate at which bits (basic data units) are transferred. It denotes how much data is transmitted in a given amount of time. (bps / Kbps / Mbps…). Quality improves as more bits are used for each second of the playback. Video of 3000 Kbps will look better than one of say 1000Kbps. This is just like quality of a image is represented in resolution, for video (or audio) it is measured by the bit rate.

KinemaZOne said...

Sorry, I have one dubt.
What is the difference between use the method described (virtual dir with video files and mediafiles ASX in sharepoint) and to have video files directly in sharepoint?
Performances look like same. The one difference is that with ASX file the URL of original files is hidden (but you can download the ASX file and read inside).