-
Notifications
You must be signed in to change notification settings - Fork 0
/
tegra2twitch.sh
executable file
·32 lines (25 loc) · 1017 Bytes
/
tegra2twitch.sh
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
#!/bin/bash
##############################################################
# Streams from a TV-connected board to Twitch #
##############################################################
DEST_WIDTH=720
DEST_HEIGHT=405
TWITCH_KEY=$(cat ~/.twitchkey)
STREAM_DESTINATION="rtmpsink location=rtmp://live-ams.twitch.tv/app/${TWITCH_KEY}"
echo $STREAM_DESTINATION
FILE_DESTINATION="filesink location=data.flv"
# See 'pacmd list-sources' to find proper values
PULSE_AUDIO_MON="alsa_output.platform-tegra30-hda.hdmi-stereo.monitor"
ENCODER="omxh264enc control-rate=2 bitrate=700000"
QUEUE="queue leaky=downstream "
DISPLAY=:0 gst-launch-1.0 \
pulsesrc device=${PULSE_AUDIO_MON} ! \
${QUEUE} ! \
audioconvert ! \
audio/x-raw,channels=1 ! ${QUEUE} ! voaacenc ! \
flvmux streamable=true name=mux ! \
${QUEUE} ! \
${FILE_DESTINATION} \
ximagesrc use-damage=0 endx=1920 endy=1080 ! \
nvvidconv ! 'video/x-raw(memory:NVMM), width='${DEST_WIDTH}', height='${DEST_HEIGHT}', framerate=60/1' ! \
${ENCODER} ! mux.