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

[Bug]: video-decode could not be successful in python 3.6 for failure to install av #1615

Closed
1 task done
binbinlv opened this issue Jul 22, 2022 · 9 comments
Closed
1 task done
Assignees
Labels
kind/bug Issues or changes related a bug stale
Milestone

Comments

@binbinlv
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

>>> import towhee
>>>
>>>
>>> (
...     towhee.glob('/Users/binbin/Towhee_projects/archery.mp4')
...           .video_decode.ffmpeg()
...           .action_classification.actionclip(model_name='clip_vit_b16')
...           .show()
... )
Collecting av
  Using cached av-9.2.0.tar.gz (2.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: av
  Building wheel for av (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/binbin/towhee-test-env-3.6-0.7.3/bin/python3 /Users/binbin/towhee-test-env-3.6-0.7.3/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/bs/z2281z812w13j5bmwc7jhhmm0000gn/T/tmpa5e41ttc
       cwd: /private/var/folders/bs/z2281z812w13j5bmwc7jhhmm0000gn/T/pip-install-s83cwphb/av_bf6b963e88d842d89b974bbf679ec5cb
  Complete output (122 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.6
  creating build/lib.macosx-10.9-x86_64-3.6/av
  copying av/deprecation.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/datasets.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/about.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/__main__.py -> build/lib.macosx-10.9-x86_64-3.6/av
  creating build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/video
  creating build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/codec/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  creating build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/container
  creating build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  creating build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  creating build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  creating build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/sidedata/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  creating build/lib.macosx-10.9-x86_64-3.6/av/data
  copying av/data/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/data
  copying av/utils.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/frame.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/descriptor.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/logging.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/format.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/error.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/buffer.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/packet.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/bytesource.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/enum.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/option.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/dictionary.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/plane.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/video/frame.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/reformatter.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/format.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/codeccontext.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/plane.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/codec/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/codec/context.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/codec/codec.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/container/input.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/core.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/pyio.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/output.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/streams.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/audio/frame.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/fifo.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/format.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/layout.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/codeccontext.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/resampler.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/plane.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/subtitles/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/codeccontext.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/subtitle.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/filter/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/graph.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/context.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/filter.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/pad.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/link.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/sidedata/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/sidedata/motionvectors.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/sidedata/sidedata.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/data/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/data
  copying av/data/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/data
  running build_ext
  building 'av.plane' extension
  creating build/temp.macosx-10.9-x86_64-3.6
  creating build/temp.macosx-10.9-x86_64-3.6/src
  creating build/temp.macosx-10.9-x86_64-3.6/src/av
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I/usr/local/Cellar/ffmpeg/5.0.1_3/include -I/Users/binbin/towhee-test-env-3.6-0.7.3/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/av/plane.c -o build/temp.macosx-10.9-x86_64-3.6/src/av/plane.o
  gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/src/av/plane.o -L/usr/local/Cellar/ffmpeg/5.0.1_3/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.macosx-10.9-x86_64-3.6/av/plane.cpython-36m-darwin.so
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavformat.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavcodec.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavdevice.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavutil.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswscale.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavfilter.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswresample.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  building 'av.dictionary' extension
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I/usr/local/Cellar/ffmpeg/5.0.1_3/include -I/Users/binbin/towhee-test-env-3.6-0.7.3/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/av/dictionary.c -o build/temp.macosx-10.9-x86_64-3.6/src/av/dictionary.o
  gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/src/av/dictionary.o -L/usr/local/Cellar/ffmpeg/5.0.1_3/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.macosx-10.9-x86_64-3.6/av/dictionary.cpython-36m-darwin.so
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavformat.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavcodec.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavutil.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavdevice.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavfilter.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswresample.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswscale.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  building 'av.stream' extension
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I/usr/local/Cellar/ffmpeg/5.0.1_3/include -I/Users/binbin/towhee-test-env-3.6-0.7.3/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/av/stream.c -o build/temp.macosx-10.9-x86_64-3.6/src/av/stream.o
  src/av/stream.c:2305:29: error: no member named 'codec' in 'struct AVStream'
    switch (__pyx_v_c_stream->codec->codec_type) {
            ~~~~~~~~~~~~~~~~  ^
  src/av/stream.c:2923:31: error: no member named 'codec' in 'struct AVStream'
    __pyx_t_1 = __pyx_v_stream->codec;
                ~~~~~~~~~~~~~~  ^
  src/av/stream.c:3043:15: warning: assigning to 'struct AVCodec *' from 'const struct AVCodec *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_t_6 = __pyx_v_self->_codec_context->codec;
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/stream.c:3828:132: error: no member named 'codec' in 'struct AVStream'
    __pyx_t_7 = __pyx_f_2av_5error_err_check(avcodec_parameters_from_context(__pyx_v_self->_stream->codecpar, __pyx_v_self->_stream->codec), 0, NULL); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 150, __pyx_L1_error)
                                                                                                              ~~~~~~~~~~~~~~~~~~~~~  ^
  1 warning and 3 errors generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for av
Failed to build av
ERROR: Could not build wheels for av, which is required to install pyproject.toml-based projects

Expected Behavior

No error

Steps To Reproduce

Running the following code in python3.6 env:

import towhee

(
    towhee.glob('./archery.mp4') 
          .video_decode.ffmpeg()
          .action_classification.actionclip(model_name='clip_vit_b16')
          .show()
)

Environment

- Towhee version(e.g. v0.1.3 or 8b23a93): towhee 0.7.3 candidate
- OS(Ubuntu or CentOS):
- CPU/Memory:
- GPU:
- Others:

Anything else?

No response

@binbinlv binbinlv added the kind/bug Issues or changes related a bug label Jul 22, 2022
@binbinlv binbinlv added this to the 0.7.3 milestone Jul 22, 2022
@binbinlv binbinlv changed the title [Bug]: video-decode could not be successfully in python 3.6 for failure to install av [Bug]: video-decode could not be successful in python 3.6 for failure to install av Jul 22, 2022
@binbinlv binbinlv added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jul 22, 2022
@filip-halt
Copy link
Contributor

I believe this is the PyAv issue: PyAV-Org/PyAV#817

@binbinlv
Copy link
Contributor Author

@filip-halt so this issue should be left as known issue until the fix of PyAV-Org/PyAV#817?

@junjiejiangjjj

@filip-halt
Copy link
Contributor

@filip-halt so this issue should be left as known issue until the fix of PyAV-Org/PyAV#817?

@junjiejiangjjj

I believe so, but I think @junjiejiangjjj is the better person to ask.

@binbinlv
Copy link
Contributor Author

@junjiejiangjjj

So this issue should be left as known issue until the fix of PyAV-Org/PyAV#817?

@junjiejiangjjj
Copy link
Contributor

junjiejiangjjj commented Jul 26, 2022

Both video-decode.ffmpeg and audio-decode.ffmpeg use pyav. For it doesn't have a whl package for python3.6, if you want to use it in python3.6, you'd better install it by yourself (https://github.com/PyAV-Org/PyAV#installation)

@binbinlv
Copy link
Contributor Author

Set this issue as known issue for the issue of pyav.

@binbinlv binbinlv removed the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jul 27, 2022
@binbinlv binbinlv modified the milestones: 0.7.3, 1.0-Backlog Jul 27, 2022
@yfq512
Copy link

yfq512 commented Aug 3, 2022

@junjiejiangjjj
like this code

towhee.dc(['./1.mp4']) \
        .video_decode.ffmpeg(sample_type='uniform_temporal_subsample', args={'num_samples': 12}) \
        .runas_op(func=lambda x: [y for y in x]) \
        .video_text_embedding.clip4clip(model_name='clip_vit_b32', modality='video', device='cpu') \
        .show()

how can assign a video_text_embedding([0.31566384, -0.07464158, -0.023179442, ...] shape=(480,)
) to a variable

@junjiejiangjjj
Copy link
Contributor

@junjiejiangjjj like this code

towhee.dc(['./1.mp4']) \
        .video_decode.ffmpeg(sample_type='uniform_temporal_subsample', args={'num_samples': 12}) \
        .runas_op(func=lambda x: [y for y in x]) \
        .video_text_embedding.clip4clip(model_name='clip_vit_b32', modality='video', device='cpu') \
        .show()

how can assign a video_text_embedding([0.31566384, -0.07464158, -0.023179442, ...] shape=(480,) ) to a variable

@reiase

@stale
Copy link

stale bot commented Sep 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Close the stale issues and pull requests after 7 days of inactivity. Reopen the issue with /reopen.

@stale stale bot added the stale label Sep 2, 2022
@stale stale bot closed this as completed Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug stale
Projects
None yet
Development

No branches or pull requests

4 participants