Pitahaya
back home
Live streaming in privacy mode Requires: ffmpeg, node.js, streamlink, vlc
If running windows, install cygwin to run the commands on this page.
With Pitahaya, you can transmit audio data in real time over the video channel of a live stream.. the video will appear silent to anyone not decoding the stream with Pitahaya. Video example
Encoding The following command will take the file audio.flac and live stream it to youtube as a 128 kbps MP3 in real time over the video channel. The live stream will have no audible sound in the audio channel. Be sure to replace the string abcd-efgh-ijkl-mnop-qrst with your youtube live streaming key found on your live  dashboard page.
ffmpeg -nostats -loglevel 0 \
-re -i audio.flac \
-f s16le -acodec pcm_s16le -ar 44100 -ac 2 - \
| ffmpeg -nostats -loglevel 0 \
-f s16le -ar 44100 -ac 2 -i - \
-acodec libmp3lame -b:a 128k -f mp3 - \
| pitahaya --tx mp3 \
| ffmpeg -nostats -loglevel 0 \
-f lavfi \
-i anullsrc=channel_layout=stereo:sample_rate=44100 \
-framerate 8 -f rawvideo \
-pixel_format rgba -video_size 640x360 \
-i - -shortest -c:v libx264 \
-crf 31 -preset slow \
-r 8 -g 16 -f flv \
"rtmp://a.rtmp.youtube.com/live2/abcd-efgh-ijkl-mnop-qrst"
After running the command, wait a moment and you will see the stream start to be received on the live dashboard page. It might give you a warning that the stream quality has an 'unsupported resolution' but you can ignore this warning. It is probably best to set the stream latency to 'normal latency' on the live dashboard page to ensure the highest possible quality stream.

Alternatively, if you want to live stream audio from audio playing on your desktop computer, rather than from a file, you can find the command to do that here.


Decoding Privacy mode live streams can be decoded directly within the browser with the bookmarklet or through the command line. To decode a live stream from the command line, e.g. https://youtu.be/KQJsNQU51ls, (you can tell it is in privacy mode if there is no sound and if the maximum resolution is 360p) you would run the following command:
streamlink --quiet \
https://youtu.be/KQJsNQU51ls 360p -o - \
| ffmpeg -nostats -loglevel 0 \
-i - -vcodec rawvideo \
-pix_fmt rgba \
-r 16 -f rawvideo - \
| pitahaya --rx mp3 \
| vlc -