|
|
||
|---|---|---|
| .gitignore | ||
| CMakeLists.txt | ||
| README.md | ||
| frame_extractor.cpp | ||
| frame_extractor.h | ||
| main.cpp | ||
| platform_utils.cpp | ||
| platform_utils.h | ||
| tiff_writer.cpp | ||
| tiff_writer.h | ||
README.md
framerip
Extracts every frame from a video file and writes them as uncompressed RGB TIFF images into a temporary directory. Compiles on macOS, Linux, and Windows.
Dependencies
| Library | Purpose |
|---|---|
libavformat |
Container demuxing |
libavcodec |
Video decoding |
libavutil |
FFmpeg utilities |
libswscale |
Pixel-format conversion |
All four are part of FFmpeg. No other external libraries are required — TIFF files are written with a hand-rolled encoder.
Building
macOS (Homebrew)
brew install ffmpeg cmake
git clone <this-repo>
cd fr
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
Linux (apt)
sudo apt update
sudo apt install ffmpeg libavcodec-dev libavformat-dev \
libavutil-dev libswscale-dev cmake build-essential
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
Linux (dnf / Fedora)
sudo dnf install ffmpeg-devel cmake gcc-c++
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
Windows (vcpkg + MSVC)
- Install vcpkg and integrate it:
git clone https://github.com/microsoft/vcpkg
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
.\vcpkg install ffmpeg:x64-windows
- Build:
cmake -B build -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
Windows (manual FFmpeg build / pre-built binaries)
Download pre-built FFmpeg dev libs from https://github.com/BtbN/FFmpeg-Builds/releases and pass their paths to CMake:
cmake -B build `
-DFFMPEG_INCLUDE_DIR="C:\ffmpeg\include" `
-DFFMPEG_LIB_DIR="C:\ffmpeg\lib" `
-DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
Usage
fr <video_file>
Example:
./build/fr sample.mp4
Output:
Output directory: /tmp/vfe_frames_aBcDeF
Video: sample.mp4
Stream duration: 12.34s | Resolution: 1920x1080
Extracting frames...
Written frame 0 -> /tmp/vfe_frames_aBcDeF/frame_00000000.tif
Written frame 100 -> /tmp/vfe_frames_aBcDeF/frame_00000100.tif
...
Done. Extracted 370 frame(s) to:
/tmp/vfe_frames_aBcDeF
Frames are named frame_XXXXXXXX.tif (zero-padded to 8 digits).
TIFF format details
Each file is a baseline TIFF 6.0 image:
| Property | Value |
|---|---|
| Colour space | RGB |
| Bits per sample | 8 per channel (24-bit) |
| Compression | None (1) |
| Planar config | Chunky (interleaved) |
| Byte order | Little-endian |
| Strip layout | Single strip (full image) |
These files open correctly in Photoshop, GIMP, Preview, Windows Photo Viewer, ImageMagick, and any other TIFF-capable application.
Project structure
fr/
├── CMakeLists.txt # Cross-platform build script
├── main.cpp # Entry point
├── frame_extractor.h/.cpp # libav decoding + RGB conversion
├── tiff_writer.h/.cpp # Dependency-free TIFF encoder
└── platform_utils.h/.cpp # Temp-dir + path helpers (Win/POSIX)
License
MIT — do whatever you like with it.