A C++ library for overlaying animated sign language subtitles on videos, enhancing accessibility for deaf and hard-of-hearing individuals.
This library processes videos by adding sign language subtitles based on provided subtitle tracks. It features dynamic animations that reflect subtitle intensity, supporting three levels:
- High Intensity: Subtitles grow progressively larger
- Medium Intensity: Subtitles oscillate with ±15 degrees rotation
- Low Intensity: Subtitles remain static
- Overlay sign language subtitles on video frames
- Support for intensity-based animations
- Multi-word subtitle handling with vertical stacking
- Dynamic subtitle track processing via JSON input
- Automatic video processing and subtitle embedding
- C++ Compiler (GCC 9+ or equivalent)
- CMake (Build system generator)
- OpenCV (Video processing and image manipulation)
- nlohmann/json (JSON subtitle track parsing)
sudo apt-get update
sudo apt-get install -y build-essential cmake libopencv-devgit clone https://github.com/your-repo/sign-language-subtitle-processor.git
cd sign-language-subtitle-processormkdir build
cd build
cmake ..
makeThe library is accessed through the video_overlay executable:
./video_overlay <input_video> <subtitles_json> <image_folder> <output_video>Example:
./video_overlay ../src/input.mp4 ../src/subtitles.json ../images/ ../src/output.mp4[
{
"term": "Header Goal",
"start_time": 1.00,
"end_time": 4.00,
"intensity": "High"
},
{
"term": "Welcome Goal",
"start_time": 5.00,
"end_time": 8.00,
"intensity": "Medium"
}
]Place sign language gesture images in the images/ folder:
- Required format: PNG files named a.png through z.png
- Each image represents a single character's sign language gesture
.
├── src/
│ ├── VideoProcessor.cpp/h
│ ├── SubtitleTrack.cpp/h
│ ├── ImageLoader.cpp/h
│ ├── SignLanguageCombiner.cpp/h
│ ├── OverlayManager.cpp/h
│ └── main.cpp
├── include/
├── images/
├── subtitles.json
├── input.mp4
├── output.mp4
├── CMakeLists.txt
└── README.md
Words are stacked vertically for improved readability:
Header
Goal
- High Intensity: Progressive scaling effect
- Medium Intensity: Smooth ±15° rotation
- Low Intensity: Static display
- Dynamic scaling to fit video frame
-
Missing Dependencies
- Verify OpenCV and nlohmann/json installation
- Check CMakeLists.txt for correct library paths
-
Incorrect File Paths
- Confirm paths to input.mp4, subtitles.json, and images/
-
Clipping/Missing Subtitles
- Ensure images/ contains all required character images (a-z)
- Additional language and alphabet support
- Real-time video processing capabilities
- Customizable subtitle animations and styles
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request