-
Notifications
You must be signed in to change notification settings - Fork 50
Encoder: properly set frame pts values #726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if method == "to_file": | ||
validate_frames_properties(actual=encoded_by_us, expected=encoded_by_ffmpeg) | ||
else: | ||
assert method == "to_tensor", "wrong test parametrization!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly enough, the call to validate_frames_properties()
was passing on main
. That's because the underlying encoder was able to infer pts
valid values. But it was emitting warnings that were visible in DEBUG mode.
The other tests we have above (assert ... not in captured.err
) make sure those warnings aren't emitted anymore, confirming we are now correctly setting the pts values explicitly.
This PR makes sure we properly set the AVFrames's pts values before sending them to the encoder.
This removes a bunch of warnings that were visible when using
TORCHCODEC_FFMPEG_LOG_LEVEL=DEBUG
. I added tests to make sure these warnings have now disappeared. I also confirmed that the tests fail onmain
without the fixes.