views:

279

answers:

2

I would like to port an ActiveX of mine (to Silverlight) that have the following features:

  • Embedding a logo image in any video file.
  • Embedding subtitles in any video file.
  • Cropping any video file (for example: cropping 10 seconds of a 1 min. video).
  • Save the video file result (by the current encoders of the client).

The current ActiveX uses DirectShow - unfortunately, it can't be used in Silverlight. How I can abandon the old ActiveX technology for the new Silverlight technology?

+1  A: 

I don't know if that's going to be easily doable. The various codecs natively available to Silverlight are all wrapped by the Silverlight MediaElement control, and so far as I can figure out, they're not directly exposed through an API, e.g., you can't get at the raw decoded RGBA bitstream. (If I'm wrong on this, I'd love to know, but I've poked around, and I can't figure out how to do it.) The Mono source tree has a decode-only implementation of the Dirac codec, but nothing that would easily let you decode, e.g., WMV or AVI files, so far as I'm aware.

And even if you could somehow grab the raw, decoded RGBA (or YCbCr) bitstream, so as to be able to insert whatever data you want into those frames, you'd still have to re-encode the video stream as well, and Silverlight doesn't provide any native support for that. You'd have to write your own encoders (not at all trivial), port them from the ffmpeg library (also not trivial), or wait for someone else to do it.

In short, my suspicion is that you're going to need to stick with your ActiveX solution for now -- though with some clever JavaScript coding, it might be possible to wrap that in a nice Silverlight UI.

Ken Smith
+1  A: 

The simple answer is: you can't.

Silverlight is targeted at two main types of apps:-

  • Content presentation, be that Video, Audio and Images, all with a view of creating interesting and engaging ways to interact with this sort of content.
  • More recently Line of Business apps, that is data entry and data presentation. Again with a view to making this at least a little bit more visually stimulating than prior technologies made these sorts of apps.

Video editing doesn't really fall into either of these camps and is not catered for.

I'm not sure its yet true to say the ActiveX is old, after all what technology is used to host the Silverlight Plugin in Internet Explorer? ActiveX.

AnthonyWJones
I think video editing is possible due to the creation of the following video: http://www.youtube.com/watch?v=My3E58s_Bik
Eran Betzalel
@Eran: The last 20 seconds is very revealing. No actual new video is produced nor is any existing media modified. All its really doing it creating an XML file to define which of the existing media files to play in sequence with some begin and end time offsets within each video. The result is an appearance of a slice and spliced single video but in fact playback requires the entire contents of all the originating media. In my book this is not video editing.
AnthonyWJones