**This is an old revision of the document!**
Voctomix
- name:
- Voctomix
- git-url:
- https://github.com/voc/voctomix
- project-statu:
- running
Voctomix ist ein Softwaremischer der es uns erlaubt auf Konferenzen HD-Recording und -Streaming anbieten zu können. Voctomix wird aktuell von mazdermind fürs VOC entwicklet und ist gst-switch's kleine Schwester. Sie lebt im Git unter git@c3voc.de:voctomix und read-only auf Github.
- Voctomix Lecture at FROSCON12 by Mazdermind
Resources
Installation on VOC-Hardware
The Installation on VOC Machines (Encoder-Cubes and Mixer-Notebooks) is managed through Ansible. The Ansible Deployment creates the following Things on the Encoder-Cubes:
- Source of last Release in
/opt/voctomix/release
- Config-File for Voctocore in
/opt/voctomix/voctocore-config.ini
- Scripts to source/sink/playout Video-Content into/out of the Voctocore in
/opt/voctomix/scripts
- Systemd-Units in
/etc/systemd/system/*.service
- A System-Status-Script in
/usr/bin/voctomix-status
Ansible always resetd the Setup to a default configuration, where all SDI-Ports are used as Campera-INs, no Playout is active and all Supporting-Scripts are enabled. Ansible generated the following Systemd-Units for Voctomix:
Systemd-Unit | Description |
---|---|
bgloop-source.service | Source the Background-Loop from /opt/voc/share/bgloop.ts |
decklink-source-[NAME].service | Such a Unit is generated for each Decklink-Input-Device present at the time of the ansible-run. Source Video- and Audio from this Decklink-Input |
grabber-source.service | Source Video-Input from the Epiphan Framegrabber via Ethernet |
grabber-to-[NAME]-playout.service | Such a Unit is generated for each Decklink-Output-Device present at the time of the ansible-run. Playout Video- and Silence from the Framegrabber-Input to the Decklink-Output |
grabber-to-framebuffer-playout.service | Playout Video from the Framegrabber-Input to the HDMI/DVI/VGA Output on the Mainboard |
music-source.service | Source Music from /opt/voc/share/pause-music/ into the Pause-Loop |
pause-source.service | Souece Pause-Loop from /opt/voc/share/pause.ts |
program-to-[NAME]-playout.service | Such a Unit is generated for each Decklink-Output-Device present at the time of the ansible-run. Playout Video- and Audio from the Program-Output (=what is being recorded; before the Stream-Blanker) to the Decklink-Output |
program-to-framebuffer-playout.service | Playout Video from the Program-Output (=what is being recorded; before the Stream-Blanker) to the HDMI/DVI/VGA Output on the Mainboard |
recording-sink.service | Record the Program-Output to Segmented .ts-Files in /video |
streaming-hd-sink.service | Encode and Stream the Streamblanker-Output to rtmp://127.0.0.1:1935/stream/sroom_numbernativehd |
streaming-sd-sink.service | Encode and Stream the Streamblanker-Output to rtmp://127.0.0.1:1935/stream/sroom_numbernativesd |
stream-to-[NAME]-playout.service | Such a Unit is generated for each Decklink-Output-Device present at the time of the ansible-run. Playout Video- and Audio from the Stream-Output (=what is being streamed; after the Stream-Blanker) to the Decklink-Output |
stream-to-framebuffer-playout.service | Playout Video from the Stream-Output (=what is being streamed; after the Stream-Blanker) to the HDMI/DVI/VGA Output on the Mainboard |
voctocore.service | The Voctocore |
All Supporting Units are WantedBy=voctocore.service
as well as the request Requires=voctocore.service
and After=voctocore.service
. This means:
- The Supporting Units only start up when the Core has successfully started up first
- When enabled, the Supporting Units automatically start up when the Core is up
- The Supporting Units go down when the Core goes down
Practical tips
In practice this means, that to restart the whole chain, you can do:
sudo systemctl restart voctocore.service
Stop recording at night and schedule re-start in the morning:
for i in 1 2 3 4 5 6 41 42; do echo "10.73.${i}.3"; ssh 10.73.${i}.3 'sudo systemctl stop recording-sink.service'; done for i in 1 2 3 4 5 6 41 42; do echo "10.73.${i}.3"; ssh 10.73.${i}.3 'echo "sudo systemctl restart voctocore.service" | at 09:00'; done
Similar to stop or start everything you can use
sudo systemctl stop voctocore.service
and
sudo systemctl start voctocore.service
To see which units are actually started, you can call
voctomix-status
To Reconfigure a Decklink-Duo Port as Playout, in order for it to survive a restart/reboot, you can do:
sudo systemctl disable decklink-source-decklink-sdi-2.service sudo systemctl stop decklink-source-decklink-sdi-2.service sudo systemctl enable stream-to-decklink-sdi-2-playout.service sudo systemctl start stream-to-decklink-sdi-2-playout.service
If you leave out the enable/disable the change will be temporary and restarting the voctocore-Unit or the encoder-Cube will reset the change.
Similar to enable Playout to the Framebuffer, you can do:
sudo systemctl start stream-to-framebuffer-playout.service sudo systemctl enable stream-to-framebuffer-playout.service
Leaving out the enable/disable the change will also here be temporary.
Playout to the Framebuffer can always be interrupted by funny tty0 printouts at any time :) Also think about whether you want to playout the Program-Output (before the Streamblanker) or the Streaming-Output (after the Streamblanker).
Creating a background for the supersource from an image file
ffmpeg -loop 1 -i background.png -f s16le -i /dev/zero -ar 48000 -ac 1 -r 25 -t 00:01:00 -s 1920x1080 -c:v mpeg2video -q:v 0 -aspect 16:9 -f mpegts bgloop.ts
Creating a background for the supersource from a MP4 file in correct resolution
ffmpeg -i bgloop.mp4 -filter:v fps=25 -c:v mpeg2video -q:v 0 -aspect 16:9 -f mpegts bgloop.ts
Debugging
To see the Output of the various Units, you can use a command like this:
journalctl -au decklink-source-decklink-sdi-2.service
Alternative version:
journalctl -a -f -u grabber-source.service
Control Commands
Some Useful Control-Commands when you only have a Shell (see also example-scripts/control-server: For more details see https://github.com/voc/voctomix/blob/voctopanel/voctocore/lib/commands.py
echo set_audio cam1 | nc -q0 localhost 9999 echo set_audio cam2 | nc -q0 localhost 9999 echo set_composite_mode fullscreen | nc -q0 localhost 9999 echo set_composite_mode picture_in_picture | nc -q0 localhost 9999 echo set_composite_mode side_by_side_equal | nc -q0 localhost 9999 echo set_composite_mode side_by_side_preview | nc -q0 localhost 9999 echo set_stream_blank pause | nc -q0 localhost 9999 echo set_stream_live | nc -q0 localhost 9999 echo set_video_a cam1 | nc -q0 localhost 9999 echo set_video_a cam2 | nc -q0 localhost 9999 echo set_video_a grabber | nc -q0 localhost 9999 echo set_video_b cam1 | nc -q0 localhost 9999 echo set_video_b cam2 | nc -q0 localhost 9999 echo set_video_b grabber | nc -q0 localhost 9999
here you can see the commands together with replays from the core
=> set_video_a cam1 <= video_status cam1 cam2 => set_composite_mode fullscreen <= composite_mode fullscreen <= video_status cam1 cam2 => set_composite_mode side_by_side_equal <= composite_mode side_by_side_equal <= video_status cam1 cam2 => get_config <= server_config {"stream-blanker": {"sources": "pause,nostream", "enabled": "true"}, "DEFAULT": {}, "side-by-side-equal": {}, "fullscreen": {}, "side-by-side-preview": {}, "mix": {"sources": "cam1,cam2,grabber", "videocaps": "video/x-raw,format=I420,width=1920,height=1080,framerate=25/1,pixel-aspect-ratio=1/1", "audiocaps": "audio/x-raw,format=S16LE,channels=2,layout=interleaved,rate=48000"}, "previews": {"deinterlace": "false", "enabled": "false"}, "output-buffers": {"mix_out": "10000"}, "picture-in-picture": {}} => get_video <= video_status cam1 cam2 => get_composite_mode <= composite_mode side_by_side_equal