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.

TMDSIDK574: Dynamically resizing of a gstreamer generated video while using vpe

Part Number: TMDSIDK574

Hello community,

I currently try to mix gstreamer output from an optimized pipline and a Qt widget via the video overlay interface of the waylandsink (because QT video seems add some software video conversion, which slows down the performance).
It already works partially and I'm currently stucked on resizing a running video. The currently applied pipline is the following:

gst-launch-1.0 filesrc location=SafetyInstructions.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! ducatih264dec ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1280' ! waylandsink

In order to dynamically change the size of the video, while the video is shown, I manipulate the caps filter, which is following the vpe, just as I've learned it in a gstreamer tutorial (where it worked fine)

https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html ; Changing format in a PLAYING pipeline

unfortunately, this doesnt work with vpe. I think vpe doesn't take care of the caps filter, once the filter is adjusted and anything is running.
What do I have to do, if I want to resize the output of a currently running pipeline which uses vpe?

Best Regards

Thomas

  • Hello Thomas,

    If you want to change the resolution on fly(when the pipeline is in PLAYING state), you must dynamically link/unlink elements. You need to create a gstreamer application.

    Refer the below tutorials :

    Thomas Hofmann1 said:
    gst-launch-1.0 filesrc location=SafetyInstructions.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! ducatih264dec ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1280' ! waylandsink

    Please unlink and link the VPE element not only caps filter. Probably you must unlink and link the waylandsink also.

    Thomas Hofmann1 said:
    Changing format in a PLAYING pipeline

    What format you want to use in the capsfilter? Or you want to change the  resolution only in the capsfilter?

    Best Regards,

    Margarita

  • Hello Margarita,
    thank you for the quick answer. I only want to change the resolution. I will try unlink/link the elements (although it seems complicated in relation to my first approach). Do I have to create a new instance of a vpe, or may I simply reuse the former one?
    Best Regards
    Thomas
  • Hello,

    Please, follow the gst tutorial.
    The "old vpe" must be move to NULL state, unlink from decoder and capsfilter. Remove it from the bin( gst_bin_remove). Create a new vpe element(gst_element_factory_make), add it to the bin and link.

    Best Regards,
    Margarita
  • Hello,

    Pease if this answers your question click the "This resolved my issue" button.
    Thank you!
    If you have new question/issue you could open a new thread.

    Best Regards,
    Margarita