Reputation: 583
I am building the app along the lines of this:
MediaSource randomly stops video
and it works fine, except if the client connects to the stream while it was already running, it tooks a lot of time where the user watches a crippled image, until the next keyframe arrives: which is logical and can't be fixed, because even if i cache the data after the last keyframe on server, it would introduce a large extra latency for all newly connected clients - up to the duration of keyframe interval depending on luck - which is worse than looking at a crippled image.
therefore, i am looking for a way to force a keyframe on the MediaRecorder to do it either regularly at short intervals, or whenever a new viewer connects. in webrtc, i can request a keyframe from the receiver, but what about MediaRecorder()?
Officially there is no way. Are there any hackish/unofficial ways (such as for example, setting very high bitrate, or any other way to trick browser into believing that a low, 20-100 frames, keyframe interval would be desirable)?
I am using VP8. With H264, default keyframe interval is low enough but it has other issues.
Upvotes: 2
Views: 278