Skip to content

Capture examples crash on Apple Silicon #206

Closed

Description

@codeanticode

The getting started capture example on a M1 macbook crash:

Processing video library using bundled GStreamer 1.20.3
Scanning GStreamer plugins... Done.

(Processing core video:79461): GStreamer-CRITICAL **: 16:18:26.996: gst_bin_add_many: assertion 'GST_IS_ELEMENT (element_1)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x000000015c21a944, pid=79461, tid=60435
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.4+8 (17.0.4+8) (build 17.0.4+8)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.4+8 (17.0.4+8, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C  [libgstreamer-1.0.0.dylib+0x9e944]  gst_element_link_pads_full+0x74
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /var/folders/dl/6khbyrbx22vfbf2s_yjt1zx80000gs/T//hs_err_pid79461.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Could not run the sketch (Target VM failed to initialize).
For more information, read Help → Troubleshooting.

but the capture pipeline works fine:

cam = new Capture(this, 640, 480, "pipeline:avfvideosrc device-index=0 ! video/x-raw, width=640, height=480, framerate=30/1");

Activity

  1. changed the title [-]Capture examples on Apple Silicon crash[/-] [+]Capture examples crash on Apple Silicon[/+] on Sep 4, 2022
  2. jaegonlee commented on Sep 5, 2022

    @jaegonlee

    I changed these two lines(in initDevicePipeline(), Capture.java)

        pipeline.addMany(srcElement, videoscale, videoconvert, capsfilter, rgbSink);
        Element.linkMany(srcElement, videoscale, videoconvert, capsfilter, rgbSink);
    

    to

        pipeline.add(srcElement);
        pipeline.add(videoscale);
        pipeline.add(videoconvert);
        pipeline.add(capsfilter);
        pipeline.add(rgbSink);
    
        srcElement.link(videoscale);
        videoscale.link(videoconvert);
        videoconvert.link(capsfilter);
        capsfilter.link(rgbSink);
    

    and it works.

  3. codeanticode commented on Sep 5, 2022

    @codeanticode
    ContributorAuthor

    @jaegonlee Great catch, thanks a lot! Out curiosity, what make you think of splitting addMany/linkMany into separate calls? I had a suspicion that the error was somewhere in there, and tried changing the order of the elements (like placing the caps filter at the beginning, since that's what the custom pipeline does) but did not get it to work.

  4. added this to the Version 2.2.2 milestone on Sep 5, 2022
  5. added a commit that references this issue on Feb 22, 2026
    c2f894f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions