Gstreamer 1.0: Video from tutorials is not playing on MacOS
Asked Answered
K

3

6

I am trying to compile this tutorial Tutorial_01 on my MacOS 10.11.3 with Xcode 7.2 and not getting any video: I can hear an audio but it seems like the video window is lost somewhere.

I tried playing the same media with command line gat-launch-1.0:

gst-launch-1.0 -v playbin uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm

and it works just fine opening the media in OpenGL Renderer.

Any ideas?

Thanks in advance, Max

Update: Getting this warning while in debug mode:

0:00:00.314802000 [336m64763[00m 0x7f93e4854a30 [32;01mFIXME  [00m [00m        videodecoder gstvideodecoder.c:1057:GstFlowReturn gst_video_decoder_drain_out(GstVideoDecoder *, gboolean):<vp8dec0>[00m Sub-class should implement drain()
Kwangju answered 1/2, 2016 at 17:55 Comment(1)
Ok, debugging showed: ... Sub-class should implement drain()... <matroskademux0>[00m peek failed, ret = eos...Kwangju
F
7

looks like you need to run Glib event loop on mac.

Define the variable

GMainLoop *main_loop;

Then run loop after pipeline creation:

main_loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (main_loop);

Probably you need callback for controlling loop so you can use g_timeout_add.

Hope it helps

Update:

GStreamer Bus - this link should help too

Frankfurter answered 7/10, 2017 at 12:22 Comment(1)
I had the same problem with GStreamer 1.15.1 and Xcode 10.1. I could play fine from the command line invoking playbin, but Tutorial 1 produced sound and no video. Adding the main loop code above worked for me to get video to appear when running Tutorial 1 via Xcode. The call to g_main_loop_run() needs to come right after the pipeline state is set to playingEncaenia
R
1

I don't think playbin2 is still a valid source plugin anymore. It's functionality has been migrated into playbin (I think).

But anyway - check the error codes if something is not working. They usually give a good readable error of what is wrong.

gstreamer.com Is not an official resource of the gstreamer project and focuses on the outdated 0.10 release branch. I recommend looking for examples at http://gstreamer.freedesktop.org. Even the gstreamer.com start page recommends that.

Relentless answered 2/2, 2016 at 22:13 Comment(3)
Sure, replace playbin2 with playbin in your code.Crematorium
You can also use GST_DEBUG environment variable to debug such errors. Set it to 3.Crematorium
Yes, i replaced that as I showed in the gst-launch example. The problem is that it works but without video, only audio plays.Kwangju
B
0

Got the same problem when installing GStreamer from the official packages, as described here. Installing with brew solved the issue and the tutorial worked out of the box.

Not a proper solution but it worked.

Bunion answered 25/10, 2023 at 22:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.