google / mediapy

This Python library makes it easy to display images and videos in a notebook.
https://pypi.org/project/mediapy/
Apache License 2.0
389 stars 18 forks source link

video show no content #27

Closed utixx closed 1 year ago

utixx commented 1 year ago

simple code, but output video shows no content.

image

checked that variant video has value and have installed ffmpeg and set it in the system path.

hhoppe commented 1 year ago

Unfortunately I cannot reproduce the problem.

Does it work when ran in Colab, e.g., https://colab.research.google.com/github/google/mediapy/blob/main/mediapy_examples.ipynb ?

Please try !pip show mediapy to see the version number, and similarly !ffmpeg -version.

Also, try generating the video at size (200, 200) and pressing the play/pause button in the video window.

utixx commented 1 year ago

Unfortunately I cannot reproduce the problem.

Does it work when ran in Colab, e.g., https://colab.research.google.com/github/google/mediapy/blob/main/mediapy_examples.ipynb ?

Please try !pip show mediapy to see the version number, and similarly !ffmpeg -version.

Also, try generating the video at size (200, 200) and pressing the play/pause button in the video window.


It works well in Colab and Chrome.

But the problem still exists in PyCharm.

hhoppe commented 1 year ago

I have not used PyCharm. Access to Jupyter notebook requires PyCharm Pro? It could be that the display of videos as implemented by mediapy does not function under PyCharm.

You could also try:

media.show_video(video, fps=10, codec='gif')

This uses an <img> rather than <video> HTML element.

utixx commented 1 year ago

‘gif’ works.

btw, why can't mediapy display video when using the plugin Jupyter notebook in PyCharm Pro?

hhoppe commented 1 year ago

Probably PyCharm does not support the display of HTML