forked from Glimesh/broadcast-box
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgstreamer-broadcast.nu
More file actions
executable file
·34 lines (31 loc) · 960 Bytes
/
gstreamer-broadcast.nu
File metadata and controls
executable file
·34 lines (31 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env nu
def main [ whip_endpoint: string, auth_token: string, stream_type = "testsrc" ] {
mut srcelem = []
mut audioelem = []
if $stream_type == "testsrc" {
$srcelem = [ videotestsrc pattern=smpte-rp-219 ]
$audioelem = [ audiotestsrc wave=8 ]
} else {
$srcelem = [ v4l2src "device=/dev/video1" ]
$audioelem = [ pulsesrc "device=alsa_input.usb-MACROSILICON_USB3._0_capture-02.analog-stereo" ]
}
(gst-launch-1.0 -v
$srcelem
! videoconvert
! x264enc tune="zerolatency"
! rtph264pay
! application/x-rtp,media=video,encoding-name=H264,payload=97,clock-rate=90000
! whip0.sink_0
$audioelem
! audioconvert
! opusenc
! rtpopuspay
! application/x-rtp,media=audio,encoding-name=OPUS,payload=96,clock-rate=48000,encoding-params=(string)2
! whip0.sink_1
whipsink
name=whip0
use-link-headers=true
$"whip-endpoint=($whip_endpoint)"
$"auth-token=($auth_token)"
)
}