VideoPlayerFFMPEG.fromDevice() immediately hangs

I am trying to get video from my laptop camera. I followed the instructions: cloned the Github template repo and wrote sample code for accessing video. However, when the app launches, it instantly stops responding.

Using debug, I managed to locate the line which causes the trouble: in file VideoPlayerFFMPEG.kt, line 258: avdevice_register_all(). As far as I get it, this is a native function from a standalone library. From here I’m completely lost as to how to investigate the problem further. My CLI ffmpeg tool works properly. Can anyone help?

Hi @dl33 ! Welcome to the forum :slight_smile:

Something has been fixed in recent (unreleased) versions of OPENRNDR to match changes in ffmpeg.

Are you on Linux by any chance? Does the commented out code in openrndr/DemoVideoCamera01.kt at master · openrndr/openrndr · GitHub help?

If you want to build openrndr and orx from source (interesting mostly to contribute or to get new features early) you can run the three lines at Building OPENRNDR · openrndr/openrndr Wiki · GitHub and then do the same for orx.

Let us know how it goes :slight_smile:

ps. forgot to say that if you build openrndr and orx you need to set ‘use snapshot’ to true in the template so your local versions are used instead.

Thanks for helping! Building the snapshot version solved the issue! :tada:

I use Windows, commented code didn’t help. Snapshot version works either way.

Also, in the building guide, one line should be changed to have quotes:

./gradlew publishToMavenLocal -P"release.version=0.5.1-SNAPSHOT"

Otherwise Gradle parses “release” as flag and “.version=…” as a task and fails with a task-not-found exception.

1 Like

Happy to hear! And thanks for the tip. Fixed!