sora-sdk 2025.1.0.dev6__tar.gz → 2025.1.0.dev9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sora-sdk might be problematic. Click here for more details.

Files changed (43) hide show
  1. {sora_sdk-2025.1.0.dev6/src/sora_sdk.egg-info → sora_sdk-2025.1.0.dev9}/PKG-INFO +5 -1
  2. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/README.md +4 -0
  3. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/pyproject.toml +1 -1
  4. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/src/sora_sdk/sora_sdk_ext.cpython-310-darwin.so +0 -0
  5. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9/src/sora_sdk.egg-info}/PKG-INFO +5 -1
  6. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/src/sora_sdk.egg-info/SOURCES.txt +2 -0
  7. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_authz_simulcast.py +39 -0
  8. sora_sdk-2025.1.0.dev9/tests/test_codec_preference.py +124 -0
  9. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_intel_vpl.py +130 -2
  10. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_nvidia_video_codec_sdk.py +27 -26
  11. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_openh264.py +0 -2
  12. sora_sdk-2025.1.0.dev9/tests/test_opus.py +68 -0
  13. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/LICENSE +0 -0
  14. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/MANIFEST.in +0 -0
  15. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/NOTICE.md +0 -0
  16. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/buildbase.py +0 -0
  17. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/pypath.py +0 -0
  18. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/run.py +0 -0
  19. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/setup.cfg +0 -0
  20. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/setup.py +0 -0
  21. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/src/sora_sdk/__init__.py +0 -0
  22. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/src/sora_sdk/py.typed +0 -0
  23. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/src/sora_sdk/sora_sdk_ext.pyi +0 -0
  24. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/src/sora_sdk.egg-info/dependency_links.txt +0 -0
  25. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/src/sora_sdk.egg-info/top_level.txt +0 -0
  26. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_apple_video_toolbox.py +0 -0
  27. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_authz.py +0 -0
  28. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_ca_cert.py +0 -0
  29. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_capability.py +0 -0
  30. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_degradation_preference.py +0 -0
  31. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_encoded_transform.py +0 -0
  32. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_messaging.py +0 -0
  33. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_messaging_header.py +0 -0
  34. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_re_offer_re_answer_sdp.py +0 -0
  35. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_sendonly_recvonly.py +0 -0
  36. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_signaling.py +0 -0
  37. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_signaling_message.py +0 -0
  38. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_signaling_notify.py +0 -0
  39. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_simulcast.py +0 -0
  40. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_sora_disconnect.py +0 -0
  41. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_type_disconnect.py +0 -0
  42. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_type_switched.py +0 -0
  43. {sora_sdk-2025.1.0.dev6 → sora_sdk-2025.1.0.dev9}/tests/test_vad.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sora_sdk
3
- Version: 2025.1.0.dev6
3
+ Version: 2025.1.0.dev9
4
4
  Summary: WebRTC SFU Sora Python SDK
5
5
  Home-page: https://github.com/shiguredo/sora-python-sdk
6
6
  Author-email: "Shiguredo Inc." <contact+pypi@shiguredo.jp>
@@ -233,11 +233,15 @@ Please read <https://github.com/shiguredo/oss/blob/master/README.en.md> before u
233
233
  - MAINTAIN_FRAMERATE / MAINTAIN_RESOLUTION / BALANCED が指定できる
234
234
  - Intel / Apple / NVIDIA のハードウェアデコーダー/エンコーダーに対応
235
235
  - Intel VPL (AV1 / H.264 / H.265)
236
+ - Ubuntu x86_64 / Windows x86_64 で利用できる
236
237
  - Apple Video Toolbox (H.264 / H.265)
238
+ - macOS arm64 で利用できる
237
239
  - NVIDIA Video Codec SDK (VP9 / H.264 / H.265)
240
+ - Ubuntu x86_64 / Windows x86_64 で利用できる
238
241
  - NVIDIA Jetson JetPack SDK (AV1 / H.264 / H.265)
239
242
  - [各プラットフォームで利用可能な HWA への対応](https://github.com/shiguredo/sora-cpp-sdk?tab=readme-ov-file#%E7%89%B9%E5%BE%B4)
240
243
  - [OpenH264](https://github.com/cisco/openh264) を利用した H.264 のソフトウェアエンコーダー/デコーダーに対応
244
+ - Ubuntu x86_64 / Ubuntu arm64 / Windows x86_64 / macOS arm64 で利用できる
241
245
  - 音声デバイス処理に [sounddevice](https://pypi.org/project/sounddevice/) などが利用できる
242
246
  - 映像デバイス処理に [opencv-python](https://pypi.org/project/opencv-python/) などが利用できる
243
247
  - 音声認識などの入力に受信した音声を利用できる
@@ -34,11 +34,15 @@ Please read <https://github.com/shiguredo/oss/blob/master/README.en.md> before u
34
34
  - MAINTAIN_FRAMERATE / MAINTAIN_RESOLUTION / BALANCED が指定できる
35
35
  - Intel / Apple / NVIDIA のハードウェアデコーダー/エンコーダーに対応
36
36
  - Intel VPL (AV1 / H.264 / H.265)
37
+ - Ubuntu x86_64 / Windows x86_64 で利用できる
37
38
  - Apple Video Toolbox (H.264 / H.265)
39
+ - macOS arm64 で利用できる
38
40
  - NVIDIA Video Codec SDK (VP9 / H.264 / H.265)
41
+ - Ubuntu x86_64 / Windows x86_64 で利用できる
39
42
  - NVIDIA Jetson JetPack SDK (AV1 / H.264 / H.265)
40
43
  - [各プラットフォームで利用可能な HWA への対応](https://github.com/shiguredo/sora-cpp-sdk?tab=readme-ov-file#%E7%89%B9%E5%BE%B4)
41
44
  - [OpenH264](https://github.com/cisco/openh264) を利用した H.264 のソフトウェアエンコーダー/デコーダーに対応
45
+ - Ubuntu x86_64 / Ubuntu arm64 / Windows x86_64 / macOS arm64 で利用できる
42
46
  - 音声デバイス処理に [sounddevice](https://pypi.org/project/sounddevice/) などが利用できる
43
47
  - 映像デバイス処理に [opencv-python](https://pypi.org/project/opencv-python/) などが利用できる
44
48
  - 音声認識などの入力に受信した音声を利用できる
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "sora_sdk"
3
3
  authors = [{ name = "Shiguredo Inc.", email = "contact+pypi@shiguredo.jp" }]
4
- version = "2025.1.0.dev6"
4
+ version = "2025.1.0.dev9"
5
5
  description = "WebRTC SFU Sora Python SDK"
6
6
  readme = "README.md"
7
7
  license = { file = "LICENSE" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sora_sdk
3
- Version: 2025.1.0.dev6
3
+ Version: 2025.1.0.dev9
4
4
  Summary: WebRTC SFU Sora Python SDK
5
5
  Home-page: https://github.com/shiguredo/sora-python-sdk
6
6
  Author-email: "Shiguredo Inc." <contact+pypi@shiguredo.jp>
@@ -233,11 +233,15 @@ Please read <https://github.com/shiguredo/oss/blob/master/README.en.md> before u
233
233
  - MAINTAIN_FRAMERATE / MAINTAIN_RESOLUTION / BALANCED が指定できる
234
234
  - Intel / Apple / NVIDIA のハードウェアデコーダー/エンコーダーに対応
235
235
  - Intel VPL (AV1 / H.264 / H.265)
236
+ - Ubuntu x86_64 / Windows x86_64 で利用できる
236
237
  - Apple Video Toolbox (H.264 / H.265)
238
+ - macOS arm64 で利用できる
237
239
  - NVIDIA Video Codec SDK (VP9 / H.264 / H.265)
240
+ - Ubuntu x86_64 / Windows x86_64 で利用できる
238
241
  - NVIDIA Jetson JetPack SDK (AV1 / H.264 / H.265)
239
242
  - [各プラットフォームで利用可能な HWA への対応](https://github.com/shiguredo/sora-cpp-sdk?tab=readme-ov-file#%E7%89%B9%E5%BE%B4)
240
243
  - [OpenH264](https://github.com/cisco/openh264) を利用した H.264 のソフトウェアエンコーダー/デコーダーに対応
244
+ - Ubuntu x86_64 / Ubuntu arm64 / Windows x86_64 / macOS arm64 で利用できる
241
245
  - 音声デバイス処理に [sounddevice](https://pypi.org/project/sounddevice/) などが利用できる
242
246
  - 映像デバイス処理に [opencv-python](https://pypi.org/project/opencv-python/) などが利用できる
243
247
  - 音声認識などの入力に受信した音声を利用できる
@@ -20,6 +20,7 @@ tests/test_authz.py
20
20
  tests/test_authz_simulcast.py
21
21
  tests/test_ca_cert.py
22
22
  tests/test_capability.py
23
+ tests/test_codec_preference.py
23
24
  tests/test_degradation_preference.py
24
25
  tests/test_encoded_transform.py
25
26
  tests/test_intel_vpl.py
@@ -27,6 +28,7 @@ tests/test_messaging.py
27
28
  tests/test_messaging_header.py
28
29
  tests/test_nvidia_video_codec_sdk.py
29
30
  tests/test_openh264.py
31
+ tests/test_opus.py
30
32
  tests/test_re_offer_re_answer_sdp.py
31
33
  tests/test_sendonly_recvonly.py
32
34
  tests/test_signaling.py
@@ -19,6 +19,7 @@ from client import SoraClient, SoraRole
19
19
  # どうやら scaleResolutionDownTo を指定すると規定されたテーブルのビットレートでは足りない模様
20
20
  ("VP8", "libvpx", 2500, 960, 540),
21
21
  ("VP9", "libvpx", 2000, 960, 540),
22
+ ("AV1", "libaom", 2500, 960, 540),
22
23
  ],
23
24
  )
24
25
  def test_simulcast_authz_scale_resolution_to(
@@ -92,6 +93,43 @@ def test_simulcast_authz_scale_resolution_to(
92
93
  assert "a=simulcast:recv r0;r1;r2" in sendonly.offer_message["sdp"]
93
94
  sendonly_stats = sendonly.get_stats()
94
95
 
96
+ assert "encodings" in sendonly.offer_message
97
+ assert len(sendonly.offer_message["encodings"]) == 3
98
+
99
+ assert sendonly.offer_message["encodings"][0]["rid"] == simulcast_encodings[0]["rid"]
100
+ assert sendonly.offer_message["encodings"][1]["rid"] == simulcast_encodings[1]["rid"]
101
+ assert sendonly.offer_message["encodings"][2]["rid"] == simulcast_encodings[2]["rid"]
102
+
103
+ assert sendonly.offer_message["encodings"][0]["active"] == simulcast_encodings[0]["active"]
104
+ assert sendonly.offer_message["encodings"][1]["active"] == simulcast_encodings[1]["active"]
105
+ assert sendonly.offer_message["encodings"][2]["active"] == simulcast_encodings[2]["active"]
106
+
107
+ assert (
108
+ sendonly.offer_message["encodings"][0]["scaleResolutionDownTo"]["maxWidth"]
109
+ == simulcast_encodings[0]["scaleResolutionDownTo"]["maxWidth"]
110
+ )
111
+ assert (
112
+ sendonly.offer_message["encodings"][1]["scaleResolutionDownTo"]["maxWidth"]
113
+ == simulcast_encodings[1]["scaleResolutionDownTo"]["maxWidth"]
114
+ )
115
+ assert (
116
+ sendonly.offer_message["encodings"][2]["scaleResolutionDownTo"]["maxWidth"]
117
+ == simulcast_encodings[2]["scaleResolutionDownTo"]["maxWidth"]
118
+ )
119
+
120
+ assert (
121
+ sendonly.offer_message["encodings"][0]["scalabilityMode"]
122
+ == simulcast_encodings[0]["scalabilityMode"]
123
+ )
124
+ assert (
125
+ sendonly.offer_message["encodings"][1]["scalabilityMode"]
126
+ == simulcast_encodings[1]["scalabilityMode"]
127
+ )
128
+ assert (
129
+ sendonly.offer_message["encodings"][2]["scalabilityMode"]
130
+ == simulcast_encodings[2]["scalabilityMode"]
131
+ )
132
+
95
133
  sendonly.disconnect()
96
134
 
97
135
  # "type": "answer" の SDP で Simulcast があるかどうか
@@ -140,6 +178,7 @@ def test_simulcast_authz_scale_resolution_to(
140
178
  s["rid"],
141
179
  video_codec_type,
142
180
  s["encoderImplementation"],
181
+ s["scalabilityMode"],
143
182
  expected_bitrate,
144
183
  s["targetBitrate"],
145
184
  s["frameWidth"],
@@ -0,0 +1,124 @@
1
+ import sys
2
+
3
+ from sora_sdk import (
4
+ Sora,
5
+ SoraVideoCodecImplementation,
6
+ SoraVideoCodecPreference,
7
+ SoraVideoCodecType,
8
+ get_video_codec_capability,
9
+ )
10
+
11
+
12
+ # このテストでは Linux では NVIDIA Video Codec SDK > Intel VPL > OpenH264 の順で優先される
13
+ # このテストでは Windows では NVIDIA Video Codec SDK > Intel VPL の順で優先される
14
+ # このテストでは macOS では Video Toolbox >OpenH264 の順で優先される
15
+ def test_get_codec_capability(setup):
16
+ openh264_path = setup.get("openh264_path")
17
+ capability = get_video_codec_capability(openh264_path)
18
+
19
+ intel_vpl_available = False
20
+ cisco_openh264_available = False
21
+ nvidia_video_codec_sdk_available = False
22
+
23
+ for e in capability.engines:
24
+ if e.name == SoraVideoCodecImplementation.INTEL_VPL:
25
+ intel_vpl_available = True
26
+ if e.name == SoraVideoCodecImplementation.CISCO_OPENH264:
27
+ cisco_openh264_available = True
28
+ if e.name == SoraVideoCodecImplementation.NVIDIA_VIDEO_CODEC_SDK:
29
+ nvidia_video_codec_sdk_available = True
30
+
31
+ match sys.platform:
32
+ case "linux":
33
+ assert openh264_path is not None
34
+ assert cisco_openh264_available is True
35
+ case "darwin":
36
+ assert openh264_path is not None
37
+ assert cisco_openh264_available is True
38
+ case "win32":
39
+ # SDK 的には Windows は非対応だが GitHub Actions の E2E テストの OpenH264 のパスは指定してある
40
+ assert openh264_path is not None
41
+ assert cisco_openh264_available is True
42
+
43
+ codecs = []
44
+ for e in capability.engines:
45
+ if sys.platform == "linux":
46
+ # Intel VPL があったら Open H.264 は採用しない
47
+ if intel_vpl_available and e.name == SoraVideoCodecImplementation.CISCO_OPENH264:
48
+ continue
49
+
50
+ # NVIDIA Video Codec SDK があったら Intel VPL は採用しない
51
+ if (
52
+ nvidia_video_codec_sdk_available
53
+ and e.name == SoraVideoCodecImplementation.INTEL_VPL
54
+ ):
55
+ continue
56
+
57
+ # NVIDIA Video Codec SDK があったら OpenH264 は採用しない
58
+ if (
59
+ nvidia_video_codec_sdk_available
60
+ and e.name == SoraVideoCodecImplementation.CISCO_OPENH264
61
+ ):
62
+ continue
63
+
64
+ # macOS では INTERNAL の Video Toolbox が利用されるので OpenH264 は採用しないようにする
65
+ if sys.platform == "darwin":
66
+ if e.name == SoraVideoCodecImplementation.CISCO_OPENH264:
67
+ continue
68
+
69
+ for c in e.codecs:
70
+ if c.decoder or c.encoder:
71
+ # encoder/decoder どちらかが true であれば採用する
72
+ if c.decoder or c.encoder:
73
+ codecs.append(
74
+ SoraVideoCodecPreference.Codec(
75
+ type=c.type,
76
+ decoder=e.name,
77
+ encoder=e.name,
78
+ )
79
+ )
80
+
81
+ # print(e.parameters.nvcodec_gpu_device_name)
82
+ # print(e.parameters.openh264_path)
83
+ # print(e.parameters.version)
84
+ # print(e.parameters.vpl_impl)
85
+ # print(e.parameters.vpl_impl_value)
86
+
87
+ Sora(
88
+ video_codec_preference=SoraVideoCodecPreference(
89
+ codecs=codecs,
90
+ ),
91
+ openh264=openh264_path,
92
+ )
93
+
94
+
95
+ def test_video_codec_preference(setup):
96
+ openh264_path = setup.get("openh264_path")
97
+ Sora(
98
+ video_codec_preference=SoraVideoCodecPreference(
99
+ codecs=[
100
+ SoraVideoCodecPreference.Codec(
101
+ type=SoraVideoCodecType.VP8,
102
+ decoder=SoraVideoCodecImplementation.INTERNAL,
103
+ encoder=SoraVideoCodecImplementation.INTERNAL,
104
+ ),
105
+ SoraVideoCodecPreference.Codec(
106
+ type=SoraVideoCodecType.VP9,
107
+ decoder=SoraVideoCodecImplementation.INTERNAL,
108
+ encoder=SoraVideoCodecImplementation.INTERNAL,
109
+ ),
110
+ SoraVideoCodecPreference.Codec(
111
+ type=SoraVideoCodecType.AV1,
112
+ decoder=SoraVideoCodecImplementation.INTERNAL,
113
+ encoder=SoraVideoCodecImplementation.INTERNAL,
114
+ ),
115
+ # H.264 だけは OpenH264 を利用するようにする
116
+ SoraVideoCodecPreference.Codec(
117
+ type=SoraVideoCodecType.H264,
118
+ decoder=SoraVideoCodecImplementation.CISCO_OPENH264,
119
+ encoder=SoraVideoCodecImplementation.CISCO_OPENH264,
120
+ ),
121
+ ],
122
+ ),
123
+ openh264=openh264_path,
124
+ )
@@ -10,10 +10,49 @@ from sora_sdk import (
10
10
  SoraVideoCodecImplementation,
11
11
  SoraVideoCodecPreference,
12
12
  SoraVideoCodecType,
13
+ get_video_codec_capability,
13
14
  )
14
15
 
15
16
 
16
- # @pytest.mark.skip()
17
+ @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
18
+ def test_intel_vpl_available(setup):
19
+ capability = get_video_codec_capability()
20
+
21
+ intel_vpl_available = False
22
+ for e in capability.engines:
23
+ if e.name == SoraVideoCodecImplementation.INTEL_VPL:
24
+ intel_vpl_available = True
25
+
26
+ assert intel_vpl_available is True
27
+
28
+ for e in capability.engines:
29
+ if e.name == SoraVideoCodecImplementation.INTEL_VPL:
30
+ # 対応コーデックは 5 種類
31
+ assert len(e.codecs) == 5
32
+
33
+ for c in e.codecs:
34
+ match c.type:
35
+ case SoraVideoCodecType.VP8:
36
+ assert c.decoder is False
37
+ assert c.encoder is False
38
+ case SoraVideoCodecType.VP9:
39
+ assert c.decoder is True
40
+ # VPL 的に VP9 は利用できるが、
41
+ # Sora Python SDK では VPL VP9 Encoder が正常に動作しないため無効
42
+ assert c.encoder is False
43
+ case SoraVideoCodecType.AV1:
44
+ assert c.decoder is True
45
+ assert c.encoder is True
46
+ case SoraVideoCodecType.H264:
47
+ assert c.decoder is True
48
+ assert c.encoder is True
49
+ case SoraVideoCodecType.H265:
50
+ assert c.decoder is True
51
+ assert c.encoder is True
52
+ case _:
53
+ pytest.fail(f"未実装の codec_type: {c.type}")
54
+
55
+
17
56
  @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
18
57
  @pytest.mark.parametrize(
19
58
  (
@@ -23,6 +62,8 @@ from sora_sdk import (
23
62
  "preference_codec_implementation",
24
63
  ),
25
64
  [
65
+ # VPL では VP9 が正常に動作しない
66
+ # ("VP9", SoraVideoCodecType.VP9, "libvpl", SoraVideoCodecImplementation.INTEL_VPL),
26
67
  ("AV1", SoraVideoCodecType.AV1, "libvpl", SoraVideoCodecImplementation.INTEL_VPL),
27
68
  ("H264", SoraVideoCodecType.H264, "libvpl", SoraVideoCodecImplementation.INTEL_VPL),
28
69
  ("H265", SoraVideoCodecType.H265, "libvpl", SoraVideoCodecImplementation.INTEL_VPL),
@@ -253,7 +294,6 @@ def test_intel_vpl_simulcast(
253
294
  assert s["packetsSent"] <= 2
254
295
 
255
296
 
256
- # @pytest.mark.skip()
257
297
  @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
258
298
  @pytest.mark.parametrize(
259
299
  (
@@ -429,6 +469,94 @@ def test_intel_vpl_vp9_sendonly(setup, video_codec_type, expected_implementation
429
469
  assert outbound_rtp_stats["packetsSent"] > 0
430
470
 
431
471
 
472
+ @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
473
+ def test_intel_vpl_vp9_sendonly_recvonly(setup):
474
+ """
475
+ VPL VP9 はデコーダーは利用できるので、そのテスト
476
+ """
477
+ signaling_urls = setup.get("signaling_urls")
478
+ channel_id_prefix = setup.get("channel_id_prefix")
479
+ metadata = setup.get("metadata")
480
+
481
+ channel_id = f"{channel_id_prefix}_{__name__}_{sys._getframe().f_code.co_name}_{uuid.uuid4()}"
482
+
483
+ sendonly = SoraClient(
484
+ signaling_urls,
485
+ SoraRole.SENDONLY,
486
+ channel_id,
487
+ audio=False,
488
+ video=True,
489
+ video_codec_type="VP9",
490
+ metadata=metadata,
491
+ video_codec_preference=SoraVideoCodecPreference(
492
+ codecs=[
493
+ SoraVideoCodecPreference.Codec(
494
+ type=SoraVideoCodecType.VP9,
495
+ # VPL で VP9 Encoder は正常に動作しないので無効化しているので INTERNAL を指定
496
+ encoder=SoraVideoCodecImplementation.INTERNAL,
497
+ ),
498
+ ]
499
+ ),
500
+ )
501
+ sendonly.connect(fake_video=True)
502
+
503
+ recvonly = SoraClient(
504
+ signaling_urls,
505
+ SoraRole.RECVONLY,
506
+ channel_id,
507
+ metadata=metadata,
508
+ video_codec_preference=SoraVideoCodecPreference(
509
+ codecs=[
510
+ SoraVideoCodecPreference.Codec(
511
+ type=SoraVideoCodecType.VP9,
512
+ decoder=SoraVideoCodecImplementation.INTEL_VPL,
513
+ ),
514
+ ]
515
+ ),
516
+ )
517
+ recvonly.connect()
518
+
519
+ time.sleep(5)
520
+
521
+ sendonly_stats = sendonly.get_stats()
522
+ recvonly_stats = recvonly.get_stats()
523
+
524
+ sendonly.disconnect()
525
+ recvonly.disconnect()
526
+
527
+ # offer の sdp に video_codec_type が含まれているかどうかを確認している
528
+ assert sendonly.offer_message is not None
529
+ assert "sdp" in sendonly.offer_message
530
+ assert "VP9" in sendonly.offer_message["sdp"]
531
+
532
+ # answer の sdp に video_codec_type が含まれているかどうかを確認している
533
+ assert sendonly.answer_message is not None
534
+ assert "sdp" in sendonly.answer_message
535
+ assert "VP9" in sendonly.answer_message["sdp"]
536
+
537
+ # codec が無かったら StopIteration 例外が上がる
538
+ sendonly_codec_stats = next(s for s in sendonly_stats if s.get("type") == "codec")
539
+ # VP9 が採用されているかどうか確認する
540
+ assert sendonly_codec_stats["mimeType"] == "video/VP9"
541
+
542
+ # outbound-rtp が無かったら StopIteration 例外が上がる
543
+ outbound_rtp_stats = next(s for s in sendonly_stats if s.get("type") == "outbound-rtp")
544
+ assert outbound_rtp_stats["encoderImplementation"] == "libvpx"
545
+ assert outbound_rtp_stats["bytesSent"] > 0
546
+ assert outbound_rtp_stats["packetsSent"] > 0
547
+
548
+ # codec が無かったら StopIteration 例外が上がる
549
+ recvonly_codec_stats = next(s for s in recvonly_stats if s.get("type") == "codec")
550
+ # VP9 が採用されているかどうか確認する
551
+ assert recvonly_codec_stats["mimeType"] == "video/VP9"
552
+
553
+ # inbound-rtp が無かったら StopIteration 例外が上がる
554
+ inbound_rtp_stats = next(s for s in recvonly_stats if s.get("type") == "inbound-rtp")
555
+ assert inbound_rtp_stats["decoderImplementation"] == "libvpl"
556
+ assert inbound_rtp_stats["bytesReceived"] > 0
557
+ assert inbound_rtp_stats["packetsReceived"] > 0
558
+
559
+
432
560
  @pytest.mark.xfail(
433
561
  strict=True, reason="AV1 は解像度が 120x90 以下の場合に正常に処理ができない問題がある"
434
562
  )
@@ -19,10 +19,10 @@ from sora_sdk import SoraVideoCodecImplementation, SoraVideoCodecPreference, Sor
19
19
  "expected_implementation",
20
20
  ),
21
21
  [
22
- ("VP9", "NVIDIA Video Codec SDK"),
23
- ("AV1", "NVIDIA Video Codec SDK"),
24
- ("H264", "NVIDIA Video Codec SDK"),
25
- ("H265", "NVIDIA Video Codec SDK"),
22
+ ("VP9", "NvCodec"),
23
+ ("AV1", "NvCodec"),
24
+ ("H264", "NvCodec"),
25
+ ("H265", "NvCodec"),
26
26
  ],
27
27
  )
28
28
  def test_intel_vpl_sendonly(setup, video_codec_type, expected_implementation):
@@ -108,31 +108,31 @@ def test_intel_vpl_sendonly(setup, video_codec_type, expected_implementation):
108
108
  # FIXME: AV1 では、解像度が一定数より低くなる場合、エラーになるのでコメントアウトしている
109
109
  [
110
110
  # 1080p
111
- ("VP9", "NVIDIA Video Codec SDK", 5000, 1920, 1080, 3),
112
- ("H264", "NVIDIA Video Codec SDK", 5000, 1920, 1080, 3),
113
- ("H265", "NVIDIA Video Codec SDK", 5000, 1920, 1080, 3),
111
+ ("VP9", "NvCodec", 5000, 1920, 1080, 3),
112
+ ("H264", "NvCodec", 5000, 1920, 1080, 3),
113
+ ("H265", "NvCodec", 5000, 1920, 1080, 3),
114
114
  # 720p
115
- ("VP9", "NVIDIA Video Codec SDK", 2500, 1280, 720, 3),
116
- ("H264", "NVIDIA Video Codec SDK", 2500, 1280, 720, 3),
117
- ("H265", "NVIDIA Video Codec SDK", 2500, 1280, 720, 3),
115
+ ("VP9", "NvCodec", 2500, 1280, 720, 3),
116
+ ("H264", "NvCodec", 2500, 1280, 720, 3),
117
+ ("H265", "NvCodec", 2500, 1280, 720, 3),
118
118
  # 540p
119
- ("VP9", "NVIDIA Video Codec SDK", 1200, 960, 540, 3),
120
- ("H264", "NVIDIA Video Codec SDK", 1200, 960, 540, 3),
121
- ("H265", "NVIDIA Video Codec SDK", 1200, 960, 540, 3),
119
+ ("VP9", "NvCodec", 1200, 960, 540, 3),
120
+ ("H264", "NvCodec", 1200, 960, 540, 3),
121
+ ("H265", "NvCodec", 1200, 960, 540, 3),
122
122
  # 360p
123
- ("VP9", "NVIDIA Video Codec SDK", 700, 640, 360, 2),
124
- ("H264", "NVIDIA Video Codec SDK", 700, 640, 360, 2),
125
- ("H265", "NVIDIA Video Codec SDK", 700, 640, 360, 2),
123
+ ("VP9", "NvCodec", 700, 640, 360, 2),
124
+ ("H264", "NvCodec", 700, 640, 360, 2),
125
+ ("H265", "NvCodec", 700, 640, 360, 2),
126
126
  # 270p
127
- ("VP9", "NVIDIA Video Codec SDK", 450, 480, 270, 2),
128
- ("H264", "NVIDIA Video Codec SDK", 450, 480, 270, 2),
129
- ("H265", "NVIDIA Video Codec SDK", 450, 480, 270, 2),
127
+ ("VP9", "NvCodec", 450, 480, 270, 2),
128
+ ("H264", "NvCodec", 450, 480, 270, 2),
129
+ ("H265", "NvCodec", 450, 480, 270, 2),
130
130
  # 180p
131
- ("VP9", "NVIDIA Video Codec SDK", 200, 320, 180, 1),
132
- ("H264", "NVIDIA Video Codec SDK", 200, 320, 180, 1),
133
- ("H265", "NVIDIA Video Codec SDK", 142, 320, 180, 1),
131
+ ("VP9", "NvCodec", 200, 320, 180, 1),
132
+ ("H264", "NvCodec", 200, 320, 180, 1),
133
+ ("H265", "NvCodec", 142, 320, 180, 1),
134
134
  # 135p
135
- ("H265", "NVIDIA Video Codec SDK", 101, 240, 135, 1),
135
+ ("H265", "NvCodec", 101, 240, 135, 1),
136
136
  ],
137
137
  )
138
138
  def test_intel_vpl_simulcast(
@@ -258,9 +258,10 @@ def test_intel_vpl_simulcast(
258
258
  "expected_implementation",
259
259
  ),
260
260
  [
261
- ("VP9", "NVIDIA Video Codec SDK"),
262
- ("H264", "NVIDIA Video Codec SDK"),
263
- ("H265", "NVIDIA Video Codec SDK"),
261
+ ("VP9", "NvCodec"),
262
+ ("AV1", "NvCodec"),
263
+ ("H264", "NvCodec"),
264
+ ("H265", "NvCodec"),
264
265
  ],
265
266
  )
266
267
  def test_intel_vpl_sendonly_recvonly(setup, video_codec_type, expected_implementation):
@@ -12,7 +12,6 @@ from sora_sdk import (
12
12
  )
13
13
 
14
14
 
15
- @pytest.mark.skipif(sys.platform not in ["darwin", "linux"], reason="macOSとLinuxでのみ実行する")
16
15
  def test_openh264_sendonly_recvonly(setup):
17
16
  signaling_urls = setup.get("signaling_urls")
18
17
  channel_id_prefix = setup.get("channel_id_prefix")
@@ -88,7 +87,6 @@ def test_openh264_sendonly_recvonly(setup):
88
87
  assert inbound_rtp_stats["packetsReceived"] > 0
89
88
 
90
89
 
91
- @pytest.mark.skipif(sys.platform not in ["darwin", "linux"], reason="macOSとLinuxでのみ実行する")
92
90
  @pytest.mark.parametrize(
93
91
  (
94
92
  "video_codec_type",
@@ -0,0 +1,68 @@
1
+ import sys
2
+ import time
3
+ import uuid
4
+
5
+ from client import SoraClient, SoraRole
6
+
7
+ # opus params のテストは test_signaling.py にある
8
+
9
+ # https://tex2e.github.io/rfc-translater/html/rfc7587.html
10
+
11
+
12
+ def test_sendonly_audio_opus_params_16khz_mono(setup):
13
+ """
14
+ SDP では 48000/2 だが、Opus の設定で 16000/1 を配信してみる
15
+ """
16
+ signaling_urls = setup.get("signaling_urls")
17
+ channel_id_prefix = setup.get("channel_id_prefix")
18
+ metadata = setup.get("metadata")
19
+
20
+ channel_id = f"{channel_id_prefix}_{__name__}_{sys._getframe().f_code.co_name}_{uuid.uuid4()}"
21
+
22
+ with SoraClient(
23
+ signaling_urls,
24
+ SoraRole.SENDONLY,
25
+ channel_id,
26
+ audio=True,
27
+ audio_codec_type="OPUS",
28
+ audio_opus_params={
29
+ #
30
+ "maxplaybackrate": 16000,
31
+ # 受信のみに有効
32
+ "stereo": False,
33
+ # 送信のみに有効
34
+ "sprop_stereo": False,
35
+ },
36
+ video=False,
37
+ metadata=metadata,
38
+ ) as sendonly:
39
+ time.sleep(5)
40
+
41
+ assert sendonly.connect_message is not None
42
+ assert "audio" in sendonly.connect_message
43
+ assert "opus_params" in sendonly.connect_message["audio"]
44
+ assert sendonly.connect_message["audio"]["opus_params"]["stereo"] is False
45
+ assert sendonly.connect_message["audio"]["opus_params"]["maxplaybackrate"] == 16000
46
+ assert sendonly.connect_message["audio"]["opus_params"]["sprop_stereo"] is False
47
+
48
+ assert sendonly.offer_message is not None
49
+ assert "sdp" in sendonly.offer_message
50
+
51
+ assert "opus/48000/2" in sendonly.offer_message["sdp"]
52
+
53
+ assert "maxplaybackrate=16000" in sendonly.offer_message["sdp"]
54
+ assert "stereo=0" in sendonly.offer_message["sdp"]
55
+ assert "sprop-stereo=0" in sendonly.offer_message["sdp"]
56
+
57
+ sendonly_stats = sendonly.get_stats()
58
+
59
+ sendonly.disconnect()
60
+
61
+ # codec が無かったら StopIteration 例外が上がる
62
+ sendonly_codec_stats = next(s for s in sendonly_stats if s.get("type") == "codec")
63
+ assert sendonly_codec_stats["mimeType"] == "audio/opus"
64
+
65
+ # outbound-rtp が無かったら StopIteration 例外が上がる
66
+ outbound_rtp_stats = next(s for s in sendonly_stats if s.get("type") == "outbound-rtp")
67
+ assert outbound_rtp_stats["bytesSent"] > 0
68
+ assert outbound_rtp_stats["packetsSent"] > 0