New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601636 link

Starred by 7 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 608385



Sign in to add a comment

MediaRecorder: support H264 for video encoding

Project Member Reported by mcasas@chromium.org, Apr 7 2016

Issue description

MediaStream 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
 
Project Member

Comment 2 by bugdroid1@chromium.org, 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

Comment 3 by mcasas@chromium.org, Apr 18 2016

Owner: mcasas@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Comment 6 by mcasas@chromium.org, Apr 29 2016

Cc: tomfinegan@chromium.org
Labels: M-52
Project Member

Comment 7 by bugdroid1@chromium.org, 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

Comment 8 by mcasas@chromium.org, Apr 29 2016

Blockedon: -601635
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.
Project Member

Comment 9 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
Blocking: 608385
Components: -Blink>MediaStreamRecording Blink>MediaStream>Recording
Renamed component Blink>MediaStreamRecording to Blink>MediaStream>Recording. Moving issues to the new component. 
Project Member

Comment 13 by bugdroid1@chromium.org, 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

Project Member

Comment 14 by bugdroid1@chromium.org, May 31 2016

Labels: merge-merged-2743
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

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.

I meant Chrome 54 and 55 beta.
#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.
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.
Components: Blink>MediaRecording
Components: -Blink>MediaStream>Recording
Blocking: -608385
Blocking: 608385

Sign in to add a comment