Closed dvschultz closed 3 years ago
Could you please share the input video and the mediapy call(s) so that we can investigate? Thanks.
Please try including fps=24
in the media.show_video()
call.
(The issue is that the video
retrieved using read_video()
is a simple numpy
array without the framerate information.)
Programmatically, one can use:
with media.VideoReader('https://github.com/hhoppe/data/raw/main/video.mp4') as reader:
fps = reader.fps
video = np.array(tuple(reader))
media.show_video(video, fps=fps)
or
with media.VideoReader('https://github.com/hhoppe/data/raw/main/video.mp4') as reader:
media.show_video(reader, fps=reader.fps)
This should be fixed in https://github.com/google/mediapy/commit/21d54f34fdaea1724be2098c396a8c4fefab308b
Now the framerate should carry through even in the simple case below:
import mediapy as media
url = 'https://github.com/hhoppe/data/raw/main/video.mp4'
media.show_video(media.read_video(url))
A video that is 50seconds @ 24fps appears to be 20s @ 60fps in mediapy