``` YouTube 作为存储 ```
YouTube as Storage

原始链接: https://github.com/PulseBeat02/yt-media-storage

## yt-media-storage:将文件以无损视频形式存储在YouTube上 yt-media-storage 是一种工具,通过将其编码为无损视频,然后解码回原始形式,将任何文件类型存储在 YouTube 上。它提供了一个命令行界面 (`media_storage`) 和一个图形用户界面 (`media_storage_gui`),方便使用。 主要功能包括:无损 FFV1/MKV 编码、通过 Wirehair fountain codes 实现冗余、可选的带有密码的 XChaCha20-Poly1305 加密,以及批量处理功能。GUI 提供实时进度跟踪和详细日志。 要运行,您需要安装 CMake、C++23 编译器、FFmpeg、libsodium、OpenMP 和 Qt6 等依赖项。预构建的二进制文件可通过项目的 CI/CD 管道获得(链接在原文中)。 该工具通过将文件分块,将其嵌入到 4K/30FPS 视频中,然后在解码期间提取它们来工作。它以 GNU 通用公共许可证发布,允许免费分发和修改。

## YouTube 作为存储:摘要 最近的 Hacker News 讨论探讨了将 YouTube 作为数据存储介质的想法,利用其巨大的容量和可访问性。该项目在 GitHub 上详细介绍,使用喷泉码在视频帧中编码数据以实现冗余。虽然看似非常规,但该概念建立在利用免费在线服务进行存储的历史之上(例如早期的 GMail 黑客)。 讨论强调了 YouTube 的转码过程可能损坏嵌入数据的担忧,以及平台删除内容的权利。然而,支持者认为,通过多次上传以及 YouTube 上海量的数据,丢失的可能性很小。 许多评论员指出了固有的风险和效率低下,提倡使用专门的存储解决方案。另一些人指出 YouTube 可能会将此数据用于 AI 训练,从而使其保存对 Google 来说在经济上是可行的。对话还涉及了利用并非为此目的而设计的服务的伦理影响,以及更广泛的集中式数据控制问题。最终,该项目被呈现为一个有趣实验,而不是一个实用的长期存储解决方案。
相关文章

原文

CodeFactor TeamCity Full Build Status

Star History Chart

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.

  • File Encoding/Decoding: Encode any file into a lossless video (FFV1/MKV) and decode it back
  • 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)

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.

  • CMake 3.22
  • C++23 compiler
  • FFmpeg
  • libsodium
  • OpenMP
  • Qt6 (Core and Widgets)
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
sudo dnf install cmake gcc-c++ qt6-qtbase-devel ffmpeg-devel libsodium-devel libgomp
sudo pacman -S cmake qt6-base ffmpeg libsodium openmp
brew install cmake qt@6 ffmpeg libsodium libomp
vcpkg install ffmpeg libsodium openmp qt6

Or install Qt6 separately via the Qt Online Installer and FFmpeg/libsodium via vcpkg.

mkdir build
cmake -B build
cmake --build build

This produces two executables:

  • media_storage — Command-line interface
  • media_storage_gui — Graphical user interface
./media_storage encode --input <file> --output <video> [--encrypt --password <pwd>]
./media_storage decode --input <video> --output <file>
  1. 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
  2. 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
  1. Click "Add Files" to add multiple files to the batch queue
  2. Select an output directory for all encoded videos
  3. Click "Batch Encode All" to process all files in sequence
  • 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
  • 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
  • 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
  • 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

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.

联系我们 contact @ memedata.com