This is a lightweight audio-video player built in Rust using FFmpeg libraries. It demonstrates the usage of FFmpeg with Rust to play back video files.
Last updated Jun 25, 2026
65
Stars
7
Forks
1
Issues
0
Stars/day
Attention Score
25
Topics
Language breakdown
Rust 84.5%
Slint 15.5%
โธ Files
click to expand
README
FFmpeg Rust Video Player
A professional audio-video player built in Rust using FFmpeg and Slint UI. Features a modern interface with full playback controls, audio support, and cross-platform compatibility.
Features
Video Playback
- Multiple Input Sources: Play videos from URLs or local files
- Format Support: MP4, MKV, AVI, MOV, WebM, FLV, WMV, M4V
- High-Quality Rendering: Hardware-accelerated video decoding with FFmpeg
- Aspect Ratio Preservation: Videos display with correct proportions
Audio Playback
- Full Audio Support: Synchronized audio-video playback
- Volume Control: Real-time volume adjustment with slider
- Multi-format Audio: Supports various audio codecs
- Audio-Video Sync: Proper synchronization between audio and video
UI
- Responsive Layout: Adapts to different window sizes
- Loading Animations: Visual feedback during video loading
- File Browser: Native file selection dialog
- URL Input: Direct video URL support
Quick Start
Prerequisites
Rust: Install from rustup.rs
FFmpeg Development Libraries:
# Linux (Debian/Ubuntu) sudo apt update sudo apt install clang libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev libavdevice-dev libasound2-dev pkg-config
macOS (Homebrew)
brew install pkg-config ffmpeg
Windows (vcpkg)
vcpkg install ffmpeg --triplet x64-windows
Installation & Usage
- Clone and Build:
git clone https://github.com/JeninSutradhar/ffmpeg-VideoPlayer-Rust_Slint
cd ffmpeg-VideoPlayer-Rust_Slint
cargo build --release
- Run the Player:
cargo run --release
or
./target/release/ffmpeg
- Load Content:
How to Use
Loading Videos
- URL Playback:
- Local Files:
Playback Controls
- โถ Play/โธ Pause: Toggle playback
- โน Stop: Stop video and reset
- Seek Bar: Drag to jump to any position
- ๐ Volume: Adjust audio level (0-100%)
- Time Display: Shows current/total time
๐ ๏ธ Technical Details
Architecture
- FFmpeg: Video/audio decoding and processing
- Slint UI: Modern, cross-platform user interface
- CPAL: Cross-platform audio output
- Ring Buffer: Smooth audio streaming
- Threading: Separate threads for UI, video, and audio processing
Performance
- Hardware Acceleration: Uses FFmpeg's optimized decoders
- Memory Efficient: Streaming playback with minimal memory usage
- Real-time Processing: Low-latency audio-video synchronization
- Cross-platform: Native performance on all supported platforms
๐ Supported Platforms
- โ Linux (Tested)
- โ Windows
- โ macOS
- ๐ Android (Planned)
- ๐ WebAssembly (Planned)
๐ Supported Formats
Video Formats
- MP4, MKV, AVI, MOV, WebM, FLV, WMV, M4V
- H.264, H.265, VP8, VP9, AV1
- Any format supported by FFmpeg
Audio Formats
- AAC, MP3, FLAC, OGG, WAV
- Any audio codec supported by FFmpeg
๐ง Development
Building from Source
# Debug build
cargo build
Release build (recommended)
cargo build --release
Run tests
cargo test
Dependencies
ffmpeg-next: FFmpeg bindings for Rustslint: Modern UI frameworkcpal: Cross-platform audio libraryringbuf: Lock-free ring buffer for audiorfd: Native file dialogs
๐ Known Issues
- Seeking functionality is implemented but may need refinement
- Some exotic video formats may not work perfectly
- WebAssembly support is planned but not yet implemented
๐ค Contributing
Contributions are welcome! Please feel free to:
- Report bugs and issues
- Suggest new features
- Submit pull requests
- Improve documentation
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- FFmpeg - The multimedia framework
- Slint - The UI framework
- CPAL - Cross-platform audio library
- Rust Community - For the amazing ecosystem
Made with โค๏ธ in Rust
๐ More in this category