I'm currently sending a video stream to Chrome, to play via the MediaSource API.
As I understand it, MediaSource only supports MP4 files encoded with MPEG-DASH, or WebM files that have clusters beginning with keyframes (otherwise it raises the error: Media segment did not begin with keyframe).
Is there any way to encode in MPEG-DASH or keyframed WebM formats with FFMPEG in real-time?
Edit:
I just tried it with ffmpeg ... -f webm -vcodec vp8 -g 1
so that every frame is a keyframe. Not the ideal solution. It does work with MediaStream now though. Any way to sync up the segments with the keyframes in WebM so not every frame needs to be a keyframe?
Reference Questions on WebM / MP4 and MediaSource:
Media Source Api not working for a custom webm file (Chrome Version 23.0.1271.97 m)
MediaSource API and mp4
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…