this post is roughly related to Conflicts and errors - gstreamer requirement for both gtk+3 and gtk4
I only get the following errors if running in a fresh loaded terminal window or having reloaded my environment.
my code compiles clean and the run produces all the output with my debug statements I expect. I compile my program this way:
gcc code-NEW-LF17.c -o gtk4_player_NEW $(pkg-config --cflags --libs gtk4 gstreamer-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0 gstgtk4)
My environment: mac M1 (Apple Silicon) macOS = Sequoia 15.5; gstreamer = 1.26.3; gtk4 = 4.18.6; gtk4paintablesink = 0.14.0-alpha.1-RELEASE (via gst-plugins-rs); gtk+3 = 3.24.43.
Here is the output I get on the FIRST run I do in a new terminal window - can anyone tell me why this is happening?? Output from a second (an any subsequent) run is also below. My video plays as it should.
I can post my code if that will help.
Thanks.
./gtk4_player_NEW ../MW.mp4
Detected Platform: macOS (__APPLE__)
(gst-plugin-scanner:81170): GLib-GIRepository-WARNING **: 15:30:40.256: Failed to load shared library 'libgobject-2.0.0.dylib' referenced by the typelib: dlopen(libgobject-2.0.0.dylib, 0x0009): tried: 'libgobject-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibgobject-2.0.0.dylib' (no such file), '/usr/lib/libgobject-2.0.0.dylib' (no such file, not in dyld cache), 'libgobject-2.0.0.dylib' (no such file)
(gst-plugin-scanner:81170): GLib-GIRepository-WARNING **: 15:30:40.256: Failed to load shared library 'libglib-2.0.0.dylib' referenced by the typelib: dlopen(libglib-2.0.0.dylib, 0x0009): tried: 'libglib-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibglib-2.0.0.dylib' (no such file), '/usr/lib/libglib-2.0.0.dylib' (no such file, not in dyld cache), 'libglib-2.0.0.dylib' (no such file)
** (gst-plugin-scanner:81170): CRITICAL **: 15:30:40.256: can't find gi.repository.Gst
objc[81170]: Class ResultReceiver is implemented in both /opt/homebrew/Cellar/gtk+3/3.24.43/lib/libgtk-3.0.dylib (0x105f91e00) and /opt/homebrew/Cellar/gtk4/4.18.6/lib/libgtk-4.1.dylib (0x1206aab48). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
objc[81170]: Class GtkApplicationQuartzDelegate is implemented in both /opt/homebrew/Cellar/gtk+3/3.24.43/lib/libgtk-3.0.dylib (0x105f91e28) and /opt/homebrew/Cellar/gtk4/4.18.6/lib/libgtk-4.1.dylib (0x1206aab70). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
objc[81170]: Class GNSMenuItem is implemented in both /opt/homebrew/Cellar/gtk+3/3.24.43/lib/libgtk-3.0.dylib (0x105f91e78) and /opt/homebrew/Cellar/gtk4/4.18.6/lib/libgtk-4.1.dylib (0x1206aac10). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
objc[81170]: Class GNSMenu is implemented in both /opt/homebrew/Cellar/gtk+3/3.24.43/lib/libgtk-3.0.dylib (0x105f91ea0) and /opt/homebrew/Cellar/gtk4/4.18.6/lib/libgtk-4.1.dylib (0x1206aac38). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
objc[81170]: Class FilterComboBox is implemented in both /opt/homebrew/Cellar/gtk+3/3.24.43/lib/libgtk-3.0.dylib (0x105f91f18) and /opt/homebrew/Cellar/gtk4/4.18.6/lib/libgtk-4.1.dylib (0x1206aacb0). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
objc[81170]: Class gdkCoreCursor is implemented in both /opt/homebrew/Cellar/gtk+3/3.24.43/lib/libgdk-3.0.dylib (0x104ce1628) and /opt/homebrew/Cellar/gtk4/4.18.6/lib/libgtk-4.1.dylib (0x1206aad00). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 921, in _load_unlocked
File "<frozen importlib._bootstrap>", line 813, in module_from_spec
File "/opt/homebrew/lib/python3.13/site-packages/gi/importer.py", line 146, in create_module
importlib.import_module('gi.repository.' + dep.split("-")[0])
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 921, in _load_unlocked
File "<frozen importlib._bootstrap>", line 813, in module_from_spec
File "/opt/homebrew/lib/python3.13/site-packages/gi/importer.py", line 146, in create_module
importlib.import_module('gi.repository.' + dep.split("-")[0])
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 921, in _load_unlocked
File "<frozen importlib._bootstrap>", line 813, in module_from_spec
File "/opt/homebrew/lib/python3.13/site-packages/gi/importer.py", line 147, in create_module
dynamic_module = load_overrides(introspection_module)
File "/opt/homebrew/lib/python3.13/site-packages/gi/overrides/__init__.py", line 98, in load_overrides
override_mod = importlib.import_module(override_package_name)
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.13/site-packages/gi/overrides/GLib.py", line 37, in <module>
from gi import _option as option
File "/opt/homebrew/lib/python3.13/site-packages/gi/_option.py", line 41, in <module>
OPTION_CONTEXT_ERROR_QUARK = GLib.quark_to_string(GLib.option_error_quark())
~~~~~~~~~~~~~~~~~~~~~~~^^
gi._error.GError: gi-invoke-error-quark: Could not locate g_option_error_quark: dlopen(libglib-2.0.0.dylib, 0x0009): tried: 'libglib-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibglib-2.0.0.dylib' (no such file), '/usr/lib/libglib-2.0.0.dylib' (no such file, not in dyld cache), 'libglib-2.0.0.dylib' (no such file) (1)
Using URI: file:///Users/CT/temp/GSTREAMER/TUTORIALS/JOHN/MW.mp4
Running GtkApplication...
--- activate_app called (Count: 1, player->window: 0x0) ---
activate_app: Creating new window.
Updating UI for GstState: NULL (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
on_video_widget_realize: GtkPicture realized.
activate_app: New window presented.
Setting up GStreamer pipeline and paintable for: file:///Users/CT/temp/GSTREAMER/TUTORIALS/JOHN/MW.mp4
GStreamer elements created successfully.
Setting sink window_width=800, window_height=554 based on GtkPicture current size.
Connected 'invalidate-contents' for paintable 0x600001587da0 (handler ID: 182)
Connected 'invalidate-size' for paintable 0x600001587da0 (handler ID: 183)
Paintable (0x600001587da0) obtained from gtk4paintablesink and set on GtkPicture (0x12cf49e80).
Pipeline and paintable setup complete. Scheduling playback start.
Starting pipeline playback (setting to PLAYING state)...
Pipeline state change to PLAYING is ASYNC.
Bus call: Pipeline state changed from NULL to READY (pending: PLAYING)
Updating UI for GstState: READY (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
uridecodebin-pad-added: New pad uri-decoder:video_0 from uri-decoder
Warning: Could not get caps for new pad 'video_0' immediately.
Linked video pad successfully.
uridecodebin-pad-added: New pad uri-decoder:audio_0 from uri-decoder
Warning: Could not get caps for new pad 'audio_0' immediately.
Linked audio pad successfully.
Bus call: Pipeline state changed from READY to PAUSED (pending: PLAYING)
Updating UI for GstState: PAUSED (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
Bus call: Async operation completed.
Bus call: Pipeline state changed from PAUSED to PLAYING (pending: VOID_PENDING)
Updating UI for GstState: PLAYING (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
Bus call: End-Of-Stream reached.
Seeking to 0:00:00.000000000
Updating UI for GstState: PAUSED (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
Bus call: Pipeline state changed from PLAYING to PAUSED (pending: VOID_PENDING)
Updating UI for GstState: PAUSED (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
Bus call: Pipeline state changed from PAUSED to PAUSED (pending: PAUSED)
Updating UI for GstState: PAUSED (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
Bus call: Pipeline state changed from PAUSED to PAUSED (pending: VOID_PENDING)
Updating UI for GstState: PAUSED (Play button: 0x12cf36cb0, Slider: 0x12cf4b4f0)
Bus call: Async operation completed.
Window close requested (window: 0x12cf48a20).
Cleanup: Starting player resource cleanup (player: 0x6000015945b0, cleanup_done: 0)
Disconnected 'invalidate-contents' for paintable 0x600001587da0 (handler ID: 182)
Disconnected 'invalidate-size' for paintable 0x600001587da0 (handler ID: 183)
Cleanup: Explicitly clearing paintable from GtkPicture.
Cleanup: Player resource cleanup complete.
Window destroy callback triggered (widget: 0x12cf48a20, player->window: 0x12cf48a20).
GtkApplication finished running (status: 0).
Performing final cleanup in main...
Exiting application with status 0.
Here is the output I get from running the same program a second time:
./gtk4_player_NEW ../MW.mp4
Detected Platform: macOS (__APPLE__)
Using URI: file:///Users/CT/temp/GSTREAMER/TUTORIALS/JOHN/MW.mp4
Running GtkApplication...
--- activate_app called (Count: 1, player->window: 0x0) ---
activate_app: Creating new window.
Updating UI for GstState: NULL (Play button: 0x134121360, Slider: 0x134136040)
on_video_widget_realize: GtkPicture realized.
activate_app: New window presented.
Setting up GStreamer pipeline and paintable for: file:///Users/CT/temp/GSTREAMER/TUTORIALS/JOHN/MW.mp4
GStreamer elements created successfully.
Setting sink window_width=800, window_height=554 based on GtkPicture current size.
Connected 'invalidate-contents' for paintable 0x60000218dd20 (handler ID: 182)
Connected 'invalidate-size' for paintable 0x60000218dd20 (handler ID: 183)
Paintable (0x60000218dd20) obtained from gtk4paintablesink and set on GtkPicture (0x134134230).
Pipeline and paintable setup complete. Scheduling playback start.
Starting pipeline playback (setting to PLAYING state)...
Pipeline state change to PLAYING is ASYNC.
Bus call: Pipeline state changed from NULL to READY (pending: PLAYING)
Updating UI for GstState: READY (Play button: 0x134121360, Slider: 0x134136040)
uridecodebin-pad-added: New pad uri-decoder:video_0 from uri-decoder
Warning: Could not get caps for new pad 'video_0' immediately.
Linked video pad successfully.
uridecodebin-pad-added: New pad uri-decoder:audio_0 from uri-decoder
Warning: Could not get caps for new pad 'audio_0' immediately.
Linked audio pad successfully.
Bus call: Pipeline state changed from READY to PAUSED (pending: PLAYING)
Updating UI for GstState: PAUSED (Play button: 0x134121360, Slider: 0x134136040)
Bus call: Async operation completed.
Bus call: Pipeline state changed from PAUSED to PLAYING (pending: VOID_PENDING)
Updating UI for GstState: PLAYING (Play button: 0x134121360, Slider: 0x134136040)
Bus call: End-Of-Stream reached.
Seeking to 0:00:00.000000000
Updating UI for GstState: PAUSED (Play button: 0x134121360, Slider: 0x134136040)
Bus call: Pipeline state changed from PLAYING to PAUSED (pending: VOID_PENDING)
Updating UI for GstState: PAUSED (Play button: 0x134121360, Slider: 0x134136040)
Bus call: Pipeline state changed from PAUSED to PAUSED (pending: PAUSED)
Updating UI for GstState: PAUSED (Play button: 0x134121360, Slider: 0x134136040)
Bus call: Pipeline state changed from PAUSED to PAUSED (pending: VOID_PENDING)
Updating UI for GstState: PAUSED (Play button: 0x134121360, Slider: 0x134136040)
Bus call: Async operation completed.
Window close requested (window: 0x134132b00).
Cleanup: Starting player resource cleanup (player: 0x600002188dd0, cleanup_done: 0)
Disconnected 'invalidate-contents' for paintable 0x60000218dd20 (handler ID: 182)
Disconnected 'invalidate-size' for paintable 0x60000218dd20 (handler ID: 183)
Cleanup: Explicitly clearing paintable from GtkPicture.
Cleanup: Player resource cleanup complete.
Window destroy callback triggered (widget: 0x134132b00, player->window: 0x134132b00).
GtkApplication finished running (status: 0).
Performing final cleanup in main...
Exiting application with status 0.