はつねの日記

Kinect, Windows 10 UWP, Windows Azure, IoT, 電子工作

OBS Studio + OBS-WebSocketで字幕表示するときの2020/04/09現在の注意点

映像録画&ライブストリーミング用のオープンソースプロジェクトOBSのOBS Studioにはプラグイン拡張でWeb Socketのインターフェースを追加することができます。

OBS Studio (現時点での最新は、25.0.4)

obsproject.com

OBS-WebSocket (現時点での最新は、2.7)

github.com

OBS-WebSocketのC# .NET Library

github.com

 

OBS Studioが24→25に変わったときに文字を表示する領域(OBS Studioではソースと言います)のIDが変わってしまっているようで、OBS-WebSocketで、SetTextGDIPlusPropertiesやGetTextGDIPlusPropertiesを使うときに正しいソース名を指定しても「not a text gdi plus source」というエラーになってしまい、OBS Studioに字幕が表示できません。

Unable to control of GDI_Text version 2 · Issue #443 · Palakis/obs-websocket · GitHub

すでにこのissuesはソース的には修正が入っております。

具体的には、ソース名でヒットしたソースの属性チェックのところで、従来の「text_gdiplus」というIDに加えて、「text_gdiplus_v2」というIDもエラーにしないように修正されています。

http:// https://github.com/Palakis/obs-websocket/pull/448/commits/846d52ebe58d5f9f819680afa9d8a3e7516ab380

この変更は、「added this to the 4.8 milestone」とのことですので、OBS-WebSocketのVersion 4.8には入ってくるようです。

 

そのため、2020/04/09時点での解決方法は次のようになります。

  • OBS-WebSokcetの最新ソースから version 4.8 相当のバイナリをビルドして使用する
  • OBS Studioを24系にダウングレードする

 

[en]

OBS Studio from OBS, an open source project for video recording and live streaming, has a plug-in extension that adds a Web Socket interface.

OBS Studio (currently the latest is 25.0.4)

https://obsproject.com/ja/

OBS-WebSocket (current version is 2.7)

https://github.com/Palakis/obs-websocket/releases

OBS-WebSocket's C# .NET Library

https://github.com/Palakis/obs-websocket-dotnet.

 

When OBS Studio changed from 24 to 25, the ID of the area to display text (called source in OBS Studio) seems to have changed, and even if I specify the correct source name when using SetTextGDIPlusProperties or GetTextGDIPlusProperties in OBS-WebSocket, I get the error "not a text gdi plus source", and I can't display subtitles in OBS Studio.

https://github.com/Palakis/obs-websocket/issues/443

This issues has already been modified in terms of source.

Specifically, the ID of "text_gdiplus_v2" in addition to the ID of "text_gdiplus" in the attribute check of the source hit by the source name has been modified so that it is not an error.

https://github.com/Palakis/obs-websocket/pull/448/commits/846d52ebe58d5f9f819680afa9d8a3e7516ab380.

This change is "added this to the 4.8 milestone", so it seems to be coming in Version 4.8 of OBS-WebSocket.

 

Therefore, as of 04/09/2020, the solution is as follows.
-Build and use a binary equivalent to version 4.8 from the latest source of OBS-WebSokcet.
-Downgrade the OBS Studio to the 24