-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fixed audio-video synchronisation problem in read_video() when using pts
as unit
#3791
Fixed audio-video synchronisation problem in read_video() when using pts
as unit
#3791
Conversation
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.
Looks good to me.
I've just put minor style edits.
Also, we should consider adding tests for this case to be able to catch the error in the future
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.
Looks good to me. Can you just clarify the above comment?
config.video_fps, info['video_fps'], delta=0.0001 | ||
) | ||
arr = torch.Tensor(arr) | ||
if arr.shape == visual.shape: |
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.
Why is this necessary?
Wouldn't we expect them to be the same shape?
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.
There are some off by 1, which may be related to the differences in how the closest frame is found in pyav and torchvision(as we had discussed offline).
arr.append(frame.to_ndarray()) | ||
_, audio, _ = io.read_video(full_path, start_pts=start_pts_val, pts_unit='pts') | ||
arr = torch.as_tensor(np.concatenate(arr, axis=1)) | ||
if arr.shape == audio.shape: |
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.
As above
…en using `pts` as unit (#3791) Summary: * Fixed audio-video synchronisation problem in read_video() when using as unit * Addressed review comments * Added unit test Reviewed By: NicolasHug Differential Revision: D29027305 fbshipit-source-id: 0a9dc3c877825af7836e7db313cfd2779542b457
No description provided.