Difference between revisions of "Linux streaming"

From QWiki
*>Raket
(New page: Linux Streaming Guide Requirements, SBLive, gtx 600, 700 or 900 series, FFmpeg compiled with nvenc [x264 works as well, but needs more power], Twitch account. [to be done later] (other c...)
 
 
Line 1: Line 1:
Linux Streaming Guide
+
This is how you do it, should work on both Geforce GTX >= 6xx series (needs special build) or amd, i use Xcomposite because anything else invades PRIVACY. It's possible to record everything, see gpu-screen-recorder.
  
Requirements, SBLive, gtx 600, 700 or 900 series, FFmpeg compiled with nvenc [x264 works as well, but needs more power], Twitch account. [to be done later]
+
You need:
 +
gpu-screen-recoder
 +
wmctrl
 +
xdotool
  
(other cards than sblive works, but sblive can record from hw:0 and record sound from output and hw:0,2 is a special mic device for mumble/discord [note: u don't need it if you use TeamSpeak])
+
Use vid_fullscreen 1 and vid_minimize_on_focus_loss 1
  
ffmpeg line (For >= gtx 600 series)
+
This will unminimize the ezquake window before starting capture, it will still capture a blank window when it's minimized.
  
    ffmpeg -vsync passthrough -thread_queue_size 1024 -f x11grab -s 2560x1440 -r 60 -i :0.0 -thread_queue_size 1024 -f alsa -ac 2 -i hw:0 -f flv -ac 2 -ar 48000 -c:v nvenc -g 120 -keyint_min 60 -b:v 3500k -minrate 3500k -maxrate 3500k -pix_fmt yuv420p -s 960x540 -tune film -acodec aac -threads 4 -strict normal -bufsize 3500k test.mkv
+
wmctrl -ia $(xdotool search --pid $(pgrep ezquake)) && gpu-screen-recorder -c flv  -w $(xdotool search --pid $(pgrep ezquake))  -f 60 -a "app:ezquake-linux-x86_64" -bm cbr -q 6000 -o tmp_recording.mkv
  
~/.asoundrc (for SBLive)
+
Obviously you can do the same thing to stream to twitch,  
  pcm.!default {
 
        type asym
 
        playback.pcm {
 
                type plug
 
                slave.pcm "hw:0,0"
 
        }
 
        capture.pcm {
 
                type plug
 
                slave.pcm "hw:0,2"
 
        }
 
}
 
  
Bugs: ezquake 3 will get 125hz mice when recording.
+
"rtmp://live.twitch.tv/app/$KEY"

Latest revision as of 21:07, 10 December 2025

This is how you do it, should work on both Geforce GTX >= 6xx series (needs special build) or amd, i use Xcomposite because anything else invades PRIVACY. It's possible to record everything, see gpu-screen-recorder.

You need: gpu-screen-recoder wmctrl xdotool

Use vid_fullscreen 1 and vid_minimize_on_focus_loss 1

This will unminimize the ezquake window before starting capture, it will still capture a blank window when it's minimized.

wmctrl -ia $(xdotool search --pid $(pgrep ezquake)) && gpu-screen-recorder -c flv -w $(xdotool search --pid $(pgrep ezquake)) -f 60 -a "app:ezquake-linux-x86_64" -bm cbr -q 6000 -o tmp_recording.mkv

Obviously you can do the same thing to stream to twitch,

"rtmp://live.twitch.tv/app/$KEY"