GitHub - PulseBeat02/yt-media-storage: https://www.youtube.com/watch?v=l03Os5uwWmk
Extracto
https://www.youtube.com/watch?v=l03Os5uwWmk. Contribute to PulseBeat02/yt-media-storage development by creating an account on GitHub.
Resumen
Resumen Principal
"yt-media-storage" es un proyecto innovador que redefine la forma en que los archivos digitales pueden ser almacenados y distribuidos al codificarlos en vídeo sin pérdidas y posteriormente decodificarlos a su formato original. La esencia de esta herramienta radica en transformar cualquier tipo de archivo en un flujo de vídeo utilizando el codec FFV1 dentro de un contenedor MKV, operando a una resolución de 4K (3840x2160) y 30 FPS, garantizando así la integridad total de los datos. Este ingenioso enfoque permite aprovechar plataformas de vídeo, como YouTube, como un medio de almacenamiento redundante y accesible globalmente para datos arbitrarios. El sistema está diseñado con una fuerte énfasis en la fiabilidad y la seguridad, integrando Wirehair Fountain Codes para proporcionar resiliencia ante la pérdida o corrupción de datos y una capa de cifrado opcional mediante XChaCha20-Poly1305 con libsodium. Ofrece flexibilidad a través de interfaces de línea de comandos (CLI) y gráficas de usuario (GUI), facilitando su adopción, y su desarrollo bajo la licencia GPLv3 subraya un compromiso con el código abierto y la transparencia.
Elementos Clave
- Transformación Innovadora de Archivos a Video Sin Pérdidas: La funcionalidad central es la capacidad de codificar cualquier archivo en un formato de vídeo FFV1/MKV (4K, 30 FPS) y luego decodificarlo de vuelta a su estado original sin la más mínima pérdida de información. Esto convierte los archivos en streams de vídeo ideales para ser alojados en plataformas de vídeo, aprovechando su infraestructura robusta para el almacenamiento y la distribución de datos de manera novedosa.
- Robustez y Seguridad Mediante Cifrado y Códigos Fuente: El sistema integra Wirehair Fountain Codes para añadir una capa crucial de redundancia a los datos codificados. Esto asegura que el archivo original pueda ser reconstruido incluso si algunas partes del vídeo se dañan o se pierden. Complementando esto, ofrece una opción de **
Contenido
Media Storage
Explanation Video: https://youtu.be/l03Os5uwWmk?si=xgZPNMrvs_aDcWE5
YC Hacker News: https://news.ycombinator.com/item?id=47012964
Stores files onto YouTube by encoding them into lossless video and decoding them back to the original file. Supports both a command-line interface and a graphical user interface.
Features
- File Encoding/Decoding: Encode any file into a lossless video (FFV1/MKV) and then decode it back to the original file
- Fountain Codes: Uses Wirehair fountain codes for redundancy and repair
- Optional Encryption: Encrypt files with a password using libsodium (XChaCha20-Poly1305)
- Batch Processing: Queue multiple files for batch encoding (GUI)
- Progress Tracking: Real-time progress bars and status updates (GUI)
CI/CD Pipeline
Visit my CI/CD pipeline, and click "Login as Guest". Visit the yt-media-storage project, click on the latest passing build, and click "Artifacts" to download the latest build artifacts for both the CLI and GUI. You may need to install some shared libraries (FFmpeg, Qt6, libsodium) to run the executables.
Requirements
- CMake 3.22
- C++23 compiler
- FFmpeg
- libsodium
- OpenMP
- Qt6 (Core and Widgets)
Installation
Ubuntu/Debian
sudo apt update sudo apt install cmake build-essential qt6-base-dev \ libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev \ libsodium-dev libomp-dev ffmpeg
Fedora/CentOS
sudo dnf install cmake gcc-c++ qt6-qtbase-devel ffmpeg-devel libsodium-devel libgomp
Arch Linux
sudo pacman -S cmake qt6-base ffmpeg libsodium openmp
macOS (Homebrew)
brew install cmake qt@6 ffmpeg libsodium libomp
Windows (vcpkg)
vcpkg install ffmpeg libsodium openmp qt6
Or install Qt6 separately via the Qt Online Installer and FFmpeg/libsodium via vcpkg.
Building
mkdir build cmake -B build cmake --build build
This produces two executables:
media_storage— Command-line interfacemedia_storage_gui— Graphical user interface
Usage
CLI
./media_storage encode --input <file> --output <video> [--encrypt --password <pwd>]
./media_storage decode --input <video> --output <file>
GUI
Single File Operations
-
Encode a file to video:
- Click "Browse..." next to "Input File" to select the file you want to encode
- Click "Browse..." next to "Output File" to choose where to save the video
- Click "Encode to Video" to start the process
-
Decode a video to file:
- Click "Browse..." next to "Input File" to select the video file
- Click "Browse..." next to "Output File" to choose where to save the decoded file
- Click "Decode from Video" to start the process
Batch Operations
- Click "Add Files" to add multiple files to the batch queue
- Select an output directory for all encoded videos
- Click "Batch Encode All" to process all files in sequence
Monitoring
- The progress bar shows the current operation progress
- Status label displays current operation status
- Logs panel provides detailed information about each step
- All operations run in separate threads to keep the UI responsive
Technical Details
- Encoding: Files are chunked, encoded with fountain codes, and embedded into video frames
- Decoding: Packets are extracted from video frames and reconstructed into the original file
- Video Format: FFV1 codec in MKV container (lossless)
- Frame Resolution: 3840x2160 (4K) at 30 FPS
- Encryption: Optional XChaCha20-Poly1305 via libsodium
Troubleshooting
Build Issues
- Qt6 not found: Ensure Qt6 development packages are installed
- FFmpeg libraries missing: Install FFmpeg development packages
- libsodium missing: Install libsodium development packages
- OpenMP errors: Install OpenMP development packages
Runtime Issues
- Cannot open input file: Check file permissions and paths
- Encoding fails: Ensure sufficient disk space for output video
- Decoding fails: Verify the input file is a valid encoded video
- Encode Error: failed to write header: Make sure you have at least FFMPEG version 8 in-order to use FFV1 encoder on mp4. Otherwise, use mkv instead.
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Fuente: GitHub