Pitahaya
home | info | other | com
Low bandwidth mode

In this mode, you can transmit binary data @ 2.56 kbps in real time over a video signal. The signal blanks out when no data is being transmitted, saving additional bandwidth.
Encoding
Requires: ffmpeg and node.js.
If running windows, install cygwin to run the commands on this page.

The following command will transmit data from stdin to an ffplay window

pitahaya --tx com \
| ffmpeg -nostats -loglevel 0 -f lavfi \
-i anullsrc=channel_layout=stereo:sample_rate=44100 -framerate 8 \
-f rawvideo -pixel_format rgba -video_size 256x144 -i - -vcodec rawvideo -pix_fmt rgba \
-r 30 -f rawvideo - | ffmpeg -nostats -loglevel 0 -f lavfi \
-i anullsrc=channel_layout=stereo:sample_rate=11025 -framerate 30 \
-f rawvideo -pixel_format rgba -video_size 256x144 -i - -shortest \
-c:v libx264 -pix_fmt yuv420p -crf 37 \
-preset veryslow -r 30 -g 60 -f flv - \
| ffplay -nostats -loglevel 0 -
The following command will live stream data from stdin to YouTube
pitahaya --tx com \
| ffmpeg -nostats -loglevel 0 -f lavfi \
-i anullsrc=channel_layout=stereo:sample_rate=44100 -framerate 8 \
-f rawvideo -pixel_format rgba -video_size 256x144 -i - -vcodec rawvideo -pix_fmt rgba \
-r 30 -f rawvideo - | ffmpeg -nostats -loglevel 0 -f lavfi \
-i anullsrc=channel_layout=stereo:sample_rate=11025 -framerate 30 \
-f rawvideo -pixel_format rgba -video_size 256x144 -i - -shortest \
-c:v libx264 -pix_fmt yuv420p -crf 37 \
-preset veryslow -r 30 -g 60 -f flv \
"rtmp://a.rtmp.youtube.com/live2/abcd-efgh-ijkl-mnop-qrst"
Note that you can stream to different servers, e.g. Twitch, by replacing the rtmp url on the last line, e.g. "rtmp://hou.contribute.live-video.net/app/TWITCHSTREAMKEY"
Decoding via command line
Requires: ffmpeg, node.js, and streamlink.
Receive data with the following command: (replace abcdefghijk with a valid youtube url path)
streamlink --quiet \
https://youtu.be/abcdefghij 144p -o - \
| ffmpeg -nostats -loglevel 0 \
-i - -vcodec rawvideo \
-pix_fmt rgba \
-r 16 -f rawvideo - \
| pitahaya --rx 144p
The received data will output to stdout
Encryption If you want to password protect the data transmission, add a passphrase via pitahaya --tx com somepassphrase when encoding or pitahaya --rx 144p somepassphrase when decoding.