Rendering Video in MVC

Last post 03-19-2008 7:04 PM by csainty. 4 replies.

Sort Posts:

  • Rendering Video in MVC

    03-19-2008, 9:16 AM
    • Member
      12 point Member
    • j.strugnell
    • Member since 05-17-2007, 10:47 AM
    • Posts 9

    Hi guys,

    I'm at a crossroads in a new project where I want to use the new MVC framework but am worried it might slow me down in hitting deadlines. One of the features of the website I'm going to be creating is that of rendering videos (wmv files). Registered users will be uploading these files and will be displayed as part of their profile. If I was using ASP.Net webforms I expect I would use the new Silverlight Media control but I believe that doesn't work with MVC (yet?). Has anyone implemented dynamic video rendering using the MVC framework and if so how?

    Thanks,

    James.

    Filed under:
  • Re: Rendering Video in MVC

    03-19-2008, 10:25 AM

    The theory is that using MVC should be a perfect platform for rapid development of a social application such as you are mentioning, perhaps using LINQ to SQL to create a basic Model of Users, Profiles, Assets/Videos etc. But as it stands at Preview 2 status, you'd have to be confident of your testing to deploy a public busy site using MVC.

    I've embedding Flash video controls for FLV video (I use http://www.afcomponents.com/components/flv_player_as3 control) and scrape a Playlist from a <dl> definition list of HTML elements, titles and links rendered on the page through the MVC framework, using ExtJS to iterate through these HTML elements, and passed to the Flash as an array. Though consuming an RSS feed might be better. And simply creating the Flash control using SWFObject.

    The comparable javascript libraries to SWFObject to embed a Silverlight object are described in articles such as http://msdn2.microsoft.com/en-us/library/cc189089(VS.95).aspx. So I don't think it's particularly that much easier using the Media Controls. Good old inline javascript should be good enough, using these libraries.

    So in some ways I see the Silverlight Media Controls aspect as a little bit of a red herring. I'd suggest it's whether you think the MVC framework can deliver the community and content side of the site, and will be easy for you to develop these forms and personalisation aspects. Then perfecting the javascript.

  • Re: Rendering Video in MVC

    03-19-2008, 1:11 PM
    • Member
      12 point Member
    • j.strugnell
    • Member since 05-17-2007, 10:47 AM
    • Posts 9

    The functionality I need is for users to be able to upload a variety of video formats (wmv, mpg etc.) and for these to all either be converted into a single format (perhaps flash) through .Net code or for a 3rd Party control to be able to render a variety of different formats that work on all browser/platforms. I've not done much work in this area so this may be wishful thinking. I essentially need registered users to be able display a video of their choosing on their profile page. Can the component you mention above do this (rencode any format into flash, on the fly?).

     Thanks.

  • Re: Rendering Video in MVC

    03-19-2008, 2:24 PM

    Multiple video formats and transcoding will be hard! The controls won't really do that.

    Either provide two players on the site - one Silverlight for WMV and one Flash for those converted to flv.

    Perform encoding on your servers, such as with Silverlight Encoder http://www.microsoft.com/expression/products/overview.aspx?key=encoder. Though the hardware budget to make this fast - presumably processing in a queue - could be big.

    Or I'm a fan of putting the encoding headache onto someone else, such as a Content Delivery Network that provides this for you, such as Nirvanix http://www.nirvanix.com/nws.aspx.

    And last but not least use the recently released YouTube APIs, that allow video upload via their REST interface http://code.google.com/apis/youtube/developers_guide_protocol.html#Direct_uploading. I believe they convert the videos for you to FLV.

  • Re: Rendering Video in MVC

    03-19-2008, 7:04 PM
    • Member
      218 point Member
    • csainty
    • Member since 03-11-2008, 10:41 PM
    • Newcastle, Australia
    • Posts 49

    FFMpeg is a popular method of converting uploaded video content. You will either need access to the server to install it, or use a host that provides it (there are a number that do)
    http://ffmpeg.mplayerhq.hu/index.html

    As methioned silverlight and/or flash are easily implemented regardless of MVC or WebForms.
    I prefer silverlight for streaming video because it is easier to secure the content. Flash can't do that (at least not easily)

    The new Expression Media Encoder is probably a better choice than FFMpeg if you are using a server you have control over and can install it. WMV support in FF is a little rough.

Page 1 of 1 (5 items)