C# mp4 stream continuous without server manipulation? - c#

I"m trying to consume an mp4 stream in C# (WPF) direct from sources without any server/mid software to convert. The stream is continuous. No control or audio are necessary, just the constant video stream.
media element & embedded web browser controls with some added codecs tried but no luck.
just want a simple, continuous mp4 stream. Once working, application will read many streams simultaneously for multiple source monitoring without any control or audio of media so a rolled class is an option if a simple stream converter/consumer isn't available.
any assistance is appreciated - thanks

Related

Cannot stream MP3 to firefox audio tag

I have a simple c# application that record & stream audio with naudio & lame. I use System.Net.Socket for the streaming, just wait for connection, read the header and then pass the socket to lame encoder that will send chunks of mp3.
Problem is, FF's audio tag cannot play the thing, it just returns 'All candidate resources failed to load. Media load paused.' And I specifically mention FF's audio tag because I can play it directly if I put the link in url tab. Searching, I found https://bugzilla.mozilla.org/show_bug.cgi?id=502894#c1 that explain why firefox does all sort of random requests to determine file length and such. But I don't want that, is there anyway of making FF leaves my audio alone? (make it behaves as if I put the link in url tab)

Streaming compressed avi over network using directshow

I'm quite new to Windows programming and I'm trying to setup a directshow graph to stream a webcam feed over a network so I can monitor the output on an ipad.
I've setup a graph in csharp using DirectShowLib and FFDShow that compresses the raw output from a capture device and writes it to an avi file.
Now I'm trying to work out how to broadcast the stream over the network.
The only sample code I can find for network streaming with directshow relates to the WM library which only seems to output Asf formatted streams.
How can I broadcast a stream in a format other than Asf using directshow? Can I configure the ASF Writer to output an avi/mpeg formated stream or do I need to write my own directshow filter?
Are there any examples of streaming avi over a network using directshow?
Thanks for reading,
Josh
Well I ended up using VLC to create an MJPEG stream. I did try using VLS's HLS plugin but I found that iOS will only play one video at a time which was no good as I want to display several webcams. MJPEG gets round this.

Image processing (WinRT and C#) - images to video

Is there a way to process frames from a stream(or image file or video file) and save the frames in encoded video file without using Media Foundation API. I am not familiar with C++ and COM technology, so I ask is there any way to make video stream from set of images with C#?
It might be possible with some .NET wrappers for Media Foundation. Perhaps SharpDX has them.

Streaming Audio from video server c#

I have a video server with an IP:192.168.1.XX
It has 3 possible formats JPEG, MPEG-4 or H.264
The video server is broadcasting a video(with audio) on real time
I have no problems streaming the video with AFORGE lib
but i also need to stream the audio
the video server has several protocols: HTTP,RTSP,RTP,RTCP
according to the user's manual RTSP is the protocol I should use to get MPEG-4(Audio and video), but I haven't found anything to stream by RTSP on C# so I'm trying to stream audio and video separate
the ports are:
RTSP: 554
RTP(Video): 5556
RTP(Audio):5558
RTCP(Video): 5557
RTCP(Audio): 5559
Does any body know how RTP works or how can I get the sound from the video server?
I would learn gstreamer. I am assuming that you are using windows since you are doing this in C#. It has a fairly stable windows port with a nice .net wrapper. If you aren't using Windows, then gstreamer is most certainly your best bet.
In gstreamer you would most likely use a pipeline like:
your video src -> x264enc or ffenc_mpv4 -> rtph264pay or rtpmp4vpay -> udpsink
your audio src -> ffenc_aac or preferably a lower latency codec like mULaw -> rtppay -> udpsink
and so on. It is very easy to use. They even have a nice rtpbin for your to use if you want to actually manage an rtp session.
More information can be found here:
http://gstreamer.freedesktop.org/
Here is a nice sample of how to do rtp:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-gstrtpbin.html
I have done this sort of thing with the direct show filters but it is much more involved. You usually have to manually handle the rtp payloading and the transport--not to mention deal with COM--whereas GStreamer provides those mechanisms for you out of the box.
You can use https://net7mma.codeplex.com/
It is a C# Media Server and it will get you each RtpPacket and from there you can get them to a Decoder of your choice among other things all without bogging down the source stream.

How to grab thumbnail every X seconds from *live* Windows Media Stream

I want to provide a choice between streaming 'channels', if you will, in a web application. These are Windows Media streams of live events that are being broadcast from a Windows Media Services 9 distribution network.
I want to provide a relatively recent thumbnail image of the stream (as a user, you would expect to see this), but although I've seen this done in Flash on CNN and countless other sites, I've never seen this done with Windows Media.
I already have a C# / DirectX library that can extract a thumbnail from a WMV file, but obviously the stream doesn't come from a file if it's a live source.
My assumptions so far are:
Will need to run some kind of service application/daemon that will receive a stream into a Windows Media Player object and somehow take thumbnails if WMPlayer supports it...
-or-
Configure the streams to archive to file, and use the existing class library to take a peek at the last frame available in the archive file being written to get the thumbnail.
I would much rather do #1 because it seems like the clean solution, but don't know if/how WMPlayer supports grabbing a frame.
Are there better ways of doing this?
Not sure if using media player is a good idea in such case. I would look into this:
http://sourceforge.net/projects/windowsmedianet/

Categories