Skip to content

Commit

Permalink
Merge branch 'release/19.12.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Dec 15, 2019
2 parents 1471ca8 + 815f902 commit 237d6a5
Show file tree
Hide file tree
Showing 20 changed files with 169 additions and 57 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/daily_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ jobs:
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-18.04_armv8
working-directory: build
timeout-minutes: 120
build_ubuntu-16_04_armv7_ros:
name: Build momo for Ubuntu 16.04 armv7 ROS
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- run: .github/workflows/script/disk_cleanup.sh
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-16.04_armv7_ros
working-directory: build
timeout-minutes: 120
build_ubuntu-16_04_x86_64_ros:
name: Build momo for Ubuntu 16.04 x86_64 ROS
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- run: .github/workflows/script/disk_cleanup.sh
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-16.04_x86_64_ros
working-directory: build
timeout-minutes: 120
# build_ubuntu-16_04_armv7_ros:
# name: Build momo for Ubuntu 16.04 armv7 ROS
# runs-on: ubuntu-16.04
# steps:
# - uses: actions/checkout@v1
# - run: .github/workflows/script/disk_cleanup.sh
# - run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-16.04_armv7_ros
# working-directory: build
# timeout-minutes: 120
# build_ubuntu-16_04_x86_64_ros:
# name: Build momo for Ubuntu 16.04 x86_64 ROS
# runs-on: ubuntu-16.04
# steps:
# - uses: actions/checkout@v1
# - run: .github/workflows/script/disk_cleanup.sh
# - run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-16.04_x86_64_ros
# working-directory: build
# timeout-minutes: 120
19 changes: 17 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,24 @@
- FIX
- バグ修正

## develop
## 19.12.0

## 19.11.0
- [UPDATE] libwebrtc M79 コミットポジションを 5 にする
- libwebrtc のハッシュは b484ec0082948ae086c2ba4142b4d2bf8bc4dd4b
- @voluntas
- [UPDATE] json を 3.7.3 に上げる
- [ADD] sora モード利用時の --role に sendrecv | sendonly | recvonly を指定できるようにする
- @melpon
- [FIX] QVGA の指定を 320x240 にする
- @melpon @Bugfire
- [FIX] ayame モードで再接続時に segmentation fault が起こる場合があるのを修正する
- ただし、互いに接続を確立するまでping-pongを送らない/ping timeoutで再接続するまで数秒かかることがある」ので、再接続によって受信側が数秒待つ必要が出てくる可能性がある
- 上記の問題はこの修正では未解決
- @kdxu
- [FIX] OpenH264 を明示的にビルドしないようにする
- @melpon

## 19.11.1

- [ADD] Raspberry Pi 4 での動作を確認
- @voluntas @Hexa
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,18 @@ Momo はオープンソースソフトウェアですが、開発については
- Raspbian Buster ARMv6
- Raspberry Pi Zero W/WH で動作
- Ubuntu 18.04 x86_64
- Ubuntu 18.04 ARMv8
- Ubuntu 18.04 ARMv8 Jetson Nano
- [NVIDIA Jetson Nano](https://www.nvidia.com/ja-jp/autonomous-machines/embedded-systems/jetson-nano/)
- macOS 10.15 x86_64

### 以下はビルドが通ること以外は確認していません

- Ubuntu 18.04 ARMv8
- 今後削除予定
- Ubuntu 16.04 x86_64 ROS Kinetic
- http://wiki.ros.org/kinetic
- Ubuntu 16.04 ARMv7 ROS Kinetic
- Raspberry Pi 3 B+
- macOS 10.14 x86_64

## 使ってみる

Expand Down
1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ yuroyoro
roy-n-roy
tetsu-koba
TE-TakuyaSugitani
Bugfire
6 changes: 3 additions & 3 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 各種ライブラリのバージョン情報
# 項目を変更してビルドすれば各環境へ反映される(ように作る)
MOMO_VERSION=19.11.1
MOMO_VERSION=19.12.0
WEBRTC_VERSION=79
WEBRTC_COMMIT=2958d0d691526c60f755eaa364abcdbcda6adc39
WEBRTC_COMMIT=b484ec0082948ae086c2ba4142b4d2bf8bc4dd4b
BOOST_VERSION=1.71.0
JSON_VERSION=3.7.1
JSON_VERSION=3.7.3
CLI11_VERSION=1.8.0
SDL2_VERSION=2.0.10

Expand Down
23 changes: 12 additions & 11 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,23 @@ macos: macos.prepare

.PHONY: macos.package
macos.package: macos.prepare
$(eval MACOS_VERSION := $(shell sw_vers -productVersion | cut -d '.' -f-2))
# momo を package モードでビルドし直す
rm -f ../_build/macos/momo && make -C .. MOMO_CFLAGS="-O2 -fobjc-arc" PACKAGE_NAME=macos BUILD_MODE=package momo

# パッケージのバイナリを作る
rm -rf package/momo-$(MOMO_VERSION)_macos
rm -f package/momo-$(MOMO_VERSION)_macos.tar.gz
mkdir -p package/momo-$(MOMO_VERSION)_macos
cp ../_build/macos/momo package/momo-$(MOMO_VERSION)_macos/
cp ../LICENSE package/momo-$(MOMO_VERSION)_macos/
cp ../NOTICE package/momo-$(MOMO_VERSION)_macos/
cp -r ../html package/momo-$(MOMO_VERSION)_macos/html
cd package && tar czf momo-$(MOMO_VERSION)_macos.tar.gz momo-$(MOMO_VERSION)_macos

rm -rf package/momo-$(MOMO_VERSION)_macos
rm -rf package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)
rm -f package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION).tar.gz
mkdir -p package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)
cp ../_build/macos/momo package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)/
cp ../LICENSE package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)/
cp ../NOTICE package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)/
cp -r ../html package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)/html
cd package && tar czf momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION).tar.gz momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)

rm -rf package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION)
@echo ""
@echo "パッケージが package/momo-$(MOMO_VERSION)_macos.tar.gz に生成されました。"
@echo "パッケージが package/momo-$(MOMO_VERSION)_macos-$(MACOS_VERSION).tar.gz に生成されました。"

.PHONY: macos.prepare
macos.prepare:
Expand Down
2 changes: 1 addition & 1 deletion build/raspbian-buster_armv6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ENV PATH /root/webrtc/depot_tools:$PATH
RUN \
set -ex \
&& cd /root/webrtc/src \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=true rtc_include_tests=false arm_version=6 arm_arch="armv6" arm_tune="arm1176jzf-s" arm_fpu="vfpv2" arm_float_abi="hard" arm_use_neon=false is_desktop_linux=false rtc_build_json=true use_rtti=true' \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=false rtc_include_tests=false arm_version=6 arm_arch="armv6" arm_tune="arm1176jzf-s" arm_fpu="vfpv2" arm_float_abi="hard" arm_use_neon=false is_desktop_linux=false rtc_build_json=true use_rtti=true' \
&& ninja -C /root/webrtc-build/$PACKAGE_NAME

# Boost のビルド
Expand Down
2 changes: 1 addition & 1 deletion build/raspbian-buster_armv7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ENV PATH /root/webrtc/depot_tools:$PATH
RUN \
set -ex \
&& cd /root/webrtc/src \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=true rtc_include_tests=false is_desktop_linux=false rtc_build_json=true use_rtti=true' \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=false rtc_include_tests=false is_desktop_linux=false rtc_build_json=true use_rtti=true' \
&& ninja -C /root/webrtc-build/$PACKAGE_NAME

# Boost のビルド
Expand Down
2 changes: 1 addition & 1 deletion build/ubuntu-16.04_armv7_ros/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ENV PATH /root/webrtc/depot_tools:$PATH
RUN \
set -ex \
&& cd /root/webrtc/src \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=true rtc_include_tests=false use_rtti=true is_component_build=false is_desktop_linux=false use_custom_libcxx=false use_custom_libcxx_for_host=false dcheck_always_on=false' \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=false rtc_include_tests=false use_rtti=true is_component_build=false is_desktop_linux=false use_custom_libcxx=false use_custom_libcxx_for_host=false dcheck_always_on=false' \
&& ninja -C /root/webrtc-build/$PACKAGE_NAME

# Boost のビルド
Expand Down
2 changes: 1 addition & 1 deletion build/ubuntu-18.04_armv8_jetson_nano/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ENV PATH /root/webrtc/depot_tools:$PATH
RUN \
set -ex \
&& cd /root/webrtc/src \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm64" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=true rtc_include_tests=false rtc_build_json=true use_rtti=true is_desktop_linux=false' \
&& gn gen /root/webrtc-build/$PACKAGE_NAME --args='target_os="linux" target_cpu="arm64" is_debug=false target_sysroot="/root/rootfs" rtc_use_h264=false rtc_include_tests=false rtc_build_json=true use_rtti=true is_desktop_linux=false' \
&& ninja -C /root/webrtc-build/$PACKAGE_NAME

# Boost のビルド
Expand Down
6 changes: 3 additions & 3 deletions doc/USE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

## WebRTC SFU Sora を使って Momo を動かしてみる

時雨堂が開発、販売している商用の WebRTC SFU Sora を利用します。
時雨堂が開発、販売している WebRTC SFU Sora を利用します。

この機能を利用する場合は事前に Sora のライセンスを購入する必要がありますので、ご注意ください
[Sora Labo](https://sora-labo.shiguredo.jp/) を利用することで、 Sora を購入せずに無料で試すことが可能です

[USE_SORA.md](USE_SORA.md) をお読みください。
Sora Labo での使い方も書いてありますので、まずは [USE_SORA.md](USE_SORA.md) をお読みください。

## ROS ノードとして Momo を使ってみる

Expand Down
12 changes: 9 additions & 3 deletions doc/USE_JETSON_NANO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

## Jetson Nano を購入する

**スイッチサイエンスからの購入をおすすめします**

[Jetson Nano 開発者キット \- スイッチサイエンス](https://www.switch-science.com/catalog/5433/)
- [Jetson Nano 開発者キット](https://www.switch-science.com/catalog/5433/)
- 単体はこちらがおすすめ
- [NVIDIA NV\-JT\-N001\-CSK32 NVIDIA Jetson Nanoコンプリートスターターキット\(32GB\)](https://www.sengoku.co.jp/mod/sgk_cart/detail.php?code=EEHD-5FXJ)
- 全部入はこちらがおすすめ
- [【OLIOSPECオリジナル】NVIDIA Jetson Nano Developer kit用ケース\(長尾製作所製\)](https://www.oliospec.com/shopdetail/000000008491/)
- ケースはこちらがおすすめ
- [Noctua NF-A4x10 5V PWMサイレントファン40 mmプレミアムブラウン/ベージュ](https://amazon.co.jp/dp/B07DXS86G7)
- ファンはこちらがおすすめ

## 4K@30 出るカメラの購入する

Expand All @@ -16,6 +21,7 @@

- https://ja.aliexpress.com/item/33013268769.html
- https://ja.aliexpress.com/item/33016603918.html
- https://ja.aliexpress.com/item/33012473257.html

色々 4K@30 が出せるカメラを試してきましたが、このカメラが一番安定しています。

Expand Down
23 changes: 21 additions & 2 deletions doc/USE_SORA.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# WebRTC SFU Sora を使って Momo を動かしてみる

Sora は時雨堂が開発、販売している WebRTC SFU です。
ここでは [Sora Labo](https://sora-labo.shiguredo.jp/) は無料で Sora を試すことのできるサービスである Sora Labo を使った例を載せています。

## Sora Labo を使う

GitHub アカウントを用意して https://sora-labo.shiguredo.jp/ にサインアップしてください。

- チャネル ID に `GitHubUsername@好きな文字列` を指定してください
- --metadata を利用し取得したシグナリングキーを signaling_key を指定することで簡単に利用できます

```shell
$ ./momo --no-audio --port 0 sora --auto --video-codec VP8 --video-bitrate 500 wss://example.com/signaling open-momo
$ ./momo --no-audio --port 0 sora --auto --video-codec VP8 --video-bitrate 500 wss://sora-labo.shiguredo.jp/signaling shiguredo@sora-labo-open-momo --metadata '{"signaling_key": "ここにシグナリングキーを指定して下さい"}'
```

### マルチストリームで使ってみる

以下の OS の環境で GUI で使うことで送受信が可能です。

- macOS 15.10
- Ubuntu 18.04 Jetson Nano
- Raspbian

```
./momo --resolution VGA --no-audio --port 0 --use-sdl --show-me sora --auto --video-codec VP8 --video-bitrate 1000 wss://sora-labo.shiguredo.jp/signaling shiguredo@momo-sdl-sora --multistream --role upstream --metadata '{"signaling_key": "ここにシグナリングキーを指定して下さい"}'
```
6 changes: 5 additions & 1 deletion src/ayame/ayame_websocket_client.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "ayame_websocket_client.h"

#include <boost/beast/websocket/stream.hpp>

#include <nlohmann/json.hpp>

#include "url_parts.h"
#include "util.h"

Expand Down Expand Up @@ -355,6 +355,10 @@ void AyameWebsocketClient::onRead(boost::system::error_code ec,
candidate = ice["candidate"];
connection_->addIceCandidate(sdp_mid, sdp_mlineindex, candidate);
} else if (type == "ping") {
if (rtc_state_ != webrtc::PeerConnectionInterface::IceConnectionState::
kIceConnectionConnected) {
return;
}
watchdog_.reset();
doSendPong();
}
Expand Down
4 changes: 2 additions & 2 deletions src/connection_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct ConnectionSettings {

int getWidth() {
if (resolution == "QVGA") {
return 480;
return 320;
} else if (resolution == "HD") {
return 1280;
} else if (resolution == "FHD") {
Expand All @@ -73,7 +73,7 @@ struct ConnectionSettings {

int getHeight() {
if (resolution == "QVGA") {
return 320;
return 240;
} else if (resolution == "HD") {
return 720;
} else if (resolution == "FHD") {
Expand Down
19 changes: 19 additions & 0 deletions src/rtc/h264_format.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "h264_format.h"

// webrtc
#include "absl/types/optional.h"
#include "api/video_codecs/sdp_video_format.h"

// modules/video_coding/codecs/h264/h264.cc より
webrtc::SdpVideoFormat CreateH264Format(webrtc::H264::Profile profile,
webrtc::H264::Level level,
const std::string& packetization_mode) {
const absl::optional<std::string> profile_string =
webrtc::H264::ProfileLevelIdToString(
webrtc::H264::ProfileLevelId(profile, level));
return webrtc::SdpVideoFormat(
cricket::kH264CodecName,
{{cricket::kH264FmtpProfileLevelId, *profile_string},
{cricket::kH264FmtpLevelAsymmetryAllowed, "1"},
{cricket::kH264FmtpPacketizationMode, packetization_mode}});
}
13 changes: 13 additions & 0 deletions src/rtc/h264_format.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef RTC_H264_FORMAT_H_
#define RTC_H264_FORMAT_H_

#include <string>

#include "media/base/codec.h"
#include "media/base/h264_profile_level_id.h"

webrtc::SdpVideoFormat CreateH264Format(webrtc::H264::Profile profile,
webrtc::H264::Level level,
const std::string& packetization_mode);

#endif // RTC_H264_FORMAT_H_
18 changes: 16 additions & 2 deletions src/rtc/hw_video_decoder_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "hwenc_jetson/jetson_video_decoder.h"
#endif

#include "h264_format.h"

namespace {

bool IsFormatSupported(
Expand All @@ -47,8 +49,20 @@ std::vector<webrtc::SdpVideoFormat> HWVideoDecoderFactory::GetSupportedFormats()
formats.push_back(webrtc::SdpVideoFormat(cricket::kVp8CodecName));
for (const webrtc::SdpVideoFormat& format : webrtc::SupportedVP9Codecs())
formats.push_back(format);
for (const webrtc::SdpVideoFormat& h264_format : webrtc::SupportedH264Codecs())

std::vector<webrtc::SdpVideoFormat> h264_codecs = {
CreateH264Format(webrtc::H264::kProfileBaseline, webrtc::H264::kLevel3_1,
"1"),
CreateH264Format(webrtc::H264::kProfileBaseline, webrtc::H264::kLevel3_1,
"0"),
CreateH264Format(webrtc::H264::kProfileConstrainedBaseline,
webrtc::H264::kLevel3_1, "1"),
CreateH264Format(webrtc::H264::kProfileConstrainedBaseline,
webrtc::H264::kLevel3_1, "0")};

for (const webrtc::SdpVideoFormat& h264_format : h264_codecs)
formats.push_back(h264_format);

return formats;
}

Expand Down Expand Up @@ -80,4 +94,4 @@ std::unique_ptr<webrtc::VideoDecoder> HWVideoDecoderFactory::CreateVideoDecoder(

RTC_NOTREACHED();
return nullptr;
}
}
17 changes: 15 additions & 2 deletions src/rtc/hw_video_encoder_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,26 @@
#include "hwenc_jetson/jetson_h264_encoder.h"
#endif

#include "h264_format.h"

std::vector<webrtc::SdpVideoFormat> HWVideoEncoderFactory::GetSupportedFormats()
const {
std::vector<webrtc::SdpVideoFormat> supported_codecs;
supported_codecs.push_back(webrtc::SdpVideoFormat(cricket::kVp8CodecName));
for (const webrtc::SdpVideoFormat& format : webrtc::SupportedVP9Codecs())
supported_codecs.push_back(format);
for (const webrtc::SdpVideoFormat& format : webrtc::SupportedH264Codecs())

std::vector<webrtc::SdpVideoFormat> h264_codecs = {
CreateH264Format(webrtc::H264::kProfileBaseline, webrtc::H264::kLevel3_1,
"1"),
CreateH264Format(webrtc::H264::kProfileBaseline, webrtc::H264::kLevel3_1,
"0"),
CreateH264Format(webrtc::H264::kProfileConstrainedBaseline,
webrtc::H264::kLevel3_1, "1"),
CreateH264Format(webrtc::H264::kProfileConstrainedBaseline,
webrtc::H264::kLevel3_1, "0")};

for (const webrtc::SdpVideoFormat& format : h264_codecs)
supported_codecs.push_back(format);

return supported_codecs;
Expand Down Expand Up @@ -62,4 +75,4 @@ std::unique_ptr<webrtc::VideoEncoder> HWVideoEncoderFactory::CreateVideoEncoder(
RTC_LOG(LS_ERROR) << "Trying to created encoder of unsupported format "
<< format.name;
return nullptr;
}
}
Loading

0 comments on commit 237d6a5

Please sign in to comment.