MediaRecorder: support H264 for video encoding |
||||||||||||
Issue descriptionMediaStream Recording supports VP8 and VP9 codecs only. Chrome also has an implementation of OpenH264 encoder [1] that can be used for said recording. (H264 might also be implemented in a EncodeAccelerator but that should be tracked in a different bug). (Note that this is blocked by container support) [1] https://code.google.com/p/chromium/codesearch#chromium/src/third_party/openh264/&q=third_party/openh264&sq=package:chromium
,
Apr 15 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8702c29cb538f4d76a6bde77ee52d8a4350c2c09 commit 8702c29cb538f4d76a6bde77ee52d8a4350c2c09 Author: mcasas <mcasas@chromium.org> Date: Fri Apr 15 02:29:01 2016 VideoTrackRecorder: extract base class Encoder out of VpxEncoder Some common functionality is moved to Encoder from VpxEncoder. Also VpxEncoder is moved to the anonymous namespace. No new code is added, this CL is pure refactoring. This is the 2nd step in a series of CLs to add support for H264 to MediaRecorder (see https://crrev.com/1886123002/). Next step is to add an H264Encoder (<is a> Encoder). BUG= 601636 Review URL: https://codereview.chromium.org/1893493003 Cr-Commit-Position: refs/heads/master@{#387526} [modify] https://crrev.com/8702c29cb538f4d76a6bde77ee52d8a4350c2c09/content/renderer/media/video_track_recorder.cc [modify] https://crrev.com/8702c29cb538f4d76a6bde77ee52d8a4350c2c09/content/renderer/media/video_track_recorder.h
,
Apr 18 2016
,
Apr 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/240fa42bc3097277407a3d747bcd26a33e248efa commit 240fa42bc3097277407a3d747bcd26a33e248efa Author: mcasas <mcasas@chromium.org> Date: Fri Apr 22 00:06:33 2016 VideoTrackRecorder: Adding inner class H264Encoder H264 Encoder using third_party OpenH264 library. This CL adds a new class H264Encoder <is a> Encoder, where on ToT, there is only VpxEncoder <is a> Encoder. The new encoder is behing #if BUILDFLAG(RTC_USE_H264). Some code shifting from VpxEncoder to Encoder takes place, in particular, some common functionality is extracted from VpxEncoder into Encoder: - StartFrameEncode() and set_paused() are extracted and the latter is made thread safe, then renamed to SetPaused() - Members |main_task_runner_|, |origin_task_runner_| and |encoding_thread_| are also extracted. A few minor renames: - ConfigureEncoding() --> ConfigureEncoderOnEncodingThread() - CalculateFrameDuration() --> EstimateFrameDuration() This is the 3rd step in a series of CLs to add support for H264 to MediaRecorder (see https://crrev.com/1886123002/). Next step is to MediaRecorderHandler and Blink support. BUG= 601636 TEST= see playground CL, also added unittest. Review URL: https://codereview.chromium.org/1884383002 Cr-Commit-Position: refs/heads/master@{#388965} [modify] https://crrev.com/240fa42bc3097277407a3d747bcd26a33e248efa/content/content.gyp [modify] https://crrev.com/240fa42bc3097277407a3d747bcd26a33e248efa/content/renderer/BUILD.gn [modify] https://crrev.com/240fa42bc3097277407a3d747bcd26a33e248efa/content/renderer/media/DEPS [modify] https://crrev.com/240fa42bc3097277407a3d747bcd26a33e248efa/content/renderer/media/video_track_recorder.cc [modify] https://crrev.com/240fa42bc3097277407a3d747bcd26a33e248efa/content/renderer/media/video_track_recorder.h [modify] https://crrev.com/240fa42bc3097277407a3d747bcd26a33e248efa/content/renderer/media/video_track_recorder_unittest.cc
,
Apr 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/795f1a69a3f9f532ff11c7de0d23d34f6ffbd27e commit 795f1a69a3f9f532ff11c7de0d23d34f6ffbd27e Author: tomfinegan <tomfinegan@chromium.org> Date: Fri Apr 29 03:36:54 2016 Roll libwebm 75a6d2d:9a235e0 Update BUILD.gn and libwebm.gyp for new libwebm source layout. Upstream changes: <too many to list> BUG= 601636 Review-Url: https://codereview.chromium.org/1929873004 Cr-Commit-Position: refs/heads/master@{#390587} [modify] https://crrev.com/795f1a69a3f9f532ff11c7de0d23d34f6ffbd27e/DEPS [modify] https://crrev.com/795f1a69a3f9f532ff11c7de0d23d34f6ffbd27e/media/BUILD.gn [modify] https://crrev.com/795f1a69a3f9f532ff11c7de0d23d34f6ffbd27e/media/media.gyp [modify] https://crrev.com/795f1a69a3f9f532ff11c7de0d23d34f6ffbd27e/third_party/libwebm/BUILD.gn [modify] https://crrev.com/795f1a69a3f9f532ff11c7de0d23d34f6ffbd27e/third_party/libwebm/libwebm.gyp
,
Apr 29 2016
,
Apr 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/913419cf02929813a7ca8d1584fb42fc55d5e10d commit 913419cf02929813a7ca8d1584fb42fc55d5e10d Author: mcasas <mcasas@chromium.org> Date: Fri Apr 29 16:40:00 2016 MediaRecorderHandler and WebmMuxer: add support for H264. This CL adds support for H264 codec type in both WebmMuxer and MediaRecorderHandler. Support for H264 (and other) codecs was added to libwebm (which underlies WebmMuxer) in [1], by flipping the Doc Type indication of the webm file from "webm" to "matroska". MediaRecorder Handler basically just expands the boolean indication vp9 yes/no into using the enum class CodecId from VideoTrackRecorder. [1] https://chromium-review.googlesource.com/340298 BUG= 601636 TEST= extended unit tests playground CL @ https://crrev.com/1886123002/ Review-Url: https://codereview.chromium.org/1920483002 Cr-Commit-Position: refs/heads/master@{#390670} [modify] https://crrev.com/913419cf02929813a7ca8d1584fb42fc55d5e10d/content/renderer/media/media_recorder_handler.cc [modify] https://crrev.com/913419cf02929813a7ca8d1584fb42fc55d5e10d/content/renderer/media/media_recorder_handler.h [modify] https://crrev.com/913419cf02929813a7ca8d1584fb42fc55d5e10d/content/renderer/media/media_recorder_handler_unittest.cc [modify] https://crrev.com/913419cf02929813a7ca8d1584fb42fc55d5e10d/media/muxers/webm_muxer.cc [modify] https://crrev.com/913419cf02929813a7ca8d1584fb42fc55d5e10d/media/muxers/webm_muxer.h [modify] https://crrev.com/913419cf02929813a7ca8d1584fb42fc55d5e10d/media/muxers/webm_muxer_unittest.cc
,
Apr 29 2016
Note that #5 landed support for non-VPx codecs in .webm containers, essentially by making them a simplified Matroska, so that bug should not block this one anymore.
,
Apr 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1eafb4db43424112af597686f9710e0eae10fb5d commit 1eafb4db43424112af597686f9710e0eae10fb5d Author: mcasas <mcasas@chromium.org> Date: Fri Apr 29 21:08:29 2016 MediaRecorder LayoutTest: add H264 to isTypeSupported() test Now that this is supported in content/. BUG= 601636 Review-Url: https://codereview.chromium.org/1933463003 Cr-Commit-Position: refs/heads/master@{#390759} [modify] https://crrev.com/1eafb4db43424112af597686f9710e0eae10fb5d/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-isTypeSupported.html
,
Apr 29 2016
,
May 2 2016
,
May 24 2016
Renamed component Blink>MediaStreamRecording to Blink>MediaStream>Recording. Moving issues to the new component.
,
May 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/35bb0d816c17ade12088e67a35a2e9e40c403b01 commit 35bb0d816c17ade12088e67a35a2e9e40c403b01 Author: mcasas <mcasas@chromium.org> Date: Fri May 27 17:18:23 2016 MediaRecorder: fix typo It mistakenly said VP8 when it should have said VP9. BUG= 613665 , 601636 TBR=emircan@chromium.org Review-Url: https://codereview.chromium.org/2010413002 Cr-Commit-Position: refs/heads/master@{#396496} [modify] https://crrev.com/35bb0d816c17ade12088e67a35a2e9e40c403b01/content/renderer/media/media_recorder_handler.cc
,
May 31 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b166edf19fdc4d849626921b05a29b3091495f4c commit b166edf19fdc4d849626921b05a29b3091495f4c Author: mcasas <mcasas@chromium.org> Date: Tue May 31 20:43:35 2016 MediaRecorder: fix typo It mistakenly said VP8 when it should have said VP9. BUG= 613665 , 601636 TBR=emircan@chromium.org Review-Url: https://codereview.chromium.org/2010413002 Cr-Commit-Position: refs/heads/master@{#396496} (cherry picked from commit 35bb0d816c17ade12088e67a35a2e9e40c403b01) NOTRY=true NOPRESUBMIT=true Review-Url: https://codereview.chromium.org/2023083002 Cr-Commit-Position: refs/branch-heads/2743@{#145} Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939} [modify] https://crrev.com/b166edf19fdc4d849626921b05a29b3091495f4c/content/renderer/media/media_recorder_handler.cc
,
Oct 25 2016
H.264 recording does not yet work on Chrome 44 and 55 beta. I've tried https://cdn.rawgit.com/miguelao/demos/master/mediarecorder.html The error shown in the console log is: >Assertion failed: Exception while creating MediaRecorder: NotSupportedError: Failed to construct 'MediaRecorder': Failed to initialize native MediaRecorder the type provided (video/x-matroska;codecs=h264) is not supported. I've also tried https://addpipe.com/media-recorder-api-demo/ which defaults to "video/webm;codecs=h264" instead of "video/x-matroska;codecs=h264" but it still does not work.
,
Oct 25 2016
I meant Chrome 54 and 55 beta.
,
Oct 25 2016
#15: Oops, my demo was updated for a CL that was ultimately rejected due to lack of interest to support MJPEG as encoder. I just updated it, so that "video/webm;codecs=h264" should be used ISO the invalid "video/x-matroska". With the change, however, H264 recording works on my Mac, and so does https://addpipe.com/media-recorder-api-demo/; avchat.contact@, could you please provide more details as to how to reproduce the bug? Also, it might be best to file a separate issue instead of continuing the conversation on this bug.
,
Oct 26 2016
Same guy here, I've now successfully tested on Chrome 52, 54 and 55 beta. H264 video recording worked. Not sure why it didn't worked yesterday. Thanks for the heads up regarding "video/webm;codecs=h264" being the correct MIME.
,
Jan 18 2017
,
Jan 18 2017
,
Mar 7 2017
,
Mar 7 2017
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by mcasas@chromium.org
, Apr 15 2016