refactor: Clean up encoder_params module

- Improved parameter organization
- Better error handling and logging
- More consistent code style
- Added detailed comments for parameter choices
This commit is contained in:
pacnpal
2024-11-14 22:36:50 +00:00
parent 4719f567c6
commit 2f449e6120

View File

@@ -95,7 +95,7 @@ class EncoderParams:
params = {}
try:
duration = video_info.get("duration", 0)
input_size = video_info.get("bitrate", 0) * duration / 8 # Estimate from bitrate if size not available
input_size = video_info.get("bitrate", 0) * duration / 8 # Estimate from bitrate
if duration > 0 and input_size > target_size_bytes:
video_size_target = int(target_size_bytes * 0.95)