@@ -110,6 +110,13 @@ func streamWebsite(ctx context.Context, config *Config) error {
110110 chromedp .Flag ("use-fake-device-for-media-stream" , true ),
111111 chromedp .Flag ("alsa-output-device" , "pulse" ),
112112 chromedp .Flag ("enable-features" , "VaapiVideoDecoder" ),
113+ // Hide browser UI for clean streaming
114+ chromedp .Flag ("kiosk" , true ),
115+ chromedp .Flag ("disable-infobars" , true ),
116+ chromedp .Flag ("disable-automation" , true ),
117+ chromedp .Flag ("disable-restore-session-state" , true ),
118+ chromedp .Flag ("disable-background-networking" , true ),
119+ chromedp .Flag ("no-first-run" , true ),
113120 chromedp .WindowSize (config .Width , config .Height ),
114121 )
115122
@@ -162,8 +169,8 @@ func startFFmpegStream(ctx context.Context, config *Config, display string) erro
162169 "-video_size" , fmt .Sprintf ("%dx%d" , config .Width , config .Height ),
163170 "-framerate" , "30" ,
164171 "-i" , display ,
165- "-f" , "alsa " , // Use ALSA for audio capture (FFmpeg supports this)
166- "-i" , "default " , // Use ALSA default device (configured to route to PulseAudio)
172+ "-f" , "pulse " , // Use PulseAudio directly for better audio capture
173+ "-i" , "stream_output.monitor " , // Capture from the monitor of our stream sink
167174 "-c:v" , "libx264" ,
168175 "-preset" , "veryfast" ,
169176 "-tune" , "zerolatency" ,
0 commit comments