Closed birme closed 1 year ago
Hi @birme , I found that Safari prefers h264 of profile constrained-baseline
.
To verify that, we could generate a local test stream.
gst-launch-1.0 -v \
videotestsrc ! clockoverlay ! video/x-raw, height=360, width=640 ! videoconvert ! x264enc tune=zerolatency ! video/x-h264, profile=constrained-baseline ! mux. \
audiotestsrc ! audio/x-raw, format=S16LE, channels=2, rate=44100 ! audioconvert ! voaacenc ! aacparse ! mux. \
mpegtsmux name=mux ! queue ! srtsink uri="srt://127.0.0.1:1234?mode=listener" wait-for-connection=false
And then
GST_DEBUG=1 cargo run --release -- -i 127.0.0.1:1234 -o 127.0.0.1:8888 -p 8000 -s caller | bunyan
Here is a screenshot of it running.
Ah, that's good to know. Still the main issue now is the #32 which I think happens every time the app tries to remove a client connection.
That's true. We still need to fix that.
Some updates on this issue:
main
or high
H264 video profile. Media line exists in the answer but is not included in BUNDLE and ice candidates exchange will time out (similar to issue #26).Also, one rationale not to transcode the video stream in this component is that we want to maintain the video as it is as one use case is confidence monitoring or preview. It is ok for now to limit supported browsers depending on the actual SRT video stream. However the component should not crash or end up in an unresolvable state.
This has been addressed in the recent commit so this becomes less of a issue now.
However, it is still a problem that Safari rejects AVC/H264
streams of main
or high
profile. This relates to how Safari parses the codecs parameters (e.g., profile-level-id) and more test will be done.
Alright, good to know. We should perhaps document all the known limitations somewhere?
While experimenting with Safari and AVC/H264
streams, it is noticed that Safari only supports WebRTC H264 of constrained-baseline
and constrained-high
profiles. This can be seen from the SDP offer it generated (either with webrtc player in client mode or with other tools like MungeSDP).
a=rtpmap:96 H264/90000 ... a=fmtp:96 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c1f a=rtpmap:98 H264/90000 ... a=fmtp:98 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
Here profile-level-id can be parsed into constrained high level 3.1
and constrained baseline level 3.1
respectively, as it is defined in the WebRTC repository. Unfortunately, neither ffmpeg nor gstreamer could generate video streams of constrained high
profile. So we instead tested with one stream of constrained baseline
and one of high
(munging the profile-level-id from '64001e' to '640c1f' in SDP offer).
As we have seen before, constrained baseline
video stream can be played out successfully on Safari. On the other hand, high
video stream will be rejected. But if we munge it into '640c1f', the connection can be established but no stream is actually played out.
With the findings so far, a document about these limitations will be drafted and included in this repo soon.