Skip to content
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

Unrecognized option 'qp' #30

Closed
JunyaoHu opened this issue Mar 18, 2023 · 2 comments
Closed

Unrecognized option 'qp' #30

JunyaoHu opened this issue Mar 18, 2023 · 2 comments

Comments

@JunyaoHu
Copy link

JunyaoHu commented Mar 18, 2023

I run the offifial example code but go wrong.

from mediapy import *
video = moving_circle((100, 100), num_images=10)
show_video(video, fps=10)

I am not sure it is relative to torchvision or ffmpeg

when i dont conda install torchvision, the code can run well. but after i conda install torchvision (and ffmpeg also installed automatedly), mediapy can not run well, so how to solve the problem?

torchvision and ffmpeg version are as follows:
image

BrokenPipeError                           Traceback (most recent call last)
File [~/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py:1663](https://vscode-remote+ssh-002dremote-002b7b22686f73744e616d65223a224e4b552d43562d4c41422d5562756e74753132227d.vscode-resource.vscode-cdn.net//~/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py:1663), in write_video(path, images, **kwargs)
   [1662](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1661) for image in images:
-> [1663](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1662)   writer.add_image(image)

File [~/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py:1572](https://vscode-remote+ssh-002dremote-002b7b22686f73744e616d65223a224e4b552d43562d4c41422d5562756e74753132227d.vscode-resource.vscode-cdn.net//~/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py:1572), in VideoWriter.add_image(self, image)
   [1571](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1570) assert self._proc.stdin
-> [1572](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1571) if self._proc.stdin.write(data) != len(data):
   [1573](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1572)   self._proc.wait()

BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
Cell In[13], line 2
      1 video = moving_circle((100, 100), num_images=10)
----> 2 show_video(video, fps=10)

File [~/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py:1772](https://vscode-remote+ssh-002dremote-002b7b22686f73744e616d65223a224e4b552d43562d4c41422d5562756e74753132227d.vscode-resource.vscode-cdn.net//~/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py:1772), in show_video(images, title, **kwargs)
   [1749](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1748) def show_video(
   [1750](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1749)     images: Iterable[_NDArray], *, title: str | None = None, **kwargs: Any
   [1751](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1750) ) -> str | None:
   [1752](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1751)   """Displays a video in the IPython notebook and optionally saves it to a file.
...
   [1587](file:///home/ubuntu/anaconda3/envs/MSPred/lib/python3.9/site-packages/mediapy/__init__.py?line=1586) self._popen = None

RuntimeError: Error writing '/tmp/tmpugt6gx5m/file.mp4': Unrecognized option 'qp'.
Error splitting the argument list: Option not found

and i tried

ffmpeg pkgs/main/linux-64::ffmpeg-4.2.2-h20bf706_0 runs well

but ffmpeg pytorch/linux-64::ffmpeg-4.3-hf484d3e_0 cannot run well

@hhoppe
Copy link
Collaborator

hhoppe commented Mar 18, 2023

This looks related: KuntaiDu/dds#1
The option -qp has been available for years in ffmpeg if the libx264 codec is available.
My guess is that the pytorch/...ffmpeg is a custom build that disables the H.264 codec.
You can try show_video(video, fps=10, codec='gif') which uses the GIF codec instead.

@JunyaoHu
Copy link
Author

thanks!

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

No branches or pull requests

2 participants