This demo requires Chrome 57.0.2957.0 or later with Experimental Web Platform features enabled from chrome://flags.
A stream is captured from the source video using the captureStream()
method. The stream is cloned and transmitted via two separate PeerConnections using 50kbps of video bandwidth. This is insufficient to generate good quality in the encoded bitstream, so trade-offs have to be made.
The transmitted stream tracks are using MediaStreamTrack Content Hints to indicate characteristics in the video stream, which informs PeerConnection on how to encode the track (to prefer motion or individual frame detail).
The text part of the clip shows a clear case for when 'detail' is better, and the fighting scene shows a clear case for when 'motion' is better. The spinning model however shows a case where 'motion' or 'detail' are not clear-cut decisions and even with good content detection what's preferred depends on what the user prefers.
Other MediaStreamTrack consumers such as MediaStreamRecorder can also make use of this information to guide encoding parameters for the stream without additional extensions to the MediaStreamRecorder specification, but this is currently not implemented in Chromium.
View source on GitHub