Static HTML video gallery generator.
vsite is a command-line tool written in Go that scans a directory
containing video files and generates static HTML pages for browsing and
playing videos in the browser.
- Recursive scanning of directories and subdirectories
- Generation of listing pages with folder navigation
- Integrated video player (Plyr) with advanced controls
- Automatic conversion of incompatible formats to MP4
- NVIDIA GPU acceleration support (NVENC)
- Responsive design with dark theme
- Video navigation (previous/next)
- Keyboard shortcuts in player
- Auto-play next video
git clone https://github.com/rdeavila/vsite.git
cd vsite
make buildmake # Build optimized binary (default)
make build # Build optimized binary
make build-debug # Build with debug symbols
make build-all # Build for all platforms
make build-linux # Build for Linux amd64
make build-darwin # Build for macOS arm64
make build-windows # Build for Windows amd64
make clean # Remove build artifacts
make test # Run tests
make deps # Download dependencies
make install # Install to /usr/local/bin
make install-user # Install to ~/.local/bin
make uninstall # Uninstall
make info # Show binary information
make compress # Compress with UPX
make serve # Start HTTP server with video seeking support
make help # Show helpTo use video conversion (--convert):
# Debian/Ubuntu
sudo apt install ffmpeg
# Fedora/RHEL
sudo dnf install ffmpegvsite [options] <directory>| Option | Description |
|---|---|
-t, --title <text> |
Sets the title of the main page (default: "Videos") |
--convert |
Converts incompatible videos (avi, mkv, mov) to MP4 |
--gpu |
Uses NVIDIA GPU (NVENC) for faster conversion |
-c, --clean |
Removes all generated HTML files from the directory |
--clean-converted |
Removes converted MP4 files (keeps originals) |
--clean-original |
Removes original files that were converted (keeps MP4) |
-h, --help |
Shows help |
-v, --version |
Shows version |
Generate HTML gallery:
vsite /path/to/videosGenerate with custom title:
vsite --title "My Collection" /path/to/videosConvert incompatible videos and generate HTML:
vsite --convert /path/to/videosConvert using NVIDIA GPU:
vsite --convert --gpu /path/to/videosClean generated HTML files:
vsite --clean /path/to/videosRemove converted MP4 files (keep originals):
vsite --clean-converted /path/to/videosRemove original files that were converted (keep MP4):
vsite --clean-original /path/to/videosTo play videos with seeking support (clicking on the progress bar), you need an HTTP server that supports range requests.
cd /path/to/videos
make -C /path/to/vsite serveThis starts http-server on port 8000 with range request support.
# Node.js http-server
npx http-server -p 8000
# Python with range support
pip install rangehttpserver
python -m RangeHTTPServer 8000Note: Python's built-in http.server does NOT support range requests,
which means video seeking will not work properly.
.mp4(H.264).webm(VP8/VP9).ogv(Theora)
.avi.mkv.mov.wmv.flv
Use the --convert option to automatically convert these formats to MP4.
HTML files are created directly in the video directory:
/your/directory/
├── video1.mp4
├── video2.mp4
├── subfolder/
│ └── video3.mp4
├── index.html # Main page
├── style.css # CSS styles
├── subfolder_index.html # Subfolder index
├── player_video1.html # video1 player
├── player_video2.html # video2 player
└── player_subfolder_video3.html
The --gpu option uses NVIDIA's NVENC encoder to accelerate video
conversion up to 10x compared to CPU.
- NVENC-compatible NVIDIA GPU
- NVIDIA driver installed (
nvidia-smimust work) - ffmpeg compiled with NVENC support
# Debian/Ubuntu
sudo apt install nvidia-driver-535
# Fedora/RHEL
sudo dnf install akmod-nvidia| Parameter | Value |
|---|---|
| Codec | H.264 (libx264) |
| Preset | fast |
| CRF | 22 |
| Audio | AAC 128kbps |
| Parameter | Value |
|---|---|
| Codec | H.264 (h264_nvenc) |
| Preset | p4 |
| CQ | 23 |
| Audio | AAC 128kbps |
The player uses the Video.js library and offers:
- Playback controls (play, pause, volume, fullscreen)
- Progress bar with seeking
- Speed control (0.5x to 2x)
- Picture-in-Picture
- Navigation between videos in the same directory
- Chromecast support (when served over HTTPS on a public domain)
| Key | Action |
|---|---|
| Space | Play/Pause |
| Left/Right arrows | Seek 5 seconds |
| Up/Down arrows | Volume |
| M | Mute/Unmute |
| F | Fullscreen |
| Esc | Back to listing |
vsite/
├── main.go # CLI entry point
├── go.mod # Go module
├── Makefile # Build automation
├── README.md # Documentation
├── LICENSE # MIT License
└── generator/
├── generator.go # HTML generation logic
└── templates/
├── index.html # Listing template
└── player.html # Player template
MIT License - see LICENSE file for details.