feat(streamer): add ffmpeg encoder and mcap recording

This commit is contained in:
2026-03-10 22:12:22 +08:00
parent 769d36f86f
commit 6af97ee5d3
86 changed files with 30551 additions and 1482 deletions
+3 -3
View File
@@ -744,19 +744,19 @@ std::expected<RtmpPublisher, std::string> RtmpPublisher::create(const RuntimeCon
return std::unexpected("invalid RTMP publisher init: no RTMP URL configured");
}
if (config.outputs.rtmp.mode == RtmpMode::Domestic && config.codec != CodecType::H265) {
if (config.outputs.rtmp.mode == RtmpMode::Domestic && config.encoder.codec != CodecType::H265) {
return std::unexpected(
"invalid mode matrix: --rtmp-mode domestic requires --codec h265 (h264+domestic is unsupported)");
}
spdlog::info(
"RTMP_MODE_SELECTED codec={} mode={} urls={}",
to_string(config.codec),
to_string(config.encoder.codec),
to_string(config.outputs.rtmp.mode),
config.outputs.rtmp.urls.size());
RtmpPublisher publisher{};
publisher.codec_ = config.codec;
publisher.codec_ = config.encoder.codec;
publisher.mode_ = config.outputs.rtmp.mode;
publisher.sessions_.reserve(config.outputs.rtmp.urls.size());
+2 -2
View File
@@ -191,7 +191,7 @@ std::expected<UdpRtpPublisher, std::string> UdpRtpPublisher::create(const Runtim
publisher.destination_host_ = *config.outputs.rtp.host;
publisher.destination_port_ = *config.outputs.rtp.port;
publisher.payload_type_ = config.outputs.rtp.payload_type;
publisher.codec_ = config.codec;
publisher.codec_ = config.encoder.codec;
publisher.sequence_ = compute_initial_sequence();
publisher.ssrc_ = compute_ssrc(
publisher.destination_host_,
@@ -250,7 +250,7 @@ std::expected<UdpRtpPublisher, std::string> UdpRtpPublisher::create(const Runtim
return std::unexpected("RTP socket non-blocking setup failed: " + std::string(std::strerror(errno)));
}
const std::string codec_name = config.codec == CodecType::H265 ? "h265" : "h264";
const std::string codec_name = config.encoder.codec == CodecType::H265 ? "h265" : "h264";
if (config.outputs.rtp.sdp_path && !config.outputs.rtp.sdp_path->empty()) {
publisher.sdp_path_ = *config.outputs.rtp.sdp_path;
} else {