HTML5/H.264 format for desktop sharing - asp.net

I am trying to live stream my desktop over http to one or more users. The immediate goal is just to share the desktop in real time in read only mode for several users. In future we might allow the users to control the desktop as well by mouse or keyboard. I have these queries in this context-
Is HTML5 + H.264 right for this or do I need to go with Flash?
In either case what are all the components/servers I need for a live streaming infrastructure? (Like desktop, encoder, streaming server, web server, media player etc)? It will help compare the options, if You can post your preferences for each of these components/servers.

You should be able to do this with Flash, I don't know for sure about HTML5. In windows I should suggest you create a directshow graph to do this. You'll want a screen capture source filter, h264 encoder and a flash streaming output filter.
A directshow screen capture filter.
http://www.mainmediasoft.com/products/screencapture/
ffdshow can encode h264
http://ffdshow-tryout.sourceforge.net/
flash streaming output filter.
http://www.nanocosmos.de/v3/en/rtmp-streaming.html
In theory you should be able to drag all these parts together in graphedit and make this work.

Related

Which protocol to use for multi-stream application ? RTMP?

I'm trying to stream several iPad screen to a single python client (computer) on a local network but I don't know which protocol to use.
I can do it with 1 Ipad using MonaServer, an app that stream on RTMP and a little Python script to read the video.
But I am dealing with problems to use several Ipads because as I saw RTMP uses a single port on Windows, :1935 and I am not sure it's possible to multi-stream with RTMP.
I am not a pro with networking, so if you have any suggestions I'm open
What you need is to following the wiki and usage of open source projects, to get some instincts about multiple clients live streaming.
For example, you could use OBS to publish some streams to a media server, like SRS, play it by different protocols like RTMP/HTTP-FLV/HLS/WebRTC.
You could publish multiple streams, they are not mutually exclusive. And play by different players, depends on the protocol you chose, please read this post.
Try it.

HTTP Video Streaming

I have a server (not internet connected) that hosts a webpage with company data on an internal website. The server also contains videos (thousands of them) in a defined directory structure.
When a client connects I can display the videos to them on the internal website. The problem is some of the video files are 1Gb or larger and the connection to some clients is rather slow; the browser seems to be trying to download them in order to play them rather than stream them.
Is there a video streaming server that I could send a file path to and it would serve the video back to the client as a stream?
I guess this is essentially transcoding the video that I need done. I'm not sure if PLEX or something like that is able to do it dynamically as there are hundreds of videos and new videos added all the time.
Sorry if i'm not being clear on my need. Send me a question if I haven't been clear on a point.
...the browser seems to be trying to download them in order to play them rather than stream them.
To echo what #Offbeatmammal said in the comments, if you're using MP4 files, you need to ensure the MOOV atom is at the beginning of the file. Without it, the browser doesn't know what byte offsets to request.
Ideally, encode your video files as fragmented. In FFmpeg:
ffmpeg -i ... -f mp4 -movflags frag_keyframe+empty_moov output.mp4
See also: https://stackoverflow.com/a/9734251/362536
That should allow the client to stream the MP4 files from any web server that supports HTTP/1.1 range requests. (Most all do, unless configured otherwise.)
However, there is another point to address:
The problem is some of the video files are 1Gb or larger and the connection to some clients is rather slow...
While fixing the streaming issue means the clients won't have to download the whole file first, they still need the bandwidth to keep up with the stream. If it's possible they won't, you'll want to implement some sort of transcoder.
I would recommend using an existing segmented streaming method such as DASH or HLS. HLS is currently the most compatible, thanks to Apple's platform policies. Either will enable adaptive bitrate switching, which will allow slow clients to automatically switch to a lower bitrate stream that they can smoothly keep up with. That way, slower clients can still see the video, albeit a lower quality one, while fast clients can get the full quality video.
You can use FFmpeg to do the transcoding and HLS playlist creation.
I'm not sure if PLEX or something like that is able to do it dynamically as there are hundreds of videos and new videos added all the time.
As for when you do this transcode, I suppose it depends on how much load you're looking at. If this is just one or two people viewing the file, you can transcode on demand if your servers can keep up. Ideally, you have at least a couple stream variants around for less popular files, and add more later if needed.
If you're doing this live, I'd recommend doing all of your transcoding up front. You can always prune old files/variants if you need the storage back.

How to stream video from my server to client browser using DirectShow?

I'm developing an ASP.NET application that's required to stream on-demand videos from server to client. Now I consider using DirectShow to do some kind of processing works before the video is transmitted over Internet. Following this article, I know I can transfer video stream over network through WMAsfWriter after it's processed by DirectShow and the output is a URL that the client can get access to through Windows Media player. But in my ASP.NET application, I want the video stream played on the web page of the client browser such as Chrome. I'm not sure if the output URL can be parsed by client browser and the video stream can be played there directly, so I want to ask that is it possible? If not, what extra steps do I need to take to achieve my goal?
I think you can made WebRTC streamer DirectShow filter and open this stream in browser. Ways like WMP / VLC player require ActiveX, that, really, dead technology now. Even Microsoft Edge do not support it anymore. WebRTC most common way today. Web version of Skype and a lot of other apps use it.

video server supporting Http

I want to setup a video on demand server which support Http protocol. It is like Youtube, which hosts a lot of videos, and end users could play them from browser (by using Flash or Html 5).
Two quick questions,
For the big video files, shall I put them on disk or in memory? How Youtube or other big video site did it? Not sure if put all video in memory is too expensive, and put video on disk is too slow?
Is there any open source video hosting server for my purpose? If steaming is supported, it will be great.
thanks in advance,
George
If you just want to have an HTML page that links to your video files - no problem, but most browsers will download the entire file before you system even considers playing it.
If you want to stream the files (like YouTube and others do) then you aren't actually using HTTP for the video itself. HTTP is used to get the information about the stream so your player can stream and play directly without having to download the entire file first.
Streaming video uses RTSP (or some other streaming protocol) for the audio and video data.
The closest HTTP protocol can get to "streaming" video is to use Server-Push of individual image frame with each frame flagged to replace the previous frame. Not all browsers can handle this directly, but might need an ActiveX control or Java Applet. The original QuickTime did this before the streaming protocols were implemented at the servers.
re: how does YouTube deal with big video file
I suspect they are on disk until they are needed. Moved into memory only as needed. Flushed from memory when no longer needed.
re: is there an open source video server for my purpose
YES! Check out http://www.videolan.org/
-Jesse
another approach is to use HTTP Live Streaming - HLS - the web server is simply a standard httpd server - video/audio is preprocessed on server side into a set of bitrate playlists.
The logic is on the client side to retrieve the media as a series of 6 second files, based on bandwidth appropriate playlist.
So :
- use files not memory
- there are open source HLS segmentators (ffmpeg)

programmatically stream audio with NetStream

In Flex you can stream microphone audio to an FMS/Red5 server using NetStream.attachAudio, which requires a Microphone object. Is it possible to stream audio through the NetStream from somewhere other than a Microphone? For example, from a file/embedded resource?
The reason I'm asking is that I'd like to be able to run automated tests that don't require using an actual microphone.
Well, it looks like this isn't possible. My workaround is to use SoundFlower to route audio file playback (invoked outside of Flash) into a virtual microphone, which Flash then streams to the media server. From Flash's point of view, its just as if you were manually speaking into the mic.

Resources