Skip to content

Conversation

@davegullo
Copy link
Contributor

Changes

  • Make hang library import cross-platform in CMakeLists.txt (supports .dylib on macOS, .so on Unix/Linux, .dll on Windows)
  • Fix printf format specifiers for int64_t using PRId64 macro
  • Fix ConfigureVideoTrack logging bug (video_width was missing)

Building

Built on Ubuntu 24.04.3 LTS

#!/bin/bash
cmake --preset ubuntu-x86_64
cmake --build --preset ubuntu-x86_64
cp build_x86_64/obs-moq.so ~/.config/obs-studio/plugins/obs-moq/bin/64bit/obs-moq.so

Caveats

Trying to build with ENABLE_FRONTEND_API fails with this message (even though libobs-dev is installed via sudo apt install -y libobs-dev )

CMake Error in CMakeLists.txt:
  IMPORTED_LOCATION or IMPORTED_IMPLIB not set for imported target
  "OBS::obs-frontend-api" configuration "RelWithDebInfo".

The workaround instead of using the UI to setup your service is to just put it here:

$ cat ~/.config/obs-studio/basic/profiles/Untitled/service.json
   {
       "type": "moq_service",
       "settings": {
           "server": "https://my-foo-service:4443",
           "key": "obs-test/obs-test"
       }
   }

Make sure you have the latest moq relay built, and then if you have built hang-gst you can watch it with:

#!/bin/bash
gst-launch-1.0 \
  hangsrc url=https://my-foo-service:4443/obs-test broadcast=obs-test ! \
  h264parse ! \
  nvh264dec ! \
  nv3dsink

... or pick your favorite method.

@emilsas emilsas self-requested a review December 1, 2025 12:11
Copy link
Collaborator

@emilsas emilsas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! LGTM, there are some conflicts to fix before merging.

@davegullo davegullo marked this pull request as draft December 6, 2025 21:24
@davegullo
Copy link
Contributor Author

NOTE, converted this to a draft, as there are a few open and unresolved items.

Currently, this happens when building:

In file included from /root/src/obs-moq/src/moq-output.h:5,
                 from /root/src/obs-moq/src/moq-output.cpp:4:
/root/src/obs-moq/src/moq-output.cpp: In member function 'void MoQOutput::ConfigureVideoTrack()':
/root/src/obs-moq/src/moq-output.cpp:146:49: error: 'obs_data_get_json_pretty_with_defaults' was not declared in this scope
  146 |         LOG_DEBUG("Video encoder settings: %s", obs_data_get_json_pretty_with_defaults(settings));
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/src/obs-moq/src/logger.h:4:68: note: in definition of macro 'LOG'
    4 | #define LOG(level, format, ...) blog(level, "[obs-moq] " format, ##__VA_ARGS__)
      |                                                                    ^~~~~~~~~~~
/root/src/obs-moq/src/moq-output.cpp:146:9: note: in expansion of macro 'LOG_DEBUG'
  146 |         LOG_DEBUG("Video encoder settings: %s", obs_data_get_json_pretty_with_defaults(settings));
      |         ^~~~~~~~~
/root/src/obs-moq/src/moq-output.cpp: In member function 'void MoQOutput::ConfigureAudioTrack()':
/root/src/obs-moq/src/moq-output.cpp:173:49: error: 'obs_data_get_json_pretty_with_defaults' was not declared in this scope
  173 |         LOG_DEBUG("Audio encoder settings: %s", obs_data_get_json_pretty_with_defaults(settings));
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/src/obs-moq/src/logger.h:4:68: note: in definition of macro 'LOG'
    4 | #define LOG(level, format, ...) blog(level, "[obs-moq] " format, ##__VA_ARGS__)
      |                                                                    ^~~~~~~~~~~
/root/src/obs-moq/src/moq-output.cpp:173:9: note: in expansion of macro 'LOG_DEBUG'
  173 |         LOG_DEBUG("Audio encoder settings: %s", obs_data_get_json_pretty_with_defaults(settings));
      |         ^~~~~~~~~

Therefore this is why this patch exists:
https://github.com/qualabs/obs-moq/pull/4/files#diff-6fa2e928ec9e97965c6bf1c68ee9142e31d4b0761e04ea74ec7d351987ef90ebR173

Once this PR is applied, it builds. But then when running, we get this at runtime in the OBS logs:

error: os_dlopen(/home/ubuntu/.config/obs-studio/plugins/obs-moq/bin/64bit/obs-moq.so->/home/ubuntu/.config/obs-studio/plugins/obs-moq/bin/64bit/obs-moq.so): /home/ubuntu/.config/obs-studio/plugins/obs-moq/bin/64bit/obs-moq.so: undefined symbol: hang_write_audio_packet_from_c

I believe this is an open issue, so I'm waiting for this to be resolved before moving forward with more testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants