{"id":22432666,"url":"https://github.com/1999azzar/video-browser","last_synced_at":"2026-02-26T01:53:42.522Z","repository":{"id":247971300,"uuid":"827377078","full_name":"1999AZZAR/video-browser","owner":"1999AZZAR","description":"This project is a Flask application for streaming videos from a specified directory. It provides an API to retrieve the directory structure, play videos, and get related videos within a folder.","archived":false,"fork":false,"pushed_at":"2025-01-27T19:37:20.000Z","size":688,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-21T07:38:38.170Z","etag":null,"topics":["flask-api","flask-application","localhost","video-player","video-streaming"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1999AZZAR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-11T14:34:07.000Z","updated_at":"2025-06-10T09:01:59.000Z","dependencies_parsed_at":"2024-07-27T16:44:26.826Z","dependency_job_id":"4f78a1a9-5006-4be2-864c-76db0fbbcebf","html_url":"https://github.com/1999AZZAR/video-browser","commit_stats":null,"previous_names":["1999azzar/video-streaming-flask-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1999AZZAR/video-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fvideo-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fvideo-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fvideo-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fvideo-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1999AZZAR","download_url":"https://codeload.github.com/1999AZZAR/video-browser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1999AZZAR%2Fvideo-browser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29848627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask-api","flask-application","localhost","video-player","video-streaming"],"created_at":"2024-12-05T22:12:30.234Z","updated_at":"2026-02-26T01:53:42.497Z","avatar_url":"https://github.com/1999AZZAR.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Video Browser\n\n**Video Browser** is a powerful, web-based video management application that provides a seamless way to browse, play, and manage videos stored on a local server. Built with Python's Flask framework, this application integrates features such as dynamic thumbnail generation, subtitle extraction, directory browsing, and video streaming, all through an intuitive web interface.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n  - [Running the Server](#running-the-server)\n  - [API Endpoints](#api-endpoints)\n- [Directory Structure](#directory-structure)\n- [Video Playback](#video-playback)\n- [Thumbnail Generation](#thumbnail-generation)\n- [Subtitle Extraction](#subtitle-extraction)\n- [Caching Mechanism](#caching-mechanism)\n- [Error Handling](#error-handling)\n- [Logging](#logging)\n- [Contributing](#contributing)\n- [Demo](#demo)\n\n## Overview\n\n**Video Browser** provides a user-friendly platform for managing a local library of video files. Designed for users who want a lightweight yet feature-rich solution, it allows you to stream videos, generate and display thumbnails, extract subtitles, and navigate directories—all through a web interface that runs locally on your machine or a remote server.\n\n## Features\n\n- **Video Streaming**: Stream video files directly from your server to any web browser.\n- **Dynamic Thumbnail Generation**: Automatically generate video thumbnails using FFmpeg.\n- **Subtitle Extraction**: Extract and serve subtitles for videos using FFmpeg.\n- **Directory Browsing**: Browse the server's file structure to locate and play video files.\n- **Caching Mechanisms**: Enhance performance through caching of thumbnails and directory structures.\n- **Customizable Settings**: Configure paths, file types, server details, and more via a simple configuration file.\n- **RESTful API**: Interact programmatically with the server using well-defined API endpoints.\n- **Cross-platform Compatibility**: Run the application on any operating system that supports Python.\n\n## Prerequisites\n\nEnsure you have the following installed:\n\n- **Python 3.x**: [Download Python](https://www.python.org/downloads/)\n- **FFmpeg**: Required for video processing tasks (thumbnail generation and subtitle extraction). Install FFmpeg from [FFmpeg's official website](https://ffmpeg.org/download.html).\n\n## Installation\n\nTo set up **Video Browser** on your machine:\n\n1. **Clone the repository**:\n\n   ```sh\n   git clone https://github.com/1999AZZAR/video-browser.git\n   cd video-browser\n   ```\n\n2. **Install the required dependencies**:\n\n   Make sure you have Python 3.x installed, then install the necessary Python packages:\n\n   ```sh\n   pip install -r requirements.txt\n   ```\n\n3. **Install FFmpeg**:\n\n   Follow the instructions for your operating system to install FFmpeg from [here](https://ffmpeg.org/download.html).\n\n## Configuration\n\nThe application uses a configuration file (`config.ini`) to manage settings such as server details, file paths, and supported file extensions.\n\n### Sample `config.ini`\n\n```ini\n[Server]\nHOST = 0.0.0.0         ; Host IP address for the server\nPORT = 5000            ; Port number for the server\nBASE_URL = /           ; Base URL path for the application\n\n[Paths]\nVIDEO_DIR = /path/to/your/videos  ; Directory containing your video files\nTHUMBNAIL_DIR = /path/to/thumbnails ; Directory to store generated thumbnails\n\n[Videos]\nEXTENSIONS = .mp4,.mkv,.avi    ; Supported video file extensions\n\n[Subtitles]\nEXTENSIONS = .srt,.vtt         ; Supported subtitle file extensions\n\n[Display]\nSHOW_HIDDEN = False            ; Show hidden files and directories\n```\n\n- **HOST**: IP address to bind the server (e.g., `0.0.0.0` for all IPs).\n- **PORT**: Port number on which the server will run.\n- **VIDEO_DIR**: Directory where the video files are stored.\n- **THUMBNAIL_DIR**: Directory to store and cache generated thumbnails.\n- **EXTENSIONS**: Comma-separated list of supported video and subtitle file extensions.\n- **SHOW_HIDDEN**: Option to show or hide hidden files and directories in the web interface.\n\n## Usage\n\n### Running the Server\n\nTo run the server, navigate to the project directory and execute:\n\n```sh\npython video_browser.py\n```\n\nThe server will start, and you can access the application in your web browser by navigating to `http://\u003cyour-ip-address\u003e:\u003cport\u003e`.\n\n### API Endpoints\n\nThe application provides several RESTful API endpoints for interaction:\n\n- **GET /**: Displays the homepage with a list of available videos.\n- **GET /api/structure**: Returns the directory structure of the video directory in JSON format.\n- **GET /play/\u003cfilename\u003e**: Plays the selected video file.\n- **GET /video/\u003cfilename\u003e**: Streams the requested video file.\n- **GET /thumbnail/\u003cfilename\u003e**: Returns the thumbnail image for the video.\n- **GET /api/related-videos**: Provides a list of related videos in the same directory.\n\n## Directory Structure\n\nThe application recursively scans the configured `VIDEO_DIR` and presents a structured view of folders and supported video files. The browsing experience is configurable via the `SHOW_HIDDEN` parameter in the configuration file, which determines whether hidden files and directories are displayed.\n\n## Video Playback\n\nThe **Video Browser** uses the HTML5 `\u003cvideo\u003e` element for seamless playback of supported video formats. The server streams the video file directly, allowing playback to start without downloading the entire file.\n\n## Thumbnail Generation\n\nThumbnails are generated using FFmpeg by extracting a frame from the middle of the video file. If a thumbnail does not exist, it will be created the first time a video is accessed. Thumbnails are stored in the configured `THUMBNAIL_DIR`.\n\n### Caching Mechanism\n\nTo improve performance, the application employs caching mechanisms:\n\n- **Thumbnails**: Once generated, thumbnails are cached in the `THUMBNAIL_DIR`.\n- **Directory Structure**: The directory structure of the `VIDEO_DIR` is cached to minimize the need for repeated filesystem scans.\n\n## Subtitle Extraction\n\nSubtitles are extracted using FFmpeg and served alongside the video files when available. The server checks for external subtitle files with supported extensions (`.srt`, `.vtt`) and extracts embedded subtitles from videos.\n\n## Caching Mechanism\n\nThe **Video Browser** uses a caching mechanism to enhance performance:\n\n- **Thumbnails**: Once generated, thumbnails are cached in the `THUMBNAIL_DIR` to reduce processing time for future requests.\n- **Directory Structures**: The application caches directory structures to speed up browsing, reducing the need for repeated directory scans.\n\n## Error Handling\n\nThe application is designed to handle various errors gracefully:\n\n- **404 Not Found**: Returned when a requested video or thumbnail does not exist.\n- **500 Internal Server Error**: Triggered by server-side issues like misconfigurations or file access errors.\n- **FFmpeg Errors**: FFmpeg-related errors (e.g., missing files, unsupported formats) are logged, and appropriate HTTP status codes are returned to the client.\n\n## Logging\n\nAll activities, including server requests, errors, and debug information, are logged to a file for monitoring and troubleshooting purposes. The logging behavior and level (e.g., `INFO`, `DEBUG`, `ERROR`) can be adjusted within the `_configure_logging` method in the `video_browser.py` script.\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix.\n3. Commit your changes with clear messages.\n4. Submit a pull request to the main repository.\n\nPlease ensure your code adheres to the project's coding standards and includes relevant documentation and tests.\n\n## Demo\n\n![demo 1](demo/1.png)\n![demo 2](demo/2.png)\n![demo 3](demo/3.png)\n![demo 4](demo/4.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fvideo-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1999azzar%2Fvideo-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1999azzar%2Fvideo-browser/lists"}