# frozen_string_literal: true require "rails_helper" RSpec.describe Streams::YoutubeRelay do describe ".youtube_ffmpeg_args (private)" do def args(mode, url) described_class.send(:youtube_ffmpeg_args, [mode, url], "rtmps://a.rtmps.youtube.com/live2/key") end it "remuxes RTMP with video and audio copy (no AAC re-encode)" do cmd = args(:rtmp, "rtmp://mediamtx:1935/live/match_x") expect(cmd).to include("-c:v", "copy", "-c:a", "copy", "-f", "flv") expect(cmd).not_to include("aac") expect(cmd.join(" ")).not_to include("-b:a") end it "remuxes HLS with AAC bitstream filter for FLV" do cmd = args(:hls, "http://mediamtx:8888/live/match_x/index.m3u8") expect(cmd).to include("-c:v", "copy", "-c:a", "copy", "-bsf:a", "aac_adtstoasc", "-f", "flv") expect(cmd).not_to include("-b:a") end end end