Skip to content

The FOO does not BAR. #1559

@lmaddox

Description

@lmaddox

IMPORTANT: Be sure to replace all template sections {{ like this }} or your issue may be discarded.

Overview

Not sure if this error is with PyAV (i.e., it's fixed in later versions) or with faster-whisper (i.e., they need to update their deps)

Expected behavior

not have ABI errors

Actual behavior

has ABI errors

Traceback:

Traceback (most recent call last):
  File "/home/miller/src/py/iallm/./test.py", line 3, in <module>
    from RealtimeSTT import AudioToTextRecorder
  File "/home/miller/venv/lib/python3.12/site-packages/RealtimeSTT/__init__.py", line 1, in <module>
    from .audio_recorder import AudioToTextRecorder
  File "/home/miller/venv/lib/python3.12/site-packages/RealtimeSTT/audio_recorder.py", line 36, in <module>
    import faster_whisper
  File "/home/miller/venv/lib/python3.12/site-packages/faster_whisper/__init__.py", line 1, in <module>
    from faster_whisper.audio import decode_audio
  File "/home/miller/venv/lib/python3.12/site-packages/faster_whisper/audio.py", line 15, in <module>
    import av
  File "/home/miller/venv/lib/python3.12/site-packages/av/__init__.py", line 17, in <module>
    from av.bitstream import BitStreamFilterContext, bitstream_filters_available
  File "/home/miller/venv/lib/python3.12/site-packages/av/bitstream/__init__.py", line 1, in <module>
    from .context import BitStreamFilterContext
  File "av/bitstream/context.pyx", line 1, in init av.bitstream.context
ValueError: av.frame.Frame size changed, may indicate binary incompatibility. Expected 56 from C header, got 48 from PyObject

Investigation

Looked at the stack trace. It ends in PyAV.

Reproduction

python -m venv .venv
. .venv/bin/activate
pip install RealtimeSTT
cat > PoC.py << 'EOF'
#! /usr/bin/env python

from RealtimeSTT import AudioToTextRecorder

def process_text(text):
    print (text)

if __name__ == '__main__':
    with AudioToTextRecorder(wake_words="jarvis",) as recorder:
        while True:
            recorder.text(process_text)
EOF
chmod +x PoC.py
./PoC.py

Versions

  • OS: {{ e.g. macOS 10.13.6 }}
  • PyAV runtime:

└─$ python -m av --version                     
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/miller/venv/lib/python3.12/site-packages/av/__init__.py", line 17, in <module>
    from av.bitstream import BitStreamFilterContext, bitstream_filters_available
  File "/home/miller/venv/lib/python3.12/site-packages/av/bitstream/__init__.py", line 1, in <module>
    from .context import BitStreamFilterContext
  File "av/bitstream/context.pyx", line 1, in init av.bitstream.context
ValueError: av.frame.Frame size changed, may indicate binary incompatibility. Expected 56 from C header, got 48 from PyObject

  • I am/tried using the binary wheels
    dist/av-12.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • I compiled from source
    also yes, but version > 12 not supported

Research

I have done the following:

Additional context

Probably gonna use a docker image anyway

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions