ofxGstreamer on M1 Mac

Ah yes - I get the crash with the mouse too. I think it is because the example is setting the speed with mouseMovement. Nice that it the same on mac and linux :slight_smile:

Btw- I think this approach might be a lot more stable for you, but my goal is to get the callback based system working again

Thanks!
Theo

Yes - consistency is good. Even if it’s a consistent crash :wink:
I’ll be following your progress closely. Please let me now if there is anything I can do to help - I have several versions of Fedora on NVIDIA & Iris XE-based hardware available for testing!
Thanks for digging into this issue!

Video playback now works on my Debian 11 Testing machine with Intel graphics. I also get a Seg fault when moving the mouse over the window.

Thanks a lot @theo for all your work on solving this!

I have GStreamer 1.20.3.

@theo thanks for pulling together a fix! Mixed results with gstreamer 1.21.0 & M1 Mac:

ofGstVideoGrabber fix works! Video plays through and no crash on exit with the bare bones example we were originally testing.

ofGstUtils fix still crashes for me with the same errors we were originally facing even with the new callback location. Enabling bFrameByFrame still does the trick for now but callbacks are still going to need something.

Hoping to dig in a bit more over the weekend to see if I can get a little deeper into the issue.

1 Like

These issues seem relevant on their issue tracker.
Says it was merged in for 1.20.3 but I wonder if there is another similar bug that wasn’t caugh which our usage is exposing:

The crash I am getting now seems directly related to the flushing command when doing setSpeed / setPositon etc

Hi all,

thanks for the effor. I wonder whether I am doing something wrong or missing a modification in the ofGstUtils. I get the following with the simplified video Player example with the change proposed by @theo:

[warning] ofGstVideoUtils: update(): ofGstVideoUtils not loaded

no video is shown.

by the way I am in fedora 35 and Gstreamer 1.20.0.

thanks

Posting this update here too.
This PR / Fix works for me on Ubuntu 22 and macOS with GStreamer 1.20.3

More notes here.

2 Likes

Hey way to go Theo! That is a pretty involved patch. I do wonder if this bug is on the gstreamer side. Thanks for working so hard on this. I’m sure it required a lot of effort.

Yeah, great work @theo! Works successfully on my Debian 11 Testing machine with 1.20.3.

Thank you!

Thanks @StaffanMelin! Great to get that confirmation.
:partying_face:

1 Like

@pemb could you try this PR and see if it fixes it for you?

Maybe take the nightly builds from the bottom of the downloads page:
https://openframeworks.cc/download/

And then copy the ofGstUtils.cpp from:

We have another Fedora user who says it doesn’t work for them, but confirmed fixed on Ubuntu and Debian. So curious if it works on your setup.

Thanks!
Theo

Hi, I have copy the ofGStUtils.cpp and the ofGstVideo.cpp with the modification to my OF installation but, at least for me, it did not work in Fedora 35 Gstreamer 1.20. I am just wondering whether I am doing it right, but I get the same error as I pointed previously. I will try later on to download the nightly builds and compile it.

Thanks @pemb!
If you try the nightly build - I think all you will need to do is replace ofGstUtils.cpp from that Pull Request.

It might be also good to trash the contents of openFrameworks/libs/openFrameworksCompiled/lib/linux64/

Just to make sure it is compiling OF with the new changes.

Also might be good to check that you have run:
scripts/linux/fedora/install_codecs.sh which installs the gstreamer plugins.

And maybe also:

dnf upgrade gstreamer1-devel gstreamer1-plugins-base-devel

tagging @edovino here too :slight_smile:

Thanks!
Theo

It did not work compiling the nightly with the files replaced.

These are the lines that seems to have some info about the error:

0:00:00.226417912 247542      0x1574360 INFO                 default gstvaapipluginutil.c:366:gst_vaapi_find_gl_context:<vaapipostproc0> No valid GL display found  


0:00:00.248138036 247542      0x1574360 WARN                 qtdemux qtdemux.c:6747:gst_qtdemux_loop:<qtdemux0> error: streaming stopped, reason not-negotiated (-4)      
0:00:00.248163562 247542      0x1574360 INFO        GST_ERROR_SYSTEM gstelement.c:2271:gst_element_message_full_with_details:<qtdemux0> posting message: Internal data str
eam error.                                                                                                                                                                
[ error ] ofGstUtils: startPipeline(): unable to pause pipeline after 5s                                                                                                  
[warning] ofGstVideoUtils: update(): ofGstVideoUtils not loaded                                                                                                           
0:00:00.248224013 247542      0x1574360 INFO        GST_ERROR_SYSTEM gstelement.c:2298:gst_element_message_full_with_details:<qtdemux0> posted error message: Internal dat
a stream error.

and then the following:

[warning] ofGstVideoUtils: update(): ofGstVideoUtils not loaded  

@theo f you wish I can send you the whole in a text file. I will try again in a different computer with nVidia. Thanks a lot.

Thanks @pemb - that is really helpful!!

A search led me to this issue:

Which seems resolved in GStreamer 1.20.2 or 1.20.3
@edovino it also mentions that playbin3 fixes the issue. So could be related.

A temp fix mentioned in this issue would be to call this at the top of ofApp::setup(){

eg:

ofApp::setup(){

setenv("GST_PLUGIN_FEATURE_RANK", "vah264dec:MAX", 1);

//rest of your setup code 

The real fix might be to upgrade to GSstreamer 1.20.3 if possible?

Thanks!
Theo

no difference with

setenv("GST_PLUGIN_FEATURE_RANK", "vah264dec:MAX", 1);

regarding playbin3, I remember one of the first changes in ofVideoPlayer.cpp was that, however I cannot see it now. Could I do the following:

#if GST_VERSION_MAJOR==0
		GstElement * gstPipeline = gst_element_factory_make("playbin2","player");
	#else
		GstElement * gstPipeline = gst_element_factory_make("playbin3","player");
	#endif

as it was mentioned before.? do I need to compile again OF?

It seems that fedora 36 has gstreamer 1.20.3, I will attempt to upgrade later on so I can confirm that is a gstreamer problem

:partying_face: Changing to playbin3 in ofGstVideoPlayer.cpp it does the work in fedora 35 with gstreamer 1.20.0. after compiling again the nightly OF and bining the openFrameworks/libs/openFrameworksCompiled/lib/linux64/ thanks @theo

I confirm also that both, the Video Grabber example (yet I had not tested it before, so perhaps it was working before the change in ofGstVideoPlayer) and the Video Player example work. The later with the mouse’s change of speed.

I do not know whether to upgrade the system or not now.

1 Like

Thanks @pemb!

It might not be too hard to add to the PR a switch from playbin to playbin3 just for gstreamer 1.20.0 and 1.20.1 versions.

I’ll wait to see if we get any other reports from people on the PR. As it would be good to know if it is based on the GStreamer version more than other variables.

Maybe try:

sudo dnf upgrade gstreamer1-devel gstreamer1-plugins-base-devel

First as it might be that you can upgrade gstreamer without going to Fedora 36?

No worries either way, but if you do end up on 36 - would be curious to know if it works with playbin

Thanks so much!!
Theo

sudo dnf upgrade gstreamer1-devel gstreamer1-plugins-base-devel tells me that I have the latest version of gstreamer in fedora 35.

I’ll do the fix in my main machine, and if it works, I will install fedora 36 in the second one. I’ll let you know. Glad to help.

1 Like

From what @edovino says - F36 / 1.20.3 doesn’t fix the issue - so maybe don’t worry about upgrading :slight_smile: