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/DRA746: Video playback is not working properly with playbin

Part Number: DRA746

Tool/software: Linux

Hi Team,

 

We are encountering issue with video playback. To demonstrate the issue issue, find here the attached test application source and binary. To run the test application you can use below commands. Kindly consider this as urgent request.

 

#export XDG_RUNTIME_DIR=/var/run/root/1000 (this might vary for you)

#./testApp file:///home/root/B01_Baseline1.0_1280_720.MP4 20 5

 

In above command you can use different video. 2nd argument (i.e.20 ) is the time for which video will play and 3rd argument is number of times you want to repeat (i.e. 5 means 6 times it will play).

 

Issue is application displays video only first two times and after that there is no video on display though it seems to be running. Application uses below pipeline. I have attached here the two log one with GST_DEBUG and one with GST_DEBUG and WAYLAND_DEBUG log when running above command.

 

gst-launch-1.0 playbin uri=file:///home/root/B01_Baseline1.0_1280_720.MP4 video-sink=waylandsink

 

Our software is based on 3.02.00.03 Processor SDK Linux Automotive. We are using waylandsink as following.

 

SRC_URI = "git://git.ti.com/glsdk/gstreamer1-0-plugins-bad.git;protocol=git;branch=${BRANCH} \"

SRCREV_omap-a15 = "eb41f1c8fde05f87587c83d157835e3b2d19a298"

 

Also following patches getting applied to it.

 

file://0001-kmssink-remove-DCE-dependencies.patch \

file://0002-kmssink-add-YUYV-support.patch \

file://0001-gstwaylandsink-add-input-format-I420-support.patch \

 

 Thanks & Regards,

Vikash

  • https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/TestApp.7zteraterm_desktop_gst.logteraterm_desktop_gst_wl.log

  • Hi Vikash,

    I have forwarded your question to an expert for comment.

    Regards,
    Yordan
  • Hi Vikash,
    I could not run your testApp. I see some error when I execute the application.

    I tried with PSDKLA3.04 with gsttestplayer to reproduce the issue. I could not reproduce the issue.
    gsttestplayer doesn't use playbin but creates pipeline explicit elements based on the type of the stream.

    Refer
    processors.wiki.ti.com/index.php

    1)Create a config.txt with following commands
    start 0 /home/root/B01_Baseline1.0_1280_720_h264.MP4
    sleep 20
    stop 0
    rewind 1


    2) Rename B01_Baseline1.0_1280_720.MP4 to B01_Baseline1.0_1280_720_h264.MP4, so that gsttestplayer identifies the format of stream from its name.
    3) Execute gsttestplayer -s waylandsink -r 720x480 -c config.txt

    Running gstreamer pipeline with playbin in a loop also did not reproduce this issue with below command.
    while true
    do
    gst-launch-1.0 playbin uri=file:///usr/share/ti/video/HistoryOfTIAV-480p.mp4 video-sink=waylandsink
    sleep 1
    done

    I have been running both of these together and seeing each pipeline is getting launched successfully and showing the video on display.

    Thanks
    Ramprasad
  • Hi Ramprasad,

    What error did you observe with attached testApp? If required, you can compile the application as I have also shared the source.

    I think it is important to check with application I shared. Cause it creates pipeline programmatically and sets the pipeline state to playing and NULL repetitively and app do not use "gst-launch-1.0" and similar way we use to implement usb video playback feature .

    Same application works fine on other platforms.

    Let me know if you need any further information.

    It also worked for me. i.e. "running gstreamer pipeline with playbin in a loop". Eeven following pipeline also works for me.

    gst-launch-1.0 filesrc location=/home/root/B01_Baseline1.0_1280_720.MP4 ! qtdemux ! h264parse ! ducatih264dec ! waylandsink


    Regards,
    Vikash
  • Hi Ramprasad,

    Are you able to reproduce the issue?

    Regards,
    Vikash
  • Hi Vikash,
    I tried with your testApp executable, I am seeing video is seen on display only once. I am trying to understand your code. Will update you if there is any progress.

    Ramprasad
  • I see below log on console

    root@dra7xx-evm:~# ./testApp file:///home/root/bebe_h264.mp4 10 4
    ************ Test ************
    usage: ./testApp filename sec times

    (testApp:1534): GLib-GObject-WARNING **: g_object_set_valist: object class 'GstWaylandSink' has no property named 'surface-id'

    *********** Start Play Video ************
    set state to PLAYING async
    GMainThread Started
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state NULL --> READY
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state READY --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> PLAYING

    *********** Start Stop Video ************
    GSTPlayer::stop() Obtained the play state:[PLAYING] pending:[VOID_PENDING]
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PLAYING --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> READY
    *********** End Stop Video ************

    *********** Start Play Video ************
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state NULL --> READY
    set state to PLAYING async
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state READY --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> PLAYING

    *********** Start Stop Video ************
    GSTPlayer::stop() Obtained the play state:[PLAYING] pending:[VOID_PENDING]
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PLAYING --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> READY
    *********** End Stop Video ************

    *********** Start Play Video ************
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state NULL --> READY
    set state to PLAYING async
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state READY --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> PLAYING

    *********** Start Stop Video ************
    GSTPlayer::stop() Obtained the play state:[PLAYING] pending:[VOID_PENDING]
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PLAYING --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> READY
    *********** End Stop Video ************

    *********** Start Play Video ************
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state NULL --> READY
    set state to PLAYING async
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state READY --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> PLAYING

    *********** Start Stop Video ************
    GSTPlayer::stop() Obtained the play state:[PLAYING] pending:[VOID_PENDING]
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PLAYING --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> READY
    *********** End Stop Video ************

    *********** Start Play Video ************
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state NULL --> READY
    set state to PLAYING async
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state READY --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> PLAYING

    *********** Start Stop Video ************
    GSTPlayer::stop() Obtained the play state:[PLAYING] pending:[VOID_PENDING]
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PLAYING --> PAUSED
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state PAUSED --> READY
    *********** End Stop Video ************

    *********** Start Play Video ************
    CgstBasePlayer::gstBusCallback() Got state-changed message: Element "URI Pipeline" state NULL --> READY
    set state to PLAYING async

    The application is not tearing down properly.
  • Hi Ramprasad,

    Yes, video is visible sometime once and sometime twice. Let me know if you need further information.

    Regards,
    Vikash
  • Hi Vikash,
    Did you try this gsttestplayer? Let me know your results.
  • Hi Ramprasad,

    I am sure gsttestplayer will work as you have already tested and gsttestplayer doesn't use playbin but creates pipeline explicit elements based on the type of the stream. Also I as I mentioned other methods with explicit elements works for me too.

    We need to play the video the way i have demonstrated in testApp due to the USB video playback feature requirement of our customer. Request you to kindly update once you have inputs.

    Regards,
    Vikash
  • Hi Ram,

    Kindly request you to consider this issue on higher priority as it is blocker for our feature release. Could you please give some idea on when can we expect a fix on this?

    Regards,
    Vikash
  • Hi Vikash,

    While true loop is working for both explicit pipeline as well as with playbin.

    In which platform your application is working? What is the gtreamer version?

    Thanks

    Ram

  • Hi Ram,

    Application is working with NXP's i.MX6 (with glimagesink , gstreamer-1.8.1) and intel's apollolake (with mfxsink , gstreamer-1.8.3 ).

    Regards,
    Vikash

  • Hi Vikash,
    I have identified the issue with waylandsink on why video is not displayed from second time onwards. Since it is a blocker for you I am suggesting the fix here. Please make this change and build your libgstwaylandsink.so from gst-bad

    --- a/ext/wayland/gstwaylandsink.c
    +++ b/ext/wayland/gstwaylandsink.c
    @@ -341,6 +341,7 @@ gst_wayland_sink_change_state (GstElement * element, GstStateChange transition)
    switch (transition) {
    case GST_STATE_CHANGE_PAUSED_TO_READY:
    gst_buffer_replace (&sink->last_buffer, NULL);
    + g_atomic_int_set (&sink->redraw_pending, FALSE);
    if (sink->window) {
    if (gst_wl_window_is_toplevel (sink->window)) {
    g_clear_object (&sink->window);

    I have tested your application with 4th argument set to more than 50. I always see video now. Please test this and confirm if the issue is resolved.
    We will share the patch formally in post-release updates.

    Ram
  • Hi Ram,

    Thanks you for your quick support. I will test the suggested fix and will update you.

    Regards,
    Vikash
  • Thank You Ram. Issue seems to be fixed with test application.

    Regards,
    Vikash
  • Thanks Vikash for confirming this. Please mark this thread as verified