Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ENABLE_FRONTEND_API": false,
"ENABLE_QT": false,
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
"MOQ_VERSION": "0.2.0",
"MOQ_VERSION": "0.2.4",
"MOQ_ARCHIVE": "tar.gz"
}
},
Expand Down
20 changes: 15 additions & 5 deletions src/moq-output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,18 @@ void MoQOutput::VideoInit()

const char *codec = obs_encoder_get_codec(encoder);

video = moq_publish_media_ordered(broadcast, codec, strlen(codec), extra_data, extra_size);
// Transform codec string for MoQ
const char *moq_codec = codec;
if (strcmp(codec, "h264") == 0) {
// H.264 with inline SPS/PPS
moq_codec = "avc3";
} else if (strcmp(codec, "hevc") == 0) {
// H.265 with inline VPS/SPS/PPS
moq_codec = "hev1";
}

// Intialize the media import module with the codec and initialization data.
video = moq_publish_media_ordered(broadcast, moq_codec, strlen(moq_codec), extra_data, extra_size);
Comment on lines +223 to +234
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Codec transformation logic is correct; minor typo on line 233.

The mapping of h264avc3 and hevchev1 correctly represents the ISOBMFF codec identifiers for streams with in-band parameter sets. The fallback to the original codec string provides good forward compatibility.

📝 Fix typo
-	// Intialize the media import module with the codec and initialization data.
+	// Initialize the media import module with the codec and initialization data.
🤖 Prompt for AI Agents
In @src/moq-output.cpp around lines 223 - 234, Fix the typo in the comment above
the moq_publish_media_ordered call: change "Intialize the media import module
with the codec and initialization data." to "Initialize the media import module
with the codec and initialization data." This comment is adjacent to the
moq_publish_media_ordered(broadcast, moq_codec, strlen(moq_codec), extra_data,
extra_size) invocation and references the transformed codec variable moq_codec.

if (video < 0) {
LOG_ERROR("Failed to initialize video track: %d", video);
return;
Expand Down Expand Up @@ -272,10 +283,9 @@ void register_moq_output()
{
const uint32_t base_flags = OBS_OUTPUT_ENCODED | OBS_OUTPUT_SERVICE;

// TODO: Add support for other codecs.
const char *audio_codecs = "aac";
// TODO: Add support for other codecs.
const char *video_codecs = "h264";
const char *audio_codecs = "aac;opus";
// TODO: Add support for AV1, VP9.
const char *video_codecs = "h264;hevc";

struct obs_output_info info = {};
info.id = "moq_output";
Expand Down
4 changes: 2 additions & 2 deletions src/moq-service.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "moq-service.h"

// TODO: Define supported codecs.
const char *audio_codecs[] = {"aac", nullptr};
const char *video_codecs[] = {"h264", nullptr};
const char *audio_codecs[] = {"aac", "opus", nullptr};
const char *video_codecs[] = {"h264", "hevc", nullptr};

MoQService::MoQService(obs_data_t *settings, obs_service_t *) : server(), path()
{
Expand Down
Loading