as an AD.3
you can use HLS or you can use WebRTC with h264 or webm DASH
for DASH it somewhat blurry form me (no straight answer for ffmpeg), but as for the HLS this is supported in a straightforward fashion look here
Some time ago I was looking for a way to publish an h264 stream from the IPCam without the need of extra user actions.
I came across Janus Gateway, this bit of software consumes RTP streams (amongst others types of media) and publishes it as WebRTC media to the browser.
So basically I did the following:
- used ffmpeg as an rtsp client and encoder to publish audio and video (separately) as RTP streams
- I have setup Janus streaming plugin to accept h264 RTP stream and audio stream (descriptions are coming from the RTSP sdp file)
and it worked just nice.
I had some issues with the h264 from the IPcam so I had to re-encode it using x264 to be visible in the browsers.
Ideally Janus has a support for RTSP, but it seems it's lacking option of interleaved TCP transport of RTP and RTCP, and besides I had to re-encode the stream one way or another.
This are the configs I have used:
Janus - file janus.plugin.streaming.cfg:
[h264-sample]
type = rtp
id = 1
description = H.264 live stream test
audio = yes
video = yes
audioport = 8005
audiopt = 8
audiortpmap = PCMA/8000
videoport = 8004
videopt = 126
videortpmap = H264/90000
videofmtp = profile-level-id=42e01f\;packetization-mode=1
the ffmpeg stream feeding the pipes should look like that (you can of course re-encode whatever you like in this fashion):
ffmpeg -rtsp_transport tcp -i rtsp://hostname:port/description.sdp \
-an -c:v h264 -profile:v baseline -preset ultrafast -tune zerolatency -f rtp rtp://localhost:8004 \
-vn -acodec copy -f rtp rtp://localhost:8005