Skip to content

autoclass: Class only found when called in specific places? #2242

Closed
@cathay

Description

@cathay

Versions

  • Python: 3.8
  • OS: Android 9
  • Kivy: 1.11.1
  • OpenJDK: 1.8

Description

I tried to use ffprobe in my helper.py as:

def get_video_length(filename):
    ffprobe = autoclass('com.arthenica.mobileffmpeg.FFprobe')
    config = autoclass('com.arthenica.mobileffmpeg.Config')
    ....

We got the error jnius.jnius.JavaException: Class not found b'com/arthenica/mobileffmpeg/FFprobe'. The fix for it is put
ffprobe = autoclass('com.arthenica.mobileffmpeg.FFprobe') in __init__.py but it seems not straightforward to me. I would like to get some thoughts on it.

get_video_length was called on different thread from main thread

buildozer.spec

android.gradle_dependencies = com.arthenica:mobile-ffmpeg-full:4.3.2

ffmpeg repository: https://github.com/tanersener/mobile-ffmpeg

Command:

buildozer --verbose android debug deploy run

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions