Howto play video with external audio in Silverlight? - silverlight

Is there any proper method to play synchronously video and external audio, other than simply having two MediaElement (one for video source and one for audio) started simultaneously? I need to play video with different soundtracks, but I belive that just two separated MediaElements will be out of sync at some point of time. Maybe there is some way to add audio source to the existing MediaElement with video?
Platform: SL3, but SL4 will be good as well.
Thanks in advance.

This project provides "support for multiple audio tracks" which sounds like it will do what you want: http://smf.codeplex.com/

Related

How to stream videos in WPF?

I want to stream video in a WPF application. There are two potential ways:
Embed VLC. Problem: I know how to embed VLC in a WinForm application but not in a WPF one.
Use MediaElement. Problem: I know how to play a wmv file, but I don't know how to play a stream.
So what can I do to play video streams in WPF?
It's very easy task. You can find out VlcDotnet. it's open source and using the VLC libraries. This is the Github link. It is fit with WPF.
Source File

Video capture using Expression Encoder in WPF

I am need to capture video and click images via camera, in My application. I am a bit new to WPF and searching on google I found that ExpressionEncoder dll is used to perform video captures in WPF. I also need to change brightness, Contrast, saturation of video but I did not find it in expressionencoder code.
So can anyone tell how to set Brightness,contrast,... using ExpressionEncoder Dll Or Do I need to try something else?
Thanks in anticipation.
While you are using encoder dll for recording videos. please find below links.
http://www.codeproject.com/Articles/285964/WPF-Webcam-Control
http://blog.catenalogic.com/post/2009/01/08/WPF-Webcam-Control-part-2.aspx
http://easywebcam.codeplex.com/

Need example of Flex or silverlight application that enables interactive drawing on a video

I am trying to evaluate which technology is best for my needs.
I need to display a video I get from some remote device, and let a user
interactively draw on it lines, polygons etc.
I searched and couldn't find any existing applications with this ability
(all the flash applications only displayed video).
Could anyone point me to such an application?
I haven't seen a specific app that allows you to do that, but I can tell you it would be fairly trivial to build it in Flex. You would simply create a transparent Sprite over the video clip, then use the Drawing API bound to various mouse events to do your drawing.
The final image can be saved by using BitmapData.draw() over the container that holds both the video and the canvas, and you can pass a bytearray encoded as PNG or JPG to a server-side script to save it.
I can't speak to Silverlight as I've never used it - but a Flex dev could build a basic sample of this for you in Flex in about 20 mins just as a proof of concept.
Where does your expertise lie?
Silverlight you could knock up a proof of concept rather easily and as Myk points out you could do the same in Flex. So your best bet is really whichever technology your current expertise lies in.
In Silverlight you could use a InkPresenter control above a MediaElement control in about 2 minutes up and running with a video file.
I think the hard part is finding a way to display realtime video from your specific device.
Silverlight supports streaming video so having that device talk with Windows Media Server or Silverlight Streaming sounds like the best bet.
Julie Lerman wrote an Silverlight app that you can draw on Images:
http://thedatafarm.com/blog/tablet/drawing-in-silverlight-article-in-msdn-magazine/
the article was presented at a magazine:
http://msdn.microsoft.com/en-us/magazine/cc721604.aspx
Hopes this helps.

Issue using WPF MediaElement with HD (H.264, 720P) Video

I am using media element to render video in WPF. All videos are working fine except H.264 videos. They have some stuttering problem while they are rendered on screen. My machine configuration is much more than the recommended requirement to play for this video. Another surprising fact is that the video renders perfectly fine when I play this in Window Media Player or any other player.
Any solution or any alternative to MediaElement?
You can try my MediaUriElement from my open source project here: http://wpfmediakit.codeplex.com
It has better media compatibility than MediaElement, but if it's a decoder filter problem or a performance problem, my project won't be able to help. What h264 codec are you using. You may want to try out ffdshow from http://ffdshow-tryout.sourceforge.net/.
-Jer
WPF does not support H.264 videos

Convert a silverlight application to video format

I'm planning to make an animation with Silverlight, i want to export the animation to a video format, to be able to share it on video sharing website.
How can i do this ?
You could use a tool like Camtasia to record your screen or part of your screen. It then can be exported to a bunch of different video formats.
A pure code approach is to write a sequence of images, and then combine those images together as a video file. Eric Gunnerson has code to capture images from an animation , its WPF but would probably work in Silverlight? Codeproject has an example of converting a stream of images to an AVI video file in C#. It creates an AVI output. It would be great to go straight to mpg, but as it's compressed the input needs to be a video stream. If you do need mpg as the final output look for an off the shelf avi->mpg converter.
BTW - Let me know how you get on, I'm interested in the performance/functionality of this solution.
MrTelly: That approach would not work because Silverlight does not expose the RenderTargetBitmap class. (Well, this is not completely true, the class is there, but its constructor and methods are all marked SecurityCritical and as such are not normally accessible.)
The Camtasia solution proposed by Jakers is likely the simplest solution.
It's nuts that there isn't a simple way to do this in Silverlight, it's easy as pie in flash.

Resources