Skip to content

Audio missing when using read_video() with video_reader backend #3890

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

Closed
prabhat00155 opened this issue May 21, 2021 · 0 comments · Fixed by #3934
Closed

Audio missing when using read_video() with video_reader backend #3890

prabhat00155 opened this issue May 21, 2021 · 0 comments · Fixed by #3934
Assignees

Comments

@prabhat00155
Copy link
Contributor

prabhat00155 commented May 21, 2021

  • Read entire video
video_path = "data/WUzgd7C1pWA.mp4"
set_video_backend('video_reader')
print(f'set backend: {get_video_backend()}')

visual, audio, info = read_video(video_path, pts_unit='pts')
print('Visual:', visual.shape, 'Audio:', audio.shape, info)

visual, audio, info = read_video(video_path, pts_unit='sec')
print('Visual:', visual.shape, 'Audio:', audio.shape, info)
---
Visual: torch.Size([327, 256, 340, 3]) Audio: torch.Size([0, 1]) {'video_fps': 29.970029830932617, 'audio_fps': 48000.0}
Visual: torch.Size([327, 256, 340, 3]) Audio: torch.Size([0, 1]) {'video_fps': 29.970029830932617, 'audio_fps': 48000.0}
  • Read video from start_pts
video_path = "data/WUzgd7C1pWA.mp4"
set_video_backend('video_reader')
print(f'set backend: {get_video_backend()}')

visual, audio, info = read_video(video_path, start_pts=1001, pts_unit='pts')
print('Visual:', visual.shape, 'Audio:', audio.shape, info)

visual, audio, info = read_video(video_path, start_pts=0.0333667, pts_unit='sec')
print('Visual:', visual.shape, 'Audio:', audio.shape, info)
---
set backend: video_reader
Visual: torch.Size([326, 256, 340, 3]) Audio: torch.Size([0, 1]) {'video_fps': 29.970029830932617, 'audio_fps': 48000.0}
Visual: torch.Size([326, 256, 340, 3]) Audio: torch.Size([0, 1]) {'video_fps': 29.970029830932617, 'audio_fps': 48000.0}
  • Read video from start_pts to end_pts
video_path = "data//WUzgd7C1pWA.mp4"
set_video_backend('video_reader')
print(f'set backend: {get_video_backend()}')

visual, audio, info = read_video(video_path, start_pts=1001, end_pts=2002, pts_unit='pts')
print('Visual:', visual.shape, 'Audio:', audio.shape, info)

visual, audio, info = read_video(video_path, start_pts=0.0333667, end_pts=0.1001000, pts_unit='sec')
print('Visual:', visual.shape, 'Audio:', audio.shape, info)
---
set backend: video_reader
Visual: torch.Size([2, 256, 340, 3]) Audio: torch.Size([0, 1]) {'video_fps': 29.970029830932617, 'audio_fps': 48000.0}
Visual: torch.Size([3, 256, 340, 3]) Audio: torch.Size([3072, 1]) {'video_fps': 29.970029830932617, 'audio_fps': 48000.0}

cc @bjuncek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant