Reputation: 2592
Yes, this topic keeps popping up from time to time also here on SO.
I've read a lot about this topic and also tried some solutions but I have some constraints:
So going forward: an H264 stream seems perfect for constraints 1 and 2.
Also my source produce a live H264 (to be exact: MPEG-4 AVC, part 10) into an RTSP container.
But RTSP is still not supported in browser.
What I've checked:
All the posts above are related to this question, and a lot of valuable information was there.
Also I've read a very good article from 2014 (!) which is detailed and quite forward-looking.
So, as of today, the best solution would be this:
There are solutions where the step 1 and 2 happens on server side, then the fMP4 is pushed into a websocket. The client consumes the data from websocket and pass it to MSE components for displaying.
The article from 2014 shows that step2 can also happen on client side. In this case only step 1 happens on the server, then h264 is pushed into the websocket, and on the client side there is the restructuring and displaying of course.
Streamedian seemed a good solution for the first sight, but they doesn't publish their server side codes, and also their site returned with 502 error for a day.
I don't want to use GStreamer or ffmpeg, they are both too heavy.
However there are nice items which can help:
Going back to my list, step2 can be done with MP4Box - at least I believe / hope.
Step3 and step4 are straightforward, there are tons of howtos on these ones.
However I'm a bit puzzled with step1. It shall be done on server side, preferably in a language which can interact with websockets easily (like java).
That is the point of my question: I need to extract the h264 stream from RTSP in java, how can I do it simple but without calling external programs?
Upvotes: 15
Views: 22198
Reputation: 1343
I hope WebRTC is what you are looking for.
WebRTC is supported by most browsers.
Upvotes: 0