Enhance Video Thumbnails: Midpoint Capture & Informative Metadata Overlay #376
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements enhanced video thumbnail generation to address the issue of poor thumbnail quality caused by capturing frames from the beginning or end of videos, which often results in black screens, credits, or unrepresentative content.
🎯 Key Features Implemented
1. Midpoint Thumbnail Capture
2. User-Configurable Thumbnail Position
thumb_positionuser setting allows users to specify 1-99% of video duration/cmd -s thumb_position3. Informative Metadata Overlay
4. Seamless Integration
🔧 Technical Implementation
Enhanced
take_ss()FunctionMetadata Extraction & Overlay
📱 User Experience
Before:
After:
🔄 Backward Compatibility
✅ Fully backward compatible - all existing code continues to work unchanged
take_ss()calls work without modificationget_ss()) maintain even distribution behavior🧪 Testing
Comprehensive testing included:
📁 Files Modified
bot/helper/ext_utils/leech_utils.py- Core thumbnail generation with metadata overlaybot/modules/users_settings.py- User settings interface and validationbot/helper/themes/wzml_minimal.py- Theme template updatesbot/helper/mirror_utils/upload_utils/pyrogramEngine.py- Integration points🎬 Example Usage
Users can now:
/cmd -s thumb_position→ reply with25for early scene captureThis enhancement significantly improves the video thumbnail experience while maintaining full compatibility with existing functionality.
Fixes #375.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.