PyAV-Org / PyAV

Pythonic bindings for FFmpeg's libraries.
https://pyav.basswood-io.com/
BSD 3-Clause "New" or "Revised" License
2.52k stars 365 forks source link

armv7 support? #830

Closed need2buy closed 2 years ago

need2buy commented 2 years ago

pip3 install av Collecting av Using cached av-8.0.3.tar.gz (2.3 MB) Building wheels for collected packages: av Building wheel for av (setup.py) ... error ERROR: Failed building wheel for av Running setup.py clean for av Failed to build av Installing collected packages: av Running setup.py install for av ... error ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rsnp4vuy/av_587588c60a26437db86c6297ae1a8f28/setup.py'"'"'; file='"'"'/tmp/pip-install-rsnp4vuy/av_587588c60a26437db86c6297ae1a8f28/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-m9bimlph/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/av Check the logs for full command output. WARNING: You are using pip version 21.0.1; however, version 21.3.1 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 1 (v7l) BogoMIPS : 1600.00 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x4 CPU part : 0xc09 CPU revision : 1

processor : 1 model name : ARMv7 Processor rev 1 (v7l) BogoMIPS : 1600.00 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32 CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x4 CPU part : 0xc09 CPU revision : 1

Hardware : Marvell Armada 380/385 (Device Tree) Revision : 0000 Serial : 0000000000000000

golyalpha commented 2 years ago

Hey, Do you have more complete logs about the issue? You have a whole block of output that's missing, unfortunately it's the block that's actually important.

I tried installing PyAV on my aarch64 box, and ran into a similar issue (at least the same exit code for the same command), which was solved by installing the headers for libavfilter and libavdevice

need2buy commented 2 years ago

ls /usr/lib/libavfi* /usr/lib/libavfilter.so /usr/lib/libavfilter.so.6 /usr/lib/libavfilter.so.6.107.100 /usr/lib/libavfilter.so.7
Checking the header, I found these installed on my armv7 box. /usr/lib/libavfilter.so.7.57.100

/usr/lib/libavdevice.so /usr/lib/libavdevice.so.57 /usr/lib/libavdevice.so.57.10.100 /usr/lib/libavdevice.so.58 /usr/lib/libavdevice.so.58.8.100

There is no wheel for armv7 so the normal setup install output capture verbose as below

Collecting av Created temporary directory: /tmp/pip-unpack-6bndrc7z Getting credentials from keyring for files.pythonhosted.org Looking up "https://files.pythonhosted.org/packages/40/e6/da37b548e9e1312fb11ffd0f31f8679e1b96d3859790a77e93a113394d34/av-8.0.3.tar.gz" in the cache No cache entry available Starting new HTTPS connection (1): files.pythonhosted.org:443 https://files.pythonhosted.org:443 "GET /packages/40/e6/da37b548e9e1312fb11ffd0f31f8679e1b96d3859790a77e93a113394d34/av-8.0.3.tar.gz HTTP/1.1" 200 2321046 Downloading av-8.0.3.tar.gz (2.3 MB) |████████████████████████████████| 2.3 MB 2.1 MB/s eta 0:00:01 Ignoring unknown cache-control directive: immutable Updating cache with response from "https://files.pythonhosted.org/packages/40/e6/da37b548e9e1312fb11ffd0f31f8679e1b96d3859790a77e93a113394d34/av-8.0.3.tar.gz" Caching due to etag |████████████████████████████████| 2.3 MB 2.1 MB/s Added av from https://files.pythonhosted.org/packages/40/e6/da37b548e9e1312fb11ffd0f31f8679e1b96d3859790a77e93a113394d34/av-8.0.3.tar.gz#sha256=521814309c91d526b6b5c9517018aef2dd12bc3d86351037db69aa67730692b8 to build tracker '/tmp/pip-req-tracker-b_m_rfho' Running setup.py (path:/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py) egg_info for package av Created temporary directory: /tmp/pip-pip-egg-info-g7nebiwp Running command python setup.py egg_info running egg_info creating /tmp/pip-pip-egg-info-g7nebiwp/av.egg-info writing /tmp/pip-pip-egg-info-g7nebiwp/av.egg-info/PKG-INFO writing dependency_links to /tmp/pip-pip-egg-info-g7nebiwp/av.egg-info/dependency_links.txt writing entry points to /tmp/pip-pip-egg-info-g7nebiwp/av.egg-info/entry_points.txt writing top-level names to /tmp/pip-pip-egg-info-g7nebiwp/av.egg-info/top_level.txt writing manifest file '/tmp/pip-pip-egg-info-g7nebiwp/av.egg-info/SOURCES.txt' reading manifest file '/tmp/pip-pip-egg-info-g7nebiwp/av.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE.txt' writing manifest file '/tmp/pip-pip-egg-info-g7nebiwp/av.egg-info/SOURCES.txt' Source in /tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890 has version 8.0.3, which satisfies requirement av from https://files.pythonhosted.org/packages/40/e6/da37b548e9e1312fb11ffd0f31f8679e1b96d3859790a77e93a113394d34/av-8.0.3.tar.gz#sha256=521814309c91d526b6b5c9517018aef2dd12bc3d86351037db69aa67730692b8 Removed av from https://files.pythonhosted.org/packages/40/e6/da37b548e9e1312fb11ffd0f31f8679e1b96d3859790a77e93a113394d34/av-8.0.3.tar.gz#sha256=521814309c91d526b6b5c9517018aef2dd12bc3d86351037db69aa67730692b8 from build tracker '/tmp/pip-req-tracker-b_m_rfho' Created temporary directory: /tmp/pip-unpack-o4tsn1h4 Building wheels for collected packages: av Created temporary directory: /tmp/pip-wheel-j_pfxx4r Building wheel for av (setup.py) ... Destination directory: /tmp/pip-wheel-j_pfxx4r Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"'; file='"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-j_pfxx4r running bdist_wheel running build running build_py creating build creating build/lib.linux-armv7l-3.9 creating build/lib.linux-armv7l-3.9/av copying av/deprecation.py -> build/lib.linux-armv7l-3.9/av copying av/datasets.py -> build/lib.linux-armv7l-3.9/av copying av/main.py -> build/lib.linux-armv7l-3.9/av copying av/init.py -> build/lib.linux-armv7l-3.9/av creating build/lib.linux-armv7l-3.9/av/video copying av/video/init.py -> build/lib.linux-armv7l-3.9/av/video creating build/lib.linux-armv7l-3.9/av/subtitles copying av/subtitles/init.py -> build/lib.linux-armv7l-3.9/av/subtitles creating build/lib.linux-armv7l-3.9/av/sidedata copying av/sidedata/init.py -> build/lib.linux-armv7l-3.9/av/sidedata creating build/lib.linux-armv7l-3.9/av/filter copying av/filter/init.py -> build/lib.linux-armv7l-3.9/av/filter creating build/lib.linux-armv7l-3.9/av/data copying av/data/init.py -> build/lib.linux-armv7l-3.9/av/data creating build/lib.linux-armv7l-3.9/av/container copying av/container/init.py -> build/lib.linux-armv7l-3.9/av/container creating build/lib.linux-armv7l-3.9/av/codec copying av/codec/init.py -> build/lib.linux-armv7l-3.9/av/codec creating build/lib.linux-armv7l-3.9/av/audio copying av/audio/init.py -> build/lib.linux-armv7l-3.9/av/audio running build_ext running config PyAV: 8.0.3 (unknown commit) Python: 3.9.2 (default, Mar 22 2021, 07:09:13) \n[GCC 8.4.0] platform: Linux-4.14.215-armv7l-with-libc extension_extra: include_dirs: [b'include'] libraries: [] library_dirs: [] define_macros: [] runtime_library_dirs: [] config_macros: PYAV_COMMIT_STR="unknown-commit" PYAV_VERSION=8.0.3 PYAV_VERSION_STR="8.0.3" Could not find libavformat with pkg-config. Could not find libavcodec with pkg-config. Could not find libavdevice with pkg-config. Could not find libavutil with pkg-config. Could not find libavfilter with pkg-config. Could not find libswscale with pkg-config. Could not find libswresample with pkg-config. error ERROR: Failed building wheel for av Running setup.py clean for av Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"'; file='"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' clean --all running clean removing 'build/lib.linux-armv7l-3.9' (and everything under it) 'build/bdist.linux-armv7l' does not exist -- can't clean it 'build/scripts-3.9' does not exist -- can't clean it removing 'build' Failed to build av Installing collected packages: av Created temporary directory: /tmp/pip-record-wskxck8o Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"'; file='"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-wskxck8o/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/av running install running build running build_py creating build creating build/lib.linux-armv7l-3.9 creating build/lib.linux-armv7l-3.9/av copying av/deprecation.py -> build/lib.linux-armv7l-3.9/av copying av/datasets.py -> build/lib.linux-armv7l-3.9/av copying av/main.py -> build/lib.linux-armv7l-3.9/av copying av/init.py -> build/lib.linux-armv7l-3.9/av creating build/lib.linux-armv7l-3.9/av/video copying av/video/init.py -> build/lib.linux-armv7l-3.9/av/video creating build/lib.linux-armv7l-3.9/av/subtitles copying av/subtitles/init.py -> build/lib.linux-armv7l-3.9/av/subtitles creating build/lib.linux-armv7l-3.9/av/sidedata copying av/sidedata/init.py -> build/lib.linux-armv7l-3.9/av/sidedata creating build/lib.linux-armv7l-3.9/av/filter copying av/filter/init.py -> build/lib.linux-armv7l-3.9/av/filter creating build/lib.linux-armv7l-3.9/av/data copying av/data/init.py -> build/lib.linux-armv7l-3.9/av/data creating build/lib.linux-armv7l-3.9/av/container copying av/container/init.py -> build/lib.linux-armv7l-3.9/av/container creating build/lib.linux-armv7l-3.9/av/codec copying av/codec/init.py -> build/lib.linux-armv7l-3.9/av/codec creating build/lib.linux-armv7l-3.9/av/audio copying av/audio/init.py -> build/lib.linux-armv7l-3.9/av/audio running build_ext running config PyAV: 8.0.3 (unknown commit) Python: 3.9.2 (default, Mar 22 2021, 07:09:13) \n[GCC 8.4.0] platform: Linux-4.14.215-armv7l-with-libc extension_extra: include_dirs: [b'include'] libraries: [] library_dirs: [] define_macros: [] runtime_library_dirs: [] config_macros: PYAV_COMMIT_STR="unknown-commit" PYAV_VERSION=8.0.3 PYAV_VERSION_STR="8.0.3" Could not find libavformat with pkg-config. Could not find libavcodec with pkg-config. Could not find libavdevice with pkg-config. Could not find libavutil with pkg-config. Could not find libavfilter with pkg-config. Could not find libswscale with pkg-config. Could not find libswresample with pkg-config. Running setup.py install for av ... error ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"'; file='"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-wskxck8o/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/av Check the logs for full command output. Exception information: Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 812, in install success = install_legacy( File "/usr/lib/python3.9/site-packages/pip/_internal/operations/install/legacy.py", line 86, in install raise LegacyInstallFailure pip._internal.operations.install.legacy.LegacyInstallFailure

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 189, in _main status = self.run(options, args) File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper return func(self, options, args) File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 391, in run installed = install_given_reqs( File "/usr/lib/python3.9/site-packages/pip/_internal/req/init.py", line 80, in install_given_reqs requirement.install( File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 830, in install six.reraise(*exc.parent) File "/usr/lib/python3.9/site-packages/pip/_vendor/six.py", line 703, in reraise raise value File "/usr/lib/python3.9/site-packages/pip/_internal/operations/install/legacy.py", line 74, in install runner( File "/usr/lib/python3.9/site-packages/pip/_internal/utils/subprocess.py", line 289, in runner call_subprocess( File "/usr/lib/python3.9/site-packages/pip/_internal/utils/subprocess.py", line 258, in call_subprocess raise InstallationSubprocessError(proc.returncode, command_desc) pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"'; file='"'"'/tmp/pip-install-7o5odd9d/av_874c22909a464b08ad3ece6375ea2890/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-wskxck8o/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.9/av Check the logs for full command output. WARNING: You are using pip version 21.0.1; however, version 21.3.1 is available. You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command. Removed build tracker: '/tmp/pip-req-tracker-b_m_rfho'

golyalpha commented 2 years ago

This is the important bit:

Could not find libavformat with pkg-config.
Could not find libavcodec with pkg-config.
Could not find libavdevice with pkg-config.
Could not find libavutil with pkg-config.
Could not find libavfilter with pkg-config.
Could not find libswscale with pkg-config.
Could not find libswresample with pkg-config.

You need to install the development headers for these libraries. The SOs are not enough.

If you're on debian-based linux, you should be able to do something like:

apt install libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libavfilter-dev libswscale-dev libswresample-dev
need2buy commented 2 years ago

Awesome,

Thans for posting this out.

Cheer.

jlaine commented 2 years ago

Duplicate of #708