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

Issue 797648 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Feature



Sign in to add a comment

Improve SW encoding speed for MediaRecorder

Project Member Reported by shenghao@chromium.org, Dec 26 2017

Issue description

Chrome Version: 65.0.3296.0
Chrome OS Version: 10222.0.0
Chrome OS Platform: minnie

Steps To Reproduce:
(1) Use MediaRecorder to record a video
(2) FPS of recorded video is extremely low (4 fps)

Expected Result:
FPS should be comparable to what android camera app in android container produces (22 fps).

Actual Result:
4 fps

How frequently does this problem reproduce? (Always, sometimes, hard to
reproduce?)
Always

What is the impact to the user, and is there a workaround? If so, what is
it?
Web apps that use MediaRecorder would produce low quality videos.



 
We want to enable NEON in openH264 to address this problem.
CL: https://chromium-review.googlesource.com/c/chromium/src/+/831775
Components: Blink>MediaRecording
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a471e06a4ec3b91f4964667a969c954522f839b

commit 6a471e06a4ec3b91f4964667a969c954522f839b
Author: Sheng-Hao Tsao <shenghao@google.com>
Date: Wed Jan 03 07:45:07 2018

Improve h264 encode efficiency for MediaRecorder

This CL enables multithread and NEON in openh264 for ChromeOS devices
by changing openh264 configurations and adding required definitions.

The effort is needed because currently MediaRecorder with openh264 encode
can only produce 4 FPS on minnie. Enabling multithread and NEON will
improve FPS to 21.

BUG= 797648 
TEST=Verified on minnie that recording FPS becomes 21, which is
comparable to FPS of the camera inside android container (22).

Change-Id: Ifb54c2fdc07595d1887a36ee791357ef8d503948
Reviewed-on: https://chromium-review.googlesource.com/831775
Reviewed-by: Henrik Boström <hbos@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
Cr-Commit-Position: refs/heads/master@{#526647}
[modify] https://crrev.com/6a471e06a4ec3b91f4964667a969c954522f839b/content/renderer/media_recorder/h264_encoder.cc
[modify] https://crrev.com/6a471e06a4ec3b91f4964667a969c954522f839b/third_party/openh264/BUILD.gn
[modify] https://crrev.com/6a471e06a4ec3b91f4964667a969c954522f839b/third_party/openh264/openh264_sources.gni

I have reverted this CL as a suspect for breaking the *Google Chrome* windows builder:

https://ci.chromium.org/buildbot/chromium.chrome/Google%20Chrome%20Win/25475

https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.chrome%2FGoogle_Chrome_Win%2F25475%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout

[15881/45419] ASM obj/third_party/openh264/common/intra_pred_common_neon.obj
FAILED: obj/third_party/openh264/common/intra_pred_common_neon.obj 
C:/b/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py asm-wrapper environment.x86 ml.exe -DX86_ASM -DV8_DEPRECATION_WARNINGS -DUSE_AURA=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DGOOGLE_CHROME_BUILD -D"CR_CLANG_REVISION=\"318667-1\"" -D_HAS_EXCEPTIONS=0 -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -DDEPRECATEDENUMERATOR(x)=[[deprecated(x)]] -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=1 -DWIN32 -D_SECURE_ATL -D_USING_V110_SDK71_ -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=0x0A000000 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -I../../third_party/openh264/src/codec/api/svc -I../../third_party/openh264/src/codec/common/arm -I../../third_party/openh264/src/codec/common/inc -I../../third_party/openh264/src/codec/common/src -I../.. -Igen /safeseh /c /Foobj/third_party/openh264/common/intra_pred_common_neon.obj ../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(1) : error A2008:syntax error : /
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(2) : error A2109:only white space or comment can follow backslash
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(4) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(5) : error A2008:syntax error : All
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(6) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(7) : error A2008:syntax error : Redistribution
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(8) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(9) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(10) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(11) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(12) : error A2008:syntax error : notice
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(13) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(14) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(15) : error A2008:syntax error : notice
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(16) : error A2008:syntax error : the
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(17) : error A2008:syntax error : distribution
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(18) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(19) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(20) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(21) : error A2008:syntax error : LIMITED
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(22) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(23) : error A2008:syntax error : COPYRIGHT
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(26) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(27) : error A2008:syntax error : CAUSED
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(28) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(29) : error A2008:syntax error : ANY
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(30) : error A2008:syntax error : POSSIBILITY
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(31) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(32) : error A2008:syntax error : *
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(35) : error A2044:invalid character in file
../../third_party/openh264/src/codec/common/arm/intra_pred_common_neon.S(36) : error A2044:invalid character in file
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7de5eb3030391c71ed031b1f1b8bb326350fbb2a

commit 7de5eb3030391c71ed031b1f1b8bb326350fbb2a
Author: Dominic Battré <battre@chromium.org>
Date: Wed Jan 03 08:09:17 2018

Revert "Improve h264 encode efficiency for MediaRecorder"

This reverts commit 6a471e06a4ec3b91f4964667a969c954522f839b.

Reason for revert: Breaks Google Chrome Win builder, see bug for details.

Original change's description:
> Improve h264 encode efficiency for MediaRecorder
> 
> This CL enables multithread and NEON in openh264 for ChromeOS devices
> by changing openh264 configurations and adding required definitions.
> 
> The effort is needed because currently MediaRecorder with openh264 encode
> can only produce 4 FPS on minnie. Enabling multithread and NEON will
> improve FPS to 21.
> 
> BUG= 797648 
> TEST=Verified on minnie that recording FPS becomes 21, which is
> comparable to FPS of the camera inside android container (22).
> 
> Change-Id: Ifb54c2fdc07595d1887a36ee791357ef8d503948
> Reviewed-on: https://chromium-review.googlesource.com/831775
> Reviewed-by: Henrik Boström <hbos@chromium.org>
> Reviewed-by: Miguel Casas <mcasas@chromium.org>
> Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
> Cr-Commit-Position: refs/heads/master@{#526647}

TBR=mcasas@chromium.org,hbos@chromium.org,shenghao@google.com

Change-Id: If8c7c9591406f409986e65166904faa769d7537e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  797648 
Reviewed-on: https://chromium-review.googlesource.com/848772
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526648}
[modify] https://crrev.com/7de5eb3030391c71ed031b1f1b8bb326350fbb2a/content/renderer/media_recorder/h264_encoder.cc
[modify] https://crrev.com/7de5eb3030391c71ed031b1f1b8bb326350fbb2a/third_party/openh264/BUILD.gn
[modify] https://crrev.com/7de5eb3030391c71ed031b1f1b8bb326350fbb2a/third_party/openh264/openh264_sources.gni

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/347b5bd309526446c315041bca2fd3fb3a34450b

commit 347b5bd309526446c315041bca2fd3fb3a34450b
Author: Sheng-Hao Tsao <shenghao@google.com>
Date: Tue Jan 09 04:42:56 2018

Reland "Improve h264 encode efficiency for MediaRecorder"

Restrict the inclusion of ARM assembly sources to ChromeOS only.
Patchset 2 is the original CL.

The original CL description is:

This CL enables multithread and NEON in openh264 for ChromeOS devices
by changing openh264 configurations and adding required definitions.

The effort is needed because currently MediaRecorder with openh264 encode
can only produce 4 FPS on minnie. Enabling multithread and NEON will
improve FPS to 21.

BUG= 797648 
TEST=Verified on minnie that recording FPS becomes 21, which is
comparable to FPS of the camera inside android container (22).

TBR=mcasas@chromium.org

Change-Id: Ib071614c8f04b1008adb811d12050dc3996ed7f7
Reviewed-on: https://chromium-review.googlesource.com/848673
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
Cr-Commit-Position: refs/heads/master@{#527900}
[modify] https://crrev.com/347b5bd309526446c315041bca2fd3fb3a34450b/content/renderer/media_recorder/h264_encoder.cc
[modify] https://crrev.com/347b5bd309526446c315041bca2fd3fb3a34450b/third_party/openh264/BUILD.gn
[modify] https://crrev.com/347b5bd309526446c315041bca2fd3fb3a34450b/third_party/openh264/openh264_sources.gni

Project Member

Comment 7 by bugdroid1@chromium.org, Jan 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/801a0adf4e800eddc84fc0e5fea582dd4732f6fe

commit 801a0adf4e800eddc84fc0e5fea582dd4732f6fe
Author: Hitoshi Yoshida <peria@chromium.org>
Date: Tue Jan 09 05:12:17 2018

Revert "Reland "Improve h264 encode efficiency for MediaRecorder""

This reverts commit 347b5bd309526446c315041bca2fd3fb3a34450b.

Reason for revert: This breaks build of "Google Chrome ChromeOS".
https://ci.chromium.org/buildbot/chromium.chrome/Google%20Chrome%20ChromeOS/44101

Original change's description:
> Reland "Improve h264 encode efficiency for MediaRecorder"
> 
> Restrict the inclusion of ARM assembly sources to ChromeOS only.
> Patchset 2 is the original CL.
> 
> The original CL description is:
> 
> This CL enables multithread and NEON in openh264 for ChromeOS devices
> by changing openh264 configurations and adding required definitions.
> 
> The effort is needed because currently MediaRecorder with openh264 encode
> can only produce 4 FPS on minnie. Enabling multithread and NEON will
> improve FPS to 21.
> 
> BUG= 797648 
> TEST=Verified on minnie that recording FPS becomes 21, which is
> comparable to FPS of the camera inside android container (22).
> 
> TBR=mcasas@chromium.org
> 
> Change-Id: Ib071614c8f04b1008adb811d12050dc3996ed7f7
> Reviewed-on: https://chromium-review.googlesource.com/848673
> Reviewed-by: Henrik Boström <hbos@chromium.org>
> Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
> Cr-Commit-Position: refs/heads/master@{#527900}

TBR=hbos@chromium.org,shenghao@google.com

Change-Id: I4cc8e4c66d6c43def6c947d69819fbd98445973b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  797648 
Reviewed-on: https://chromium-review.googlesource.com/856076
Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527906}
[modify] https://crrev.com/801a0adf4e800eddc84fc0e5fea582dd4732f6fe/content/renderer/media_recorder/h264_encoder.cc
[modify] https://crrev.com/801a0adf4e800eddc84fc0e5fea582dd4732f6fe/third_party/openh264/BUILD.gn
[modify] https://crrev.com/801a0adf4e800eddc84fc0e5fea582dd4732f6fe/third_party/openh264/openh264_sources.gni

Project Member

Comment 8 by bugdroid1@chromium.org, Jan 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cc3dfaafc0fcdcb6e9360efe9a22b633cb3a1ab3

commit cc3dfaafc0fcdcb6e9360efe9a22b633cb3a1ab3
Author: Sheng-Hao Tsao <shenghao@google.com>
Date: Tue Jan 09 05:42:29 2018

Uprev openh264 for enabling NEON

Uprev openh264 to include 2 patches:
https://chromium.googlesource.com/external/github.com/cisco/openh264/+/cc4daaf7ddf738357f8e099c4e15e2c379dc0b7f
and
https://chromium.googlesource.com/external/github.com/cisco/openh264/+/499291f1833294249ee0963644bc09f2cea4173d
so that we can enable NEON.

BUG= 797648 
TEST=Verified on minnie that NEON is enabled when using MediaRecorder.

Change-Id: I891114e4bc839d32ff8019fbe9c352d511e61220
Reviewed-on: https://chromium-review.googlesource.com/844302
Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527907}
[modify] https://crrev.com/cc3dfaafc0fcdcb6e9360efe9a22b633cb3a1ab3/DEPS
[modify] https://crrev.com/cc3dfaafc0fcdcb6e9360efe9a22b633cb3a1ab3/third_party/openh264/README.chromium

Project Member

Comment 9 by bugdroid1@chromium.org, Jan 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/68194b17a062ed4167c27e669b3a71a1be8d3a7f

commit 68194b17a062ed4167c27e669b3a71a1be8d3a7f
Author: Sheng-Hao Tsao <shenghao@google.com>
Date: Wed Jan 17 11:02:59 2018

Reland "Reland Improve h264 encode efficiency for MediaRecorder"

Restrict the inclusion of ARM assembly sources to ARM only.
Patchset 1 is the original CL.

The original CL description is:

Restrict the inclusion of ARM assembly sources to ChromeOS only.
Patchset 2 is the original CL.

The original CL description is:

This CL enables multithread and NEON in openh264 for ChromeOS devices
by changing openh264 configurations and adding required definitions.

The effort is needed because currently MediaRecorder with openh264 encode
can only produce 4 FPS on minnie. Enabling multithread and NEON will
improve FPS to 21.

BUG= 797648 
TEST=Verified on minnie that recording FPS becomes 21, which is
comparable to FPS of the camera inside android container (22).

TBR=mcasas@chromium.org

Change-Id: I7e0fe6064a37d30398556413ed2c7d5f2e4e79ed
Reviewed-on: https://chromium-review.googlesource.com/856479
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Sheng-hao Tsao <shenghao@google.com>
Cr-Commit-Position: refs/heads/master@{#529704}
[modify] https://crrev.com/68194b17a062ed4167c27e669b3a71a1be8d3a7f/content/renderer/media_recorder/h264_encoder.cc
[modify] https://crrev.com/68194b17a062ed4167c27e669b3a71a1be8d3a7f/third_party/openh264/BUILD.gn
[modify] https://crrev.com/68194b17a062ed4167c27e669b3a71a1be8d3a7f/third_party/openh264/openh264_sources.gni

Status: Fixed (was: Assigned)

Sign in to add a comment