No video displayed

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

No video displayed

Ramin2c
Hi,
I'm quite new to GStreamer and my first try to compile and run the basic Tutorial 1 partially failed by not being able to see any video, but the audio can be heard and the pipeline stops when reaches the end of the stream.
I tried basic Tutorial 2 (building a pipeline manually) with videotestsrc element and the result is the same.
Both of the examples can work fine though if corresponding gst-launch-1.0 is run instead from the command line; i.e.:

Tutorial 1: ./gst-launch-1.0 playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm
Tutorial 2: ./gst-launch-1.0 videotestsrc ! autovideosink


Even more, did the compilation directly from the command line like:

gcc main.c -I/Library/Frameworks/GStreamer.framework/Headers -L/Library/Frameworks/GStreamer.framework/Libraries -lgstreamer-1.0 -o testApp
 
And neither one could bring up the video window.

I'm using GStreame 1.0 on Mac OSX Sierra 10.12.3 and XCode for Developing, with different project types, Cocoa, command line and even importing all the Tutorial codes directly into en empty project.

Does anyone know why if fails to show the video? or any tips what I should look at?

Thanks
Ramin

PS: Links to GStreamer basic tutorials:
https://gstreamer.freedesktop.org/documentation/tutorials/basic/index.html

Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Arvin6
Hi, I'm facing the same problem now. Did you manage to solve it? Please revert ASAP.
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Ramin2c
Hi,
No, it never worked for me and I had to gave up on building the pipeline with gst_parse_launch.
The alternative solution is two either place all the required elements manually or use a playbin.
I attach the code for playbin below, hoping that it helps.

Good Luck
Ramin

//
//  main.c
//  Tutorial 1 alt
//

#include <stdio.h>
#include <gst/gst.h>

/*
    playbin flags
    borrowed from playback-tutorial-1.c
*/
typedef enum {
    GST_PLAY_FLAG_VIDEO         = (1 << 0), /* We want video output */
    GST_PLAY_FLAG_AUDIO         = (1 << 1), /* We want audio output */
    GST_PLAY_FLAG_TEXT          = (1 << 2)  /* We want subtitle output */
} GstPlayFlags;

int main(int argc, const char * argv[]){
    GstElement *playbin;
    GstStateChangeReturn ret;
    GMainLoop *main_loop;
    GstBus *bus;
    GstMessage *msg;
    GstPlayFlags flags;
   
    /* Initialize GStreamer */
    gst_init (&argc, &argv);
   
    /* Create the elements */
    playbin = gst_element_factory_make ("playbin", "playbin");
   
    if (!playbin) {
        g_printerr ("Not all elements could be created.\n");
        return -1;
    }
   
    /* Set the URI to play */
    g_object_set (playbin, "uri", "https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);
    //https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_cropped_multilingual.webm
   
    /* Set flags to show Audio and Video but ignore Subtitles */
    g_object_get (playbin, "flags", &flags, NULL);
    flags |= GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO; // switch on/off audio and video streams
    g_object_set (playbin, "flags", flags, NULL);
    bus = gst_element_get_bus(playbin);
   
    ret = gst_element_set_state (playbin, GST_STATE_PLAYING);
    if (ret == GST_STATE_CHANGE_FAILURE) {
        g_printerr ("Unable to set the pipeline to the playing state.\n");
        gst_object_unref (playbin);
        return -1;
    }
   
    main_loop = g_main_loop_new (NULL, FALSE);
    g_main_loop_run (main_loop);
   
    msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);

    /* Free resources */
    if (msg != NULL)
        gst_message_unref (msg);

    /* Free resources */
    g_main_loop_unref (main_loop);
    gst_object_unref (bus);
    gst_element_set_state (playbin, GST_STATE_NULL);
    gst_object_unref (playbin);
   
    return 0;
}
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Arvin6
I'm a beginner and just trying to build the tutorials. At first, I was able to hear the audio. Now after trying to debug a bit (there was symlinks missing with prec and glib), I couldn't even hear that now, it just exits with a process completed message. Any idea why that would happen?  Also I was using playbin with parse_launch which is exactly as given in the tutorial.
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Ramin2c
Does it work with gst-launch? can you hear audio and see the video?
Also, check your gstreamer version
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Arvin6
This post was updated on .
My gstreamer version is 1.0 (Downloaded the latest 1.12.2).
The test src is not working too.
 gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink

Tried glimagesink and ximagesink too.

This is the error I get if I run it without the last argument ( autovideosink)
// Error

ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(2939): void gst_base_src_loop(GstPad *) (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:00.023214000
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

//Error
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Ramin2c
It is impossible to run the video pipeline without a sink. I just tried again from the command line and both autovideosink and glimagesink worked as expected.
Send me your code if you want and I'll try to compile and see how it looks.
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Arvin6
As I said, I'm not trying anything complex at all. I'm building the tutorial to see if its working. This is the link to the code, I didn't change anything.
https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html 

Also, according to this https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/using.html 

$ gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink command should work and I need to have a test video running, If I'm not wrong. that is also not working.

The problem is with the installation, I think. Is there any special steps that I need to do, apart from the instructions given? Also I didn't get the gst-sdk folder with it. I installed two pkg files and one dmg. Do you remember doing anything else when you did it?
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Ramin2c
mmmmmmmm....
weird, because I copy pasted the same command and it worked for me.
Also, there is no gst-sdk on my machine, so I guess something is wrong with your machine configuration.
Have you tried playing a local file instead?
Otherwise, I don't remember any special step or fix before or after the installation.
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Arvin6
Tried with a local file as well, same problem. I should try it on another machine after the weekend. Hoping that it would work. Do you know any alternatives for streaming other than Gstreamer?
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Ramin2c
I hope it would work then.
Regarding the selection of streaming frameworks, I guess it really depends on what you want to do. In our case, G-Streamer was selected because it is cross platform and (even more important) we have a lot of image processing stuff as well as low level coding which demanded to have a strong media framework.
I have experience with Microsoft Directshow and Media Framework which former is my favorit but they are MS Windows dependent.
You might even wish to look at the simpler solutions, Node JS, Java Script. There are some more advanced frameworks as well, e.g. https://www.meteor.com/ .
All-in-all, don't go for G-Streamer and similar frameworks if you don't need to!

R.
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Arvin6
Thank you so much for helping me out. It works now. The problem was, there were many plugins missing. Running a simple

sudo port install gstreamer1-gst-plugins-good   solved my problem
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Ramin2c
Good to hear that and thanks for sharing!
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

seany
In reply to this post by Arvin6
I can exactly same problem. I used homebrew to install all the plugins.
Howecer my "Hello world" program from
https://gstreamer.freedesktop.org/documentation/tutorials/basic/hello-world.html
still have same problem. I.e. audio only, no Video. At end of program when
no more audio is playing, the windows pops up with blank page.

Appreciate any guidance.

Thanks

Sean



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

Ramin2c
Have you tried what Arvid did?

sudo port install gstreamer1-gst-plugins-good

Otherwise, I had an alternative solution which might work (perhaps with some
tweaks). find it here:
https://github.com/Ramin2c/G-Tutorials/blob/master/Tutorial%201%20alt/main.c

Good Luck!





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: No video displayed

seany
Yes I did. I even redid everything but with latest  

*Update to latest Sierra (10.12.6)*

*Reinstalled gstreamer latest (1.12.2)*

*Installed latest Xcode*

*Installed MacPorts*
   - for the sudo ports install ....

*Installed Gstreamer Plugins:*
sudo port install gstreamer1 gstreamer1-gst-plugins-base
gstreamer1-gst-plugins-good gstreamer1-gst-plugins-bad
gstreamer1-gst-plugins-ugly

*Installed codec H264 (for .mp4 video that was missing from all the above
installs):*
sudo port install gstreamer1-gst-libav

Debugging:

1) Ran native GStreamer launch program: Worked
    gst-launch-1.0  playbin uri='file:///Users/test.mp4'

2) Ran GStreamer 'Hello World' program - Audio only, no Video.
At the end of program execution, Video renderer window is displayed (black
background, no Video)

Seans-MBP:MacOS seanyiu1$ export GST_DEBUG=2
Seans-MBP:MacOS seanyiu1$ ./test_gs
0:00:00.021033000 13401 0x7ff5477ec390 WARN                 basesrc
gstbasesrc.c:3480:void gst_base_src_start_complete(GstBaseSrc *,
GstFlowReturn):<source> pad not activated yet
0:00:00.021512000 13401 0x7ff5477ec390 WARN                 basesrc
gstbasesrc.c:3480:void gst_base_src_start_complete(GstBaseSrc *,
GstFlowReturn):<source> pad not activated yet
0:00:00.034842000 13401 0x7ff5460eef70 WARN                 qtdemux
qtdemux.c:3008:qtdemux_parse_trex:<qtdemux0> failed to find fragment
defaults for stream 1
0:00:00.034906000 13401 0x7ff5460eef70 WARN                 qtdemux
qtdemux.c:3008:qtdemux_parse_trex:<qtdemux0> failed to find fragment
defaults for stream 2
0:00:00.034955000 13401 0x7ff5460eef70 WARN                 basesrc
gstbasesrc.c:2389:gboolean gst_base_src_update_length(GstBaseSrc *, guint64,
guint *, gboolean):<source> processing at or past EOS
Seans-MBP:MacOS seanyiu1$

Didn't see any apparent errors in GStreamer Debug Log above. Why is it that
'gst-launch-1.0 playbin....'  runs but  not the 'hello world' program ? They
should do essentially the same thing. The GST execution Path should be the
same also.

This problem I am seeing probably belies the many problems I am seeing with
my app which calls the GStreamer dylibs which runs fine on Windows but not
on MAC OS X. I am just using the GStreamer 'Hello World' program as a
baseline to try to isolate the issue.

I am hitting a brick wall here. Appreciate yours or anyone's help.

Thanks

Sean



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel