Silverlight MJPEG viewer - silverlight

I would like to consume a Motion Jpeg stream from an IP camera and ideally view it using the media element. I was hoping to find some ready made samples.

There is a really nice example (and controls to download) from channel9. Check visit here
Unfortunately the provided dll is out of browser only which I suspect will be a bit of a downer.

Without the use of native dlls, transcoding the meterial on the fly on your server is probably your best - if not only - option.

Related

Run MPEG Dash bitrate adaptive streaming on WPF

I've develop an html5 video player with dash.js that plays streaming mpeg dash content. It works great.
Now I have a requirement to run the same on WPF. using an webbrowser to run my already developed html5 sounds very dirty but I can't figure what I can use to make streaming work.
any tips?
There exists no DASH player library for WPF that I am aware of.
#Sander is right, there doesn't appear to be a WPF or C# Dash implementation at this point.
Microsoft's documentation on building a player suggests using dash.js
I'm also not an expert with WPF and have no experience playing video of any kind within WPF. That said I assume you should be able to do something similar to the way dash.js works with the HTML5 Video element. This would require you to do a number of different tasks like parse the MPD file format, and download the required segment(s).
The simplest implementation of this would be simply parsing the MPD and finding one specific bitrate / resolution BaseURL and passing those values to a WPF element that can handle playing mp4 files. However to really get the benefits of DASH you would need to fully parse the MPD file and implement logic around bitrate switching, etc.

How to perform video editing with Silverlight?

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?
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.
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.

How do I play movies in a C# WinForm application

I am trying to play a movie (wmv,avi,mpg,etc.) in a winforms application. I would like the user to be able to start, stop and pause.
I'm not looking for a full answer ... I just need pointed in the right direction. I've already did some searching on google but could not find anything useful. I can continue searching but I know the stackoverflow community rocks.
So, please point me in the right direction!
Thanks.
I think this is probably the path of least resistance:
http://msdn.microsoft.com/en-us/library/bb383953.aspx
You could use Windows Media Player ActiveX control.
You could also embed a WPF control that contains a MediaElement control.
Another alternative is to use the VLC library instead of Windows Media Player. The VLC Forums have a number of wrappers that can be used in C#.
I have not done a comparison of VLC versus Windows Media Player, but it is alot less resource intensive then the WPF media elements.
If I remember correctly VLC also has built in support for alot of video formats, potentially making it a better choice I guess.
One possibility is to use the Forms.WebBrowser class. This will give you an embedded web browser so you can install what ever player and plugins you need.
It depends on how complicated you want to get, but I've had luck implementing DirectShow before. It's definitely more complicated than a drop on control, but it's really flexible for different formats and loading codecs.

Realtime 1394 firewire video in a WPF app via directx or other method

Are there any controls that anyone is aware of that I can use to stream firewire video into a WPF app. I do not need camera control or capture just the video. I need WPF hosting because I'll be adding WPF content on top.
I was hoping that with the addition of having direct X surfaces in WPF something like this might appear.
Ideally looking for something relatively high level (not a direct show guy at all).
Thanks,
Brian
There are a couple really good video rendering packages for WPF. This guy Jeremiah Morrill has a blog where he discusses his numerous render projects. There's the WPF Win32 render project, and a number of low-level techniques he documents for how to access accelerated playback, Media Foundation .NET, DVD controls, etc... I believe his blog is titled "Jer's One Stop Shop".
Reading over his blog in general is a good idea if you are in to video/WPF. Last I checked, "MediaKit", one of his more comprehensive projects, enables easy use of DirectShow (simple xaml and your off and running, so don't worry) and other well known native interfaces. It's very robust and actively maintained, if not that specific project, check into some of the recent API's he's contributing on, some various Win7 media support also.
The only reason I'd bring up this other project, Augmented Reality, is that you remarked about adding content "on top". You should definitely check out wpfAugRel if your doing a lot of video production. Where to get an add on for it eludes me, but I'm sure you can find it off that site, but it allows for you to script in python some fairly slick real-time video production.
-- edit --
Right, look at this google code page, it has some video's (picture's worth a thousand words right?), but regardless, it allow's you to mix in 3D content into live-action, through the use of "marker" prop's, essentially bit's of paper with some easily machine recognizable feature's, that facilitate their underlying engine to inject computer rendered output into a real world scene, highly dynamic, so you can toss these marker's around and the 3D content move's fluidly... anyhow good luck.
Check out this article by UberDemo. It captures video into a WMV file with Windows Media Encoder and WPF. There is a paragraph about how to do the preview in a WPF application.

Silverlight programmatic access to Sony RZ30N Video Feed

I would like to bypass the web-server functionality of a Sony SNC-RZ30N network attached web cam and display the video feed in a Silverlight application.
I can't seem to find any examples of interfacing with the camera programatically.
Any leads would be much appreciated. Thx.
Update 09/09/2008: Found a good site with Javascript examples to control the camera, but still no means to embed the video in an iFrame or the like:
http://www2.zdo.com/archives/3-JavaScript-API-to-Control-SONY-SNC-RZ30N-Network-Camera.html
Doug
I don't know the details of the Sony network camera and the server side software. But what do you mean by web-server functionality - is that the UI that get served up to the users in form of a HTML page? Or is it something more, like a server capturing the video stream and transcoding it?
I think the direction you need to take is to first find the URL end-point of your video stream. Since it's a network camera I assume the camera has a built in IP-stack/HTTP server serving up the video stream. Once you have that feed you probably have to transcode it into a video format consumable by Silverlight. There are multiple tools you can use, but for Silverlight the preferred tool Microsoft Expression Encoder. It supports live transcoding of webcam video streams. I think it supports both Direct Show devices as well as video streams.

Resources