-
Notifications
You must be signed in to change notification settings - Fork 7k
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
torchvision 0.15.2 + ffmpeg 6.0 build error: ‘AV_CODEC_CAP_INTRA_ONLY’ was not declared #7998
Comments
Unfortunately, we are currently stuck on vision/.github/scripts/setup-env.sh Line 44 in 1a9ff0d
|
@pmeier I faced the same error above when I had installed ffmpeg 6.0.0. I followed this and tried out compiling master with 4.2.9 but then I hit :
which tells to install version 6.0.0 via conda. Docs here as well say the same. UPDATE : Was able to get past this by copying the bsf.h file from the git repository of FFMPEG to |
Might I ask a silly question? Is it really necessary to compile torchvision with ffmpeg? I need the 0.15.1 version to work with torch 2.0.0+nv23.05, and I need the ffmpeg + nvdec which are used to decode video with hardware. |
ffmpeg has this more than 3 years old changelog entry:
ffmpeg 6.0 removed those symbols. |
Here's the patch to make torchvision 0.16.0 build with ffmpeg 6.0:
|
🐛 Describe the bug
The build error is if it's compiled with ffmpeg 6:
...
vision-0.15.2/torchvision/csrc/io/decoder/stream.cpp:68:42: error: ‘AV_CODEC_CAP_INTRA_ONLY’ was not declared in this scope; did you mean ‘AV_CODEC_PROP_INTRA_ONLY’
...
The source of the problem is renamed macro AV_CODEC_CAP_INTRA_ONLY. The following trivial patch resolve the issue:
--- a/torchvision/csrc/io/decoder/stream.cpp 2023-09-28 11:34:50.636149910 +1000
+++ b/torchvision/csrc/io/decoder/stream.cpp 2023-09-28 11:32:02.002280926 +1000
@@ -65,7 +65,7 @@
// otherwise set sensible defaults
// with the special case for the different MPEG4 codecs
// that don't have threading context functions
codecCtx_->thread_type = FF_THREAD_FRAME;
codecCtx_->thread_count = 2;
} else {
Versions
Used python 3.10, pytorch-2.0.1, caffe2-2.0.1
I don't use pip on the host, so:
python collect_env.py
Collecting environment information...
Traceback (most recent call last):
File "/home/avz/collect_env.py", line 611, in
main()
File "/home/avz/collect_env.py", line 594, in main
output = get_pretty_env_info()
File "/home/avz/collect_env.py", line 589, in get_pretty_env_info
return pretty_str(get_env_info())
File "/home/avz/collect_env.py", line 427, in get_env_info
pip_version, pip_list_output = get_pip_packages(run_lambda)
File "/home/avz/collect_env.py", line 399, in get_pip_packages
out = run_with_pip([sys.executable, '-mpip'])
File "/home/avz/collect_env.py", line 384, in run_with_pip
for line in out.splitlines()
AttributeError: 'NoneType' object has no attribute 'splitlines'
The text was updated successfully, but these errors were encountered: