Sharing your channel with kosmi.io - vexorian/dizquetv GitHub Wiki

https://kosmi.io/ is a site that allows you to create chat rooms where you can watch stuff together with your friends. It is indeed possible to use this to safely share a dizqueTV stream. However, there are some requirements:

  • A public web server that can serve your files through https .
  • ffmpeg installed in that server (or a host that can write files that can be then accessed by said web server.

Step 1 : Generating a HLS stream from a channel

ffmpeg -f concat -safe 0 -i http://192.168.0.10:8000/playlist?channel=14 -vcodec copy -f hls -hls_flags delete_segments -hls_list_size 20 mychannel.m3u8
  • Replace 14 with your channel's number
  • my-folder is some folder that's used by your web server.
  • You'd likely also want to enable normalization and change the codecs in ffmpeg tab to something like libxh264 and ac3 so that the stream works in a web browser.

Some details of what this ffmpeg command is doing:

  • -f concat, means that its job will be to join together the videos in the playlist as a single stream. This is basically what dizquetv does normally, the difference is that dizquetv's concat call uses the ts format instead of hls.
  • -safe 0 disables the file name protections, since the file is actually a call to http, you need to do this.
  • -i http://192.168.0.10:8000/playlist?channel=14 tells ffmpeg to read the playlist from the channel's playlist endpoint, this playlist is normally used by dizquetv to generate a sequence of 100 videos to play for that channel
  • -vcodec copy tells ffmpeg to copy the codec instead of transcoding, the contents of playlist endpoint will already do the transcoding as determined by the ffmpeg tab in the dizqueTV settings.
  • -f hls : Tells ffmpeg that the output format will be HLS. HLS stream format is very popular and a site like Kosmi probably requires it.
  • -hls_flags delete_segments -hls_list_size 20: Tells it to only keep a limited number of .ts fragment files, so that there will be only 20 fragments at once. More fragments equals more freedom to rewind the stream, less fragments means less storage usage.
  • my-folder/my-channel.m3u8 is the path where to save the m3u8 file. Note that my-folder/ will start getting full of files , the HLS "fragments" for the stream.

Step 2 : Testing your stream.

Since your ffmpeg is now generating the m3u8 file and tons of .ts files in your folder, you should be able to use the stream url https://my-web-server/my-folder/my-channel.m3u8 in VLc or MPV

Step 3: Use that url in kosmi.io

It should (hopefully) work now.

Notes

  • Make sure to stop the HLS stream when your friends are done watching. (press control + C)
  • You'll have to run the ffmpeg command whenever you want to do this.
  • There are plans to add a HLS endpoint to dizqueTV soon, but I would still recommend running ffmpeg outside of dizquetv and using those files in the web server to access the stream, because it won't require you to share the dizquetv port (keep in mind that at the moment it is simply NOT safe to expose dizquetv's port to the outside world).