Commit 5a646a61 authored by user's avatar user
Browse files
parents 66fa2bf0 204849ff
*.temp
*.tmp
*.swp
*.pyc
*.pid
.gitmodules.bak
*.pid
*.pyc
......@@ -31,4 +33,16 @@ leftover/shouts.txt
sopel/bot_${ircprefix}_${hostname}-irc.indymedia.org.tell.db
sopel/indymedia.db
sopel/leftoverbot-irc.indymedia.org.tell.db
leftover/datetime
leftover/getpass
leftover/shouts.txt*
leftover/sqlite3
leftover/sys
leftover/telnetlib
panelplugin/swlog.txt
sopel/indymedia.db
sopel/leftoverbot-irc.indymedia.org.tell.db
sopel/leftover-chat.intergalactic.fm.tell.db
sopel/sopel-ifm-log/raw.log
sopel/sopel-ifm-log/stdio.log
Streaming Media Stuff
Do _NOT_ use this repo with the webeditorgui (it will crash), just clone it to your local computer and edit there.
The first things to do:
- install debian
......@@ -36,3 +38,12 @@ repo with the other repos as submodules and some more stuff
* c-player: player that outputs to snowmix, tcp2rtsp, s2s
TODO:
- gstreamer webrtc thingie that outputs to obs / or over named pipes (computer -> computer , browser -> computer, computer -> browser)
- webrtc reflector
- figure out this new jack like thingie for video (pipewire)
- turbovnc + virtualgl
- bbc web based video mixer https://github.com/bbc/brave
digraph {
nodesep=0.5;
splines="ortho";
node [shape="box"];
edge [color="blue"];
fresh [label="lag.fresh (temp)"];
nginx_rtmp [label="nginx-rtmp, usted to be in adm.amsterdam (video)"];
puscii_icecast [label="deathstar.puscii.nl (audio)"];
ifm [label="intergalactic.fm (video)"];
leftover_website [label="leftover.puscii.nl"];
subgraph cluster_devices_around_table {
label="non computer devices on table";
edge [color="grey"];
mixer [label="Mixer (Behringer)"];
studio_monitors [label="Studio Monitors"]
dvr [label="4 channel digital video recorder 4chdvr.lag, connect with rtsp"]
dvr -> antani_obs
mixer -> antani_soundcard;
mixer -> studio_monitors;
lag_webcam_dj [label="LAG webcam dj"];
lag_webcam_dj -> dvr [color="red"];
lag_webcam_ptz [label="LAG webcam ptz"];
lag_webcam_ptz -> dvr [color="red"];
}
subgraph cluster_antani {
label="Antani (antani.lag)";
edge [color="grey"];
antani_soundcard [label="Antani Soundcard (USB)"];
antani_jack [label="Jack Audio"];
antani_ardour [label="Ardour"];
antani_obs [label="OBS"];
liquidsoap_papillon_ls1ls2 [label="liquidsoap that takes audio from jack and sends to ls1 and ls2"]
antani_soundcard -> antani_jack -> antani_ardour -> antani_obs;
antani_ardour -> liquidsoap_papillon_ls1ls2
}
subgraph cluster_irc_shouts {
label="IRC .shouts";
indymedia_irc_papillon [label="Indymedia #papillon"];
indymedia_irc_lag [label="Indymedia #lag"];
indymedia_irc_papillon -> shoutdb
indymedia_irc_lag -> shoutdb [color="black"];
shoutdb -> shoutfile -> antani_obs [color="black"];
}
subgraph cluster_streaming_server {
label="Streaming server (ineedtogetanameandbecreated.lag)";
edge [color="grey"];
liquidsoap_papillon_ls1 [label="primary liquidsoap"]
liquidsoap_papillon_ls2 [label="secondary liquidsoap"]
antani_obs -> nginx_rtmp [color="red" label="rtmp"]
liquidsoap_papillon_ls1 -> puscii_icecast;
liquidsoap_papillon_ls2 -> puscii_icecast;
liquidsoap_papillon_ls1ls2 -> liquidsoap_papillon_ls1 [label="when audio from LAG, ogg over http",color="red"];
liquidsoap_papillon_ls1ls2 -> liquidsoap_papillon_ls2 [label="when audio from LAG, ogg over http",color="red"];
nginx_rtmp -> hls_for_website [label="transmuxed",color="red"];
nginx_rtmp -> ffmpeg -> ifm [label="transmuxed",color="red"];
nginx_rtmp -> ffmpeg -> low [label="transcoded",color="red"];
low -> nginx_rtmp -> hls_for_website;
hls_for_website -> leftover_website;
puscii_icecast -> leftover_website;
}
}
#!/usr/bin/env bash
set -eux
image='leftover_notext480.jpg'
stream='http://deathstar.puscii.nl:8000/papillon.ogg'
text_file='audiobroadcast.txt'
font='BPmonoBold.ttf'
rtmp_user=''
rtmp_pass=''
rtmp_url="rtmp://dock.lag/stream/leftover"
while [ true ]
do
ffmpeg -loop 1 -framerate 30 \
-i $image -i $stream \
-c:v libx264 -pix_fmt yuv420p \
-vf "drawtext=textfile=$text_file:reload=1:fontfile=$font:y=h-line_h-10:x=w-mod(max(t-4.5\,0)*(w+tw)/10.5\,(w+tw)):fontcolor=00dc90:fontsize=30:shadowx=2:shadowy=2"\
-c:a aac -ar 44100 -f flv $rtmp_url
sleep 5
done
Audio only broadcast atm. (if you wondering why you see this instead of the video you try to send, login to dock.lag and stop the audio_to_video.sh )
......@@ -7,7 +7,7 @@ import datetime
import sqlite3
conn = sqlite3.connect('leftover.db')
conn = sqlite3.connect('/home/user/src/streaming-media-stuff/leftover/leftover.db')
#conn = sqlite3.connect(':memory:')
c = conn.cursor()
......
#!/bin/bash -x
#!/bin/bash
rm /home/user/src/streaming-media-stuff/leftover/leftover.db
......
......@@ -3,7 +3,7 @@
import sqlite3
conn = sqlite3.connect('leftover.db')
conn = sqlite3.connect('/home/user/src/streaming-media-stuff/leftover/leftover.db')
c = conn.cursor()
c.execute('''SELECT * FROM (
......@@ -11,11 +11,11 @@ c.execute('''SELECT * FROM (
)
ORDER BY created_at ASC''')
shout = "SHOUTOUTS: "
shout = ""
for row in c.fetchall():
shout = shout + ' -- ' + row[1] + ': ' + row[2]
shout = shout + ' --| '
shout = shout + ''
conn.close()
print(shout)
......
......@@ -27,9 +27,9 @@ live = mksafe(input.jack(id="liquidsoap-ls1ls2-low", buffer_size=8, clock_safe=f
#icecast_flac(live, mount="pap-a", host="buildbox.adm", port=8051, password="hackme")
icecast_ogg(live, mount="pap-b", host="admamsterdam.net", port=8051, password="hackme")
icecast_ogg(live, mount="pap-b", host="dock.lag", port=8051, password="hackme")
icecast_ogg(live, mount="pap-b", host="82.161.145.133", port=8052, password="hackme")
#icecast_ogg(live, mount="pap-b", host="82.161.145.133", port=8052, password="hackme")
#icecast_flac(live, mount="mount-a", host="82.161.145.133", port=8052, password="hackme")
......
# sends the audio from jack to icecast, when it is silent, it will play the technical-problem.ogg
jack = input.jack(id="liquidsoap-teststream")
name = "teststream"
default = single("/home/user/src/streaming-media-stuff/liquidsoap/technical-problem.ogg")
stream = fallback(track_sensitive=false, [ strip_blank(max_blank=240.,jack) , default ])
vorbis_encoding = %vorbis.abr(bitrate=256, channels=2)
external_server = output.icecast(host="deathstar.puscii.nl", port=8000, password="icecold")
external_server(vorbis_encoding, stream, mount="#{name}.ogg")
stream = mksafe(noise());
name = "pap-c"
vorbis_encoding = %vorbis.abr(bitrate=256, channels=2)
external_server = output.icecast(host="hlsorigin.laglab.org", port=8051, password="hackme")
external_server(vorbis_encoding, stream, mount="#{name}")
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import logging
logging.basicConfig(level=logging.INFO)
sys.path.append('../')
from obswebsocket import obsws, events
host = "localhost"
port = 4444
password = "secret"
def on_event(message):
print("Got message: {}".format(message))
def on_switch(message):
print("You changed the scene to {}".format(message.getSceneName()))
ws = obsws(host, port, password)
ws.register(on_event)
ws.register(on_switch, events.SwitchScenes)
ws.connect()
try:
print("OK")
time.sleep(10)
print("END")
except KeyboardInterrupt:
pass
ws.disconnect()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import logging
logging.basicConfig(level=logging.INFO)
sys.path.append('../')
from obswebsocket import obsws, requests
host = "localhost"
port = 4444
password = "secret"
ws = obsws(host, port, password)
ws.connect()
try:
scenes = ws.call(requests.GetSceneList())
for s in scenes.getScenes():
name = s['name']
print("Switching to {}".format(name))
ws.call(requests.SetCurrentScene(name))
time.sleep(2)
print("End of list")
except KeyboardInterrupt:
pass
ws.disconnect()
#!/usr/bin/env python3
import wx.adv
import wx
TRAY_TOOLTIP = 'Name'
TRAY_ICON = '/home/user/src/streaming-media-stuff/panelplugin/onair-30px.png'
def create_menu_item(menu, label, func):
item = wx.MenuItem(menu, -1, label)
menu.Bind(wx.EVT_MENU, func, id=item.GetId())
menu.Append(item)
return item
class TaskBarIcon(wx.adv.TaskBarIcon):
def __init__(self, frame):
self.frame = frame
super(TaskBarIcon, self).__init__()
self.set_icon(TRAY_ICON)
self.Bind(wx.adv.EVT_TASKBAR_LEFT_DOWN, self.on_left_down)
def CreatePopupMenu(self):
menu = wx.Menu()
create_menu_item(menu, 'Site', self.on_hello)
menu.AppendSeparator()
create_menu_item(menu, 'Exit', self.on_exit)
return menu
def set_icon(self, path):
icon = wx.Icon(path)
self.SetIcon(icon, TRAY_TOOLTIP)
def on_left_down(self, event):
print ('Tray icon was left-clicked.')
def on_hello(self, event):
print ('Hello, world!')
def on_exit(self, event):
wx.CallAfter(self.Destroy)
self.frame.Close()
class App(wx.App):
def OnInit(self):
frame=wx.Frame(None)
self.SetTopWindow(frame)
TaskBarIcon(frame)
return True
def main():
app = App(False)
app.MainLoop()
if __name__ == '__main__':
main()
#!/bin/bash
date=`date +%F`
#ardour5 -n -a -N testje -T /home/user/ardour-sessions/testje-$date.ardour
mkdir -p /home/user/ardour-sessions
cd /home/user/media/ardour ; git pull
rsync -a /home/user/media/ardour/templates/ /home/user/.config/ardour5/templates/
cd /home/user/ardour-sessions
DISPLAY=:0 ardour5 -n -a -N ${date}-leftover
#!/usr/bin/env bash
killall pulseaudio
sleep 15
killall pulseaudio
read
#!/bin/bash
export DISPLAY=:0
filename=/home/user/screenshot/`date --iso-8601=seconds`.png
mkdir -p /home/user/screenshot
chown -R user:user /home/user/screenshot
if su user -c "import -window root $filename"
then
echo "screenshot ok"
rm /home/user/screenshot/latest.png
ln -s $filename /home/user/screenshot/latest.png
exit 0
else
echo "failed"
exit 10
fi
#!/usr/bin/env bash
HOST="$1"
USER="root"
mkdir -p ~/sand
cd ~/sand
if ssh $USER@$HOST /home/user/src/streaming-media-stuff/scripts/screenshot.sh
then
echo "OK"
scp $USER@$HOST:/home/user/screenshot/latest.png ~/sand/$HOST.png
eog ~/sand/$HOST.png
else
echo "failed"
fi
#!/usr/bin/env bash
H=$1
cd ~/sand
ssh root@$H /home/user/src/streaming-media-stuff/scripts/screenshot.sh
scp root@$H:/home/user/screenshot/latest.png ~/sand/latest-$H.png
eog ~/sand/latest-$H.png
#!/usr/bin/env bash
cd ~/sand
ssh user@stdio /home/user/src/streaming-media-stuff/scripts/screenshot.sh
scp user@stdio:screenshot/latest.png ~/sand/latest.png
eog ~/sand/latest.png
#!/bin/bash
input="rtsp://admin:admin@10.205.12.87/live/h264/ch1"
obspipe="rtspsrc num-buffers=100000 latency=1 location="rtsp://admin:admin@10.205.12.87/live/h264/ch1" ! decodebin ! videoconvert"
obspipe2="rtspsrc num-buffers=100000 latency=1 location="rtsp://admin:admin@10.205.12.87/live/h264/ch2" ! decodebin ! videoconvert"
#gst-launch-1.0 $obspipe ! pngenc snapshot=true ! filesink location=~/screenshot/ch1.png
#gst-launch-1.0 $obspipe ! pngenc snapshot=true ! filesink location=~/screenshot/ch2.png
#gst-launch-1.0 tcpclientsrc host=192.168.1.2 port=5000 num-buffers=100000 ! gdpdepay ! jpegparse ! jpegdec ! videoconvert ! pngenc snapshot=true ! filesink location=a.png
#cvlc "$input" --rate=1 --video-filter=scene --vout=dummy --start-time=10 --stop-time=11 --scene-format=png --scene-ratio=24 --scene-prefix=snap --scene-path=/home/user/screenshot vlc://quit
ffmpeg -y -i "$input" -s 800x450 -vframes 1 -f image2 -updatefirst 1 ~/screenshot/MyThumbnail.jpg
exit
cvlc "$input" -V dummy --intf=dummy \
--video-filter=scene --no-audio \
--stop-time=11 \
--scene-replace \
--scene-path=/home/user/screenshot \
--scene-format=jpg \
--scene-prefix=snap \
--scene-ratio=24 vlc://quit
#--run-time=110 \
#!/bin/bash
systemctl --user start jack.service
systemctl --user start jack-plumbing.service
systemctl --user start hexchat.service
systemctl --user start liquidsoap.service
systemctl --user start mocp.service
systemctl --user start ardour.service
systemctl --user start obs.service
systemctl --user start obs-tablet-remote.service
systemctl --user start shoutloop.service
systemctl --user start sopel_leftover_ifm.service
systemctl --user start sopel_leftover_indy.service
systemctl --user start sopel_leftover.service
#!/bin/bash
systemctl --user status jack.service
systemctl --user status ardour.service
systemctl --user status jack-plumbing.service
systemctl --user status hexchat.service
systemctl --user status liquidsoap.service
systemctl --user status mocp.service
systemctl --user status obs.service
systemctl --user status obs-tablet-remote.service
systemctl --user status shoutloop.service
systemctl --user status sopel_leftover_ifm.service
systemctl --user status sopel_leftover_indy.service
systemctl --user status sopel_leftover.service
#!/bin/bash
obspipe="audiotestsrc is-live=true ! audio. rtspsrc latency=1 location="rtsp://admin:admin@10.205.12.87/live/h264/ch1" ! decodebin ! videoconvert ! video."
gst-launch-1.0 -v \
$obspipe \
xvimagesink name=video \
fakesink name=audio
# ! video. \
# audiotestsrc wave=ticks is-live=true \
# ! audio/x-raw, channels=2, rate=44100 ! audio. \
# video. ! xvimagesink \
# audio. ! fakesink
......@@ -10,6 +10,9 @@ nick_blocks = steve,montagu
host_blocks =
prefix = \~
home = /home/user/src/streaming-media-stuff/sopel
#log_raw = True
#logging_level = DEBUG
#logdir = /home/user/src/streaming-media-stuff/sopel/sopel-ifm-log/
[clock]
tz = Europe/Amsterdam
......@@ -22,9 +25,9 @@ password = 'BjXoHvJ5GK'
email = 'hmsa@eduif.nl'
[shout]
db = /home/studio/streaming-media-stuff/leftover/leftover.db
db = /home/user/src/streaming-media-stuff/leftover/leftover.db
[mastodon]
access_token = /home/studio/streaming-media-stuff/leftover/mast/pytooter_usercred.secret
access_token = /home/user/src/streaming-media-stuff/leftover/mast/pytooter_usercred.secret
api_base_url = https://social.weho.st
......@@ -34,4 +34,7 @@ db = /home/user/src/streaming-media-stuff/leftover/leftover.db
access_token = /home/user/src/streaming-media-stuff/leftover/mast/pytooter_usercred.secret
api_base_url = https://social.weho.st
[mattermost]
username = test
password = test
import sopel.module
import subprocess
from subprocess import Popen, PIPE
def ecmd(args):
p = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate(b"input data that is passed to subprocess' stdin")
rc = p.returncode
return str(output)
def notifysend(title, message):
ecmd(['notify-send', '-u', 'critical', '-i', '/home/user/src/streaming-media-stuff/sopel/modules/boom.png', '-t', '5000', title, message])
@sopel.module.commands('lala')
def lala(bot, trigger):
bot.say('lalalalalalalala')
@sopel.module.commands('route')
def route(bot, trigger):
result = subprocess.run(['ip', 'r'], stdout=subprocess.PIPE)
bot.say(result.stdout)
result = ecmd(['ip', 'r'])
bot.say(result)
@sopel.module.commands('link')
def link(bot, trigger):
result = subprocess.run(['ip', 'l'], stdout=subprocess.PIPE)
bot.say(result.stdout)
result = ecmd(['ip', 'l'])
bot.say(result)
@sopel.module.commands('iwconfig')
def iwconfig(bot, trigger):
result = subprocess.run(['iwconfig'], stdout=subprocess.PIPE)
bot.say(result.stdout)
@sopel.module.commands('servicestate')
def servicestate(bot, trigger):
if not trigger.group(2):
return bot.reply("No liq name.")
result = subprocess.run(['systemctl', 'status', trigger.group(2).strip()], stdout=subprocess.PIPE)
bot.say(result.stdout)
result = ecmd(['iwconfig'])
bot.say(result)
@sopel.module.commands('popup')
def popup(bot, trigger):
nick = trigger.nick
msg = trigger.group(2)