Personal video streaming server.

tube GoDoc

This is a Golang project to build a self hosted "tube"-style video player for watching your own video collection over HTTP or hosting your own channel for others to watch.

Some of the key features include:

  • Easy to add videos (just move a file into the folder)
  • No database (video info pulled from file metadata)
  • No JavaScript (the player UI is entirely HTML)
  • Easy to customize CSS and HTML template
  • Automatically generates RSS feed (at /feed.xml)
  • Builtin Tor onion service support
  • Clean, simple, familiar UI

Currently only supports MP4 video files so you may need to re-encode your media to MP4 using something like ffmpeg.

Since all of the video info comes from metadata it's also useful to have a metadata editor such as EasyTAG (which supports attaching images as thumbnails too).

By default the server is configured to run on 127.0.0.1:0 which will assign a random port every time you run it. This is to avoid conflicting with other applications and to ensure privacy. You can configure this to be any specific host:port by editing config.json before running the server. You can also change the RSS feed details and library path from config.json.

installation

from release

  1. Download release for your platform
  2. Extract zip archive
  3. Run tube executable to start server (this will output the URL for accessing from a browser)
  4. Move videos to videos directory
  5. Open the URL from step 3 and enjoy!

from source

  1. Install Golang if you don't already have it
  2. go get github.com/wybiral/tube
  3. cd $GOPATH/src/github.com/wybiral/tube
  4. go run main.go (this will output the URL for accessing from a browser)
  5. Move videos to $GOPATH/src/github.com/wybiral/tube/videos
  6. Open the URL from step 4 and enjoy!
Owner
davy wybiral
making and breaking
davy wybiral
Comments
  • Add Docker support

    Add Docker support

    Hi wybiral! I saw your awesome project on GitHub, and works well. I want to add Docker support for this project, so I add Dockerfile and build an image on my Arch Linux machine, it works well. image

    image

    but I change a huge amount of files.

    1 I make a new dir call config, and move config.json to this dir, so user can use custom config.json override default when using docker container with -v /path/to/your/own/config.json:/container/default/config.json

    2 I remove vendor dir, when I clone this repo, execute go mod init go mod tidy, I can run go build -o tube . without error in project root directory. I'm a newbee in golang, correct me how can I build tube without remove vendor dir

  • Documentation

    Documentation

    Don't release an official v0.0.1 until this thing is better documented. Both in terms of README and in terms of code comments.

    This should be the last thing done before v0.0.1 and will probably involve a general code review to catch any missing documentation and to make sure the behavior is consistent with the docs.

  • RSS Feed

    RSS Feed

    An RSS feed should be generated from the scanned files and provided at some endpoint (maybe /feed.xml). Even better if it supports JSON feeds too (/feed.json).

    Most likely implementation: https://github.com/gorilla/feeds

  • Library Update

    Library Update

    Having to restart the server to update the library is really annoying and it would interrupt any streams currently playing. Here are some possibilities:

    • Watch the videos directory for file changes and update (best)
    • Provide a way to force an update on demand
    • Update at a configurable interval
  • Build zip archives

    Build zip archives

    Requiring a proper Go environment setup is messy and not user friendly at all. The solution will be to build the project as a zip archive for each platform containing the relative static files and binary application.

    This will probably be done with a Python script.

  • Better error messages

    Better error messages

    Errors like #15 should be more clear about why they're happening. In that case it was because the Tor controller port wasn't open so the application should notify the user about this and possibly recommend a solution (disable Tor or check the daemon, in this case).

  • Cache the feed

    Cache the feed

    Currently the RSS feed is generated every time it's requested. That's pretty wasteful if people are requesting the feed at some frequency, especially if there are a lot of videos in the library. It would be best to only build the feed after the library changes.

    It's probably easiest to move the feed generating portion into the Library type. It is a feed of the library, after all. Otherwise we'd need some kind of messaging to trigger the outside components when the library is changed.

  • Use onion address for feed defaults

    Use onion address for feed defaults

    If no explicit external_url or link values are supplied in config.json and you run the server as a Tor onion service the server should plug in the onion address for those values.

    This will make it easier to subscribe from RSS readers through a Tor proxy without any setup from a hosting perspective.

  • Tor hidden service

    Tor hidden service

    Add the following (optional) structure to config.json:

    "tor": {
      "onion_file": "/path/to/key/file",
      "controller": {
        "host": "127.0.0.1",
        "port": 9051
      }
    }
    

    If it exists the server will start a Tor hidden service using the onion key file routed to the local host:port TCP server. If the tor structure is in the config file but onion_file is blank a random onion will be generated.

    To make things even smoother, when the external_url property of feed is blank it can be filled with the onion address.

    This will make it easy to publish content on Tor in a way that RSS readers can subscribe to and remotely access.

    Outside the scope of this project: if someone implemented a Tor proxied feed reader into the backend of this you could build a YouTube-like application where people could subscribe to peer videos and host their own. Just an idea.

  • Debounce watcher

    Debounce watcher

    Currently the watcher is working overtime while a large file is being copied into the library because every flush during the copy triggers a write event in fsnotify which results in a bunch of unnecessary Library.Remove & Library.Add calls.

    This can be fixed by debouncing the watcher so that events don't cause an action on a specific path until a fixed amount of time passes with no events. It may even be optimal to just accumulate all changes to the library and perform them in batch after a reasonable debounce time.

  • Multiple library paths

    Multiple library paths

    It would be useful to support multiple library paths instead of just one. Something like this in the config.json file:

    {
      "libraries": [
        {"path": "/path/to/season01", "prefix": "s01"},
        {"path": "/path/to/season02", "prefix": "s02"}
      ]
    }
    

    The prefixes will be included in the URL paths, so you might have /v/s01/e01 and so on. This will ensure that all names are unique across multiple library paths and allow for some hierarchical structuring.

    Using "prefix" as the key may be too ambiguous though. Consider using "name" or "id" or something.

    One question this opens is how to visually convey the path difference in the UI. Especially in the sidebar video selection. Could be another line like the modified field?

  • About the number of visits supported at the same time

    About the number of visits supported at the same time

    Hi: I want to know how many people can access this system at the same time on the premise that the network bandwidth is not a problem? After the deployment of the intranet, I found that the response speed of about 6 or 7 simultaneous accesses became very slow or even stuck. Is there any optimization method?

  • Can't find config.json under ubuntu server

    Can't find config.json under ubuntu server

    Hey,

    1)about config.json When I try to run tube as a service under ubuntu 16 tls , tube can't load the config.json file automatic,but it can work well under command line in the tube folder. how about add a function like -c /path/config.json ?

    1. If organize videos with folders ,will tube support it ?

    best regards

  • Add Container support

    Add Container support

    Hi wybiral I add a Dockerfile to make this project able to run in container. to mount a config.json file from host machine, I change the project structure, move config.json to config dir. and, I also update the README.md image

    thanks!

Go-video-preview-ffmpeg-wrapper - A simple helper wrapper to generate small webm video previews using ffmpeg, useful for web previews.

Go-video-preview-ffmpeg-wrapper A simple helper wrapper to generate small webm video previews using ffmpeg, useful for web previews. Getting Started u

Jan 5, 2022
Take control over your live stream video by running it yourself. Streaming + chat out of the box.
Take control over your live stream video by running it yourself.  Streaming + chat out of the box.

Take control over your content and stream it yourself. Explore the docs » View Demo · Use Our Server for Testing · FAQ · Report Bug Table of Contents

Jan 1, 2023
live streaming server in golang
live streaming server in golang

中文 Simple and efficient live broadcast server: Very simple to install and use; Pure Golang, high performance, and cross-platform; Supports commonly us

Nov 10, 2022
Short video direct link acquisition 短视频直连获取工具
Short video direct link acquisition 短视频直连获取工具

Glink 短视频去水印一键解析应用 Short video direct link acquisition 短视频直连获取工具 Glink是一款基于go语言开发的短视频解析应用,前端使用vue+argon主题,后端使用go-fiber框架,支持web在线模式、客户端模式。

Dec 7, 2022
Quik.do is a video conferencing tool.
Quik.do is a video conferencing tool.

Quik.do is a video conferencing tool.

Jan 3, 2023
LiveKit - Open source, distributed video/audio rooms over WebRTC

LiveKit is an open source project that provides scalable, multi-user conferencing over WebRTC. It's designed to give you everything you need to build real time video/audio capabilities in your applications.

Jan 9, 2023
Go4vl is Go library for working with the Video for Linux API (V4L2) natively, without any C bindings.

go4vl A Go library for working with the Video for Linux user API (V4L2). Gov4l hides all the complexities of working with V4L2 and exposes idiomatic G

Dec 23, 2022
A simple library to extract video and audio frames from media containers (based on libav).
A simple library to extract video and audio frames from media containers (based on libav).

Reisen A simple library to extract video and audio frames from media containers (based on libav, i.e. ffmpeg). Dependencies The library requires libav

Jan 2, 2023
Stream video from ffmpeg to webrtc

ffmpeg-to-webrtc demonstrates how to send video from ffmpeg to your browser using pion.

Dec 28, 2022
Project to get Youtube video descriptions and search those videos as required

FamPayProject Project to get Youtube video descriptions and search those videos as required Prerequisities Postgres DB for persisting data Youtube Dat

Nov 5, 2021
Synthetic media is a realistic transformation of audio and video using artificial intelligence.

Synthetic media is a realistic transformation of audio and video using artificial intelligence.

Nov 20, 2021
Video converter with golang

Requirements Debian-like system (ubuntu, mint, etc...) with apt package manager Golang >1.15 Command tool make (use sudo apt install make -y to instal

Sep 10, 2022
golang function that download a video from youtube, and convert it to a mp3 file using ffmpeg

echedwnmp3 echedwnmp3 is a function that download a video from youtube, and convert it to a mp3 file using ffmpeg example package main import(echedwn

Dec 7, 2021
lmmp3 is a little golang library that download a video from youtube, and convert it to a mp3 file using ffmpeg

lmmp3 lmmp3 is a function that download a video from youtube, and convert it to a mp3 file using ffmpeg You need to have installed ffmpeg in your syst

Aug 12, 2022
ffcommander - An easy frontend to FFmpeg and Imagemagick to automatically process video and manipulate subtitles.

% FFCOMMANDER(1) ffcommander 2.39 % Mikael Hartzell (C) 2018 % 2021 Name ffcommander - An easy frontend to FFmpeg and Imagemagick to automatically pro

May 9, 2022
A go program that relies on back-end ffmpeg to process video-related content

Video Compress A go program that relies on back-end ffmpeg to process video-related content Installation v-go You can download the corresponding v-go

Dec 22, 2021
👾 Annie is a fast, simple and clean video downloader built with Go.
 👾 Annie is a fast, simple and clean video downloader built with Go.

?? Annie is a fast, simple and clean video downloader built with Go. Installation Prerequisites Install via go install Homebrew (macOS only) Arch Linu

Jun 1, 2022
SlideXtract - A tool to help extract slides from a video file.

SlideXtract A tool to help extract slides from a video file. Slides are output in the out folder. Features I didn't find any other piece of code that

Jul 3, 2022
📽 MovieGo - Video Editing in Golang

?? MovieGo - Video Editing in Golang MovieGo is a Golang library for video editing. The library is designed for fast processing of routine tasks relat

Dec 26, 2022