Convert to .wmv

6 posts, 0 answers
  1. JOSE
    JOSE avatar
    7 posts
    Member since:
    Jun 2012

    Posted 02 Sep 2013 Link to this post

    We have videos in the database as byte[] and they can be in any format. In order to use RadMediaPlayer, we need to convert them to .wmv or any other compatible format, how can we do that?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Sep 2013 Link to this post

    Hi Jose,

    One option is you can use the byte[] data to directly play the video instead of converting to .wmv format. The RadMediaPlayer is basically a wrapper around the Silverlight's MediaElement control. Therefore RadMediaPlayer supports the same media formats as SIlverlight's MediaElement does. You can find a full list of the supported media formats here. In cases when you want to use a byte stream to set the RadMediaPlayer items, you can set the RadMediaPlayer.MediaElement source as shown in the following sample code.

    C#:
    Stream stream = new MemoryStream(buffer);
    mediaPlayer.MediaElement.SetSource(stream);

    Thanks,
    Shinu.
  3. DevCraft banner
  4. JOSE
    JOSE avatar
    7 posts
    Member since:
    Jun 2012

    Posted 04 Sep 2013 Link to this post

    Hi Shinu,
    I've already tried your solution but it does not work for me because the original video format, that is converted to byte[], was .avi. So I get the following error: "3001 AG_E_INVALID_FILE_FORMAT".
    Is there a way to convert the byte[] to a compatible format?
    Thanks
  5. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 05 Sep 2013 Link to this post

    Hi Jose,

    The following post on Microsoft forums provides good info about the error: http://social.msdn.microsoft.com/Forums/silverlight/en-US/6b1a279e-96e3-43e2-a218-b7f985e9c9de/is-there-any-way-to-get-more-details-of-a-3001-ageinvalidfileformat-error.

    As to the converting media to different format, you could take a look at the following article. I would like to note that this is third party code and media formats conversion is outside the scope of our Silverlight suite.

    Alternative approach would be to store the video directly in the required format, instead converting it later on, should applicable to your case.

    Regards,
    Hristo
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Sep 2013 Link to this post

    Hi Jose,

    One option is transcoding of media files via server side. Expression Encoder has a complete .NET accessible SDK you can use in C# that includes batch transcoding and it supports transcoding from AVI to WMV.

    Thanks,
    Shinu.
  7. Simon
    Simon avatar
    1 posts
    Member since:
    Mar 2014

    Posted 24 Mar 2014 Link to this post

    Hi Jose,

    As we all know, few software supports to convert files to wmv formats. But RedMediaPlayer also supports mp4 formats. So converting your file to mp4 format with some software is your best choice. I recommend Faasoft Video Converter for Windows or Mac. Works like a charm.
Back to Top
DevCraft banner