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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

"RuntimeError: Not compiled with video_reader support" raises when I use the new fine-grained VideoReader API #2934

Closed
caddyless opened this issue Oct 29, 2020 · 6 comments

Comments

@caddyless
Copy link

caddyless commented Oct 29, 2020

馃悰 Bug

I wanna compare the performance of the new fine-grained video read API in pytorch 1.7 to that in opencv, thus I do a experiment.
When I wanna to read a MP4 format video with the new VideoReader API in the torchvision.io.video, a "RuntimeError: Not compiled with video_reader support" raised. Referring to the source code, I found it's caused by the _HAS_VIDEO_OPT variable is False. More precisely, it is caused by the source code in file vision/torchvision/io/_video_opt.py line 15-24 (as follow). The function "extfilder.find_spec('video_reader')" return None lead to that Error. I wanna know why and how to avoid it. Thanks lots!
image
By the way, the old video read API read_video() works well.

To Reproduce

Steps to reproduce the behavior:

1.call the class VideoReader and pass in file path of a video in MP4 format.

The source code:
image
The error message:
image

Expected behavior

The class return a video reading handler object without any error.

Environment

Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch Version (e.g., 1.0): 1.7
  • OS (e.g., Linux): Ubuntu 16.04
  • How you installed PyTorch (conda, pip, source): conda
  • Build command you used (if compiling from source):
  • Python version: 3.8
  • CUDA/cuDNN version: 11.0
  • GPU models and configuration: 2080Ti
  • Any other relevant information:

Additional context

cc @bjuncek

@albanD albanD transferred this issue from pytorch/pytorch Oct 29, 2020
@vfdev-5
Copy link
Collaborator

vfdev-5 commented Oct 29, 2020

@caddyless VideoReader API is still in beta and we suggest :

In order to use the Video Reader API, you need to compile torchvision from source and make sure that you have ffmpeg installed in your system.

Please, see the release note : https://github.com/pytorch/vision/releases/tag/v0.8.0

@fmassa
Copy link
Member

fmassa commented Oct 30, 2020

Hi,

The current behavior is expected, and you need to compile torchvision from source in order to have the new VideoReader API.

In future releases of torchvision we will have it be package by default with the torchvision binaries so that using it will be easier.

As this is the expected behavior for now, I'm closing this issue but let us know if you have further questions

@Queuecumber
Copy link

Is the API still in beta? I dont see it marked as such on the documentation but I still get this error on torchvision 0.10.0

@fmassa
Copy link
Member

fmassa commented Aug 13, 2021

@Queuecumber yes, we still have some things we need to fix before we can make it to stable

@nicobrb
Copy link

nicobrb commented Nov 6, 2022

Is there a tutorial on how to compile from source? I'm using Windows, I can't find anything online.

@rathodparmeshwar
Copy link

Even building it with source produce same error.

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

No branches or pull requests

6 participants