This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Display an Mp4 file using g-streamer pipeline

Part Number: AM5728

Tool/software: Linux

Hi,

In our project we converted g-streamer pipeline to c code to display an mp4 file.

G-streamer pipeline : 

gst-launch-1.0 filesrc location=/home/TearOfSteel-AV-Short-720x406.mp4 ! decodebin name=dec ! videoconvert ! autovideosink   dec. ! audioconvert ! audioresample ! alsasink

 

after compiling  and running the code we are facing some Warnings like

(gst:12557): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstAutoVideoSink' has no property named 'location'

(gst:12557): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstAlsaSink' has no property named 'time'
Linked all the Elements together

Unable to set the pipeline to the playing state.

 part of code where we got warning and stuck :

    g_object_set (G_OBJECT (sink), "location", "/home/TearOfSteel-AV-Short-720x406.mp4/",filename, NULL) ;
    
    g_object_set(G_OBJECT (asink), "time", "%d.mp4", "max-size-time", 60000000000, NULL);

    

...........................................................................................................................................................................................................................................................

gst_element_link_many (source, decoder, videoconverter, sink, audioconverter, audioresampler, asink, NULL) ;
        g_print("Linked all the Elements together\n");

    
      
    /*   The element is set to accept data  */
      gst_element_set_state (pipeline, GST_STATE_PLAYING);
    if (ret == GST_STATE_CHANGE_FAILURE)
    {
            g_printerr ("Unable to set the pipeline to the playing state.\n");
            gst_object_unref (pipeline);
            return -1;
    }

    g_print ("Running...\n");
      g_main_loop_run (loop);

 let me know where did i done the mistake.

Regards,

GAG

  • Hello,

    Please confirm that this pipeline

    gst-launch-1.0 filesrc location=/home/TearOfSteel-AV-Short-720x406.mp4 ! decodebin name=dec ! videoconvert ! autovideosink   dec. ! audioconvert ! audioresample ! alsasink

    is working if you execute it in console.

    It does  not seems to work I do not see demuxer element or video parser element or audio decoder.

    I would recommend you to test the pipeline in the console first before to use it in c application.

    I will comment the warnings that you are observing:

    (gst:12557): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstAutoVideoSink' has no property named 'location'

       g_object_set (G_OBJECT (sink), "location", "/home/TearOfSteel-AV-Short-720x406.mp4/",filename, NULL) ;

    Please verify G_OBJECT (sink) this.

    Here is example:

      filesrc = gst_element_factory_make("filesrc", "filesource");
      g_return_val_if_fail (filesrc, -1);
      g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);

    (gst:12557): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstAlsaSink' has no property named 'time'

        g_object_set(G_OBJECT (asink), "time", "%d.mp4", "max-size-time", 60000000000, NULL);

    You are trying to set propert to alsasink element.

    Alsasink element does not have time property or max-size-time. Or may be these properties are for different element not asink(alsasink).

     You could check the alsasink properties by executing gst-inspect-1.0 alsasink

    Please refer this guide:

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_Multimedia.html

    Here there is an example with playbin

    kmssink:
      target #  gst-launch-1.0 playbin uri=file:///<path_to_file> video-sink=kmssink audio-sink=alsasink
    
    waylandsink:
      1. refer Wayland/Weston to start the weston
      2. target #  gst-launch-1.0 playbin uri=file:///<path_to_file> video-sink=waylandsink audio-sink=alsasink
    
    Here is the link to gstreamer tutorials also:
    https://gstreamer.freedesktop.org/documentation/tutorials/index.html

    Hope this helps.

    BR
    Margarita

  • hi,

    In addition to the above ,
    After changing some part of code and compiled I got
    Failed to create element of type ?sink?

    can you tell what it mean.

    Regards,
    GAG
  • Hello,

    Please share the error.
    Please confirm that your pipeline is working at all in console with gst-launch.

    BR
    Margarita