Skip to content

Backport sink to gst 1.14#78

Open
michaelgruner wants to merge 10 commits into
teltek:masterfrom
RidgeRun:backport-sink-to-gst-1.14
Open

Backport sink to gst 1.14#78
michaelgruner wants to merge 10 commits into
teltek:masterfrom
RidgeRun:backport-sink-to-gst-1.14

Conversation

@michaelgruner

Copy link
Copy Markdown

Provides a backport of the sink elements for GStreamer 1.14. It does so by keeping a local copy of the aggregator sources. The backport may be built conditionally by using the "sink-v1_14" feature.

@michaelgruner

Copy link
Copy Markdown
Author

Oh, BTW, I had to manually edit some of the aggregator sources to add the update_segment method. I know these are autogenerated, but this was the only missing piece.

@sdroege

sdroege commented Oct 13, 2021

Copy link
Copy Markdown
Contributor

Oh, BTW, I had to manually edit some of the aggregator sources to add the update_segment method. I know these are autogenerated, but this was the only missing piece.

Did you take that from gstreamer-rs or re-implement it?

Comment thread build.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/base/gstaggregator.c

@sdroege sdroege left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me otherwise, thanks

@michaelgruner

Copy link
Copy Markdown
Author

Oh, BTW, I had to manually edit some of the aggregator sources to add the update_segment method. I know these are autogenerated, but this was the only missing piece.

Did you take that from gstreamer-rs or re-implement it?

I took the full base directory from gst-plugins-rs/utils/fallbackswitch/base

@sdroege

sdroege commented Oct 14, 2021

Copy link
Copy Markdown
Contributor

I took the full base directory from gst-plugins-rs/utils/fallbackswitch/base

Can you update that from the latest bindings and GStreamer? The version from fallbackswitch is old.

FWIW, I'm going to remove that pre-1.18 configuration from fallbackswitch soonish. 1.18 is old enough and maintaining that wastes too much time (which is also why that version is outdated and why I'm explictly asking you to keep this up to date here).

@michaelgruner
michaelgruner force-pushed the backport-sink-to-gst-1.14 branch 2 times, most recently from e2dbf57 to b29c995 Compare October 28, 2021 03:53
@michaelgruner
michaelgruner force-pushed the backport-sink-to-gst-1.14 branch from c6c2cbe to 10e711d Compare October 28, 2021 04:23
@michaelgruner

Copy link
Copy Markdown
Author

Changes done @sdroege please review one last time

@minusplusminus

Copy link
Copy Markdown

Hi, i'm using shared memory gst functionality and I get a panic when using this combined with ndisink

producer

gst-launch-1.0 -v videotestsrc ! "video/x-raw, format=BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1" \
! queue ! shmsink socket-path=/dev/shm/sink shm-size=663552000 sync=true wait-for-connection=false

consumer

gst-launch-1.0 -vvv shmsrc socket-path=/dev/shm/sink is-live=true \
! "video/x-raw, format=BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1" \
! queue ! videoconvert ! queue ! ndisink ndi-name="My NDI source"

compiled with

apt install -y git && git clone https://github.com/RidgeRun/gst-plugin-ndi/  && \
    cd gst-plugin-ndi && \
    git checkout  backport-sink-to-gst-1.14 && \
    ~/.cargo/bin/cargo build --no-default-features --features="sink-v1_14"
nvbuf_utils: Could not get EGL display connection
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/NdiSink:gst-ndi file 2.GstPad:sink: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
thread '<unnamed>' panicked at 'attempt to multiply with overflow', src/ndisink/imp.rs:316:60
stack backtrace:
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw, format=(string)BGRx, width=(int)1920, height=(int)1080, framerate=(fraction)60/1
   0: rust_begin_unwind
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
   2: core::panicking::panic
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:48:5
   3: <gstndi::ndisink::imp::NdiSink as gstreamer_base::subclass::base_sink::BaseSinkImpl>::render
             at /usr/src/ndi/gst-plugin-ndi/src/ndisink/imp.rs:316:60
   4: gstreamer_base::subclass::base_sink::base_sink_render::{{closure}}
             at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/gstreamer-base-0.17.2/src/subclass/base_sink.rs:462:9
   5: core::ops::function::FnOnce::call_once
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/ops/function.rs:227:5
   6: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panic/unwind_safe.rs:271:9
   7: std::panicking::try::do_call
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:406:40
   8: __rust_try
   9: std::panicking::try
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:370:19
  10: std::panic::catch_unwind
             at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panic.rs:133:14
  11: gstreamer_base::subclass::base_sink::base_sink_render
             at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/gstreamer-base-0.17.2/src/subclass/base_sink.rs:461:5
  12: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
ERROR: from element /GstPipeline:pipeline0/NdiSink:gst-ndi file 2: GStreamer encountered a general supporting library error.
Additional debug info:
/root/.cargo/registry/src/github.com-1ecc6299db9ec823/gstreamer-base-0.17.2/src/subclass/base_sink.rs(461): gstreamer_base::subclass::base_sink (): /GstPipeline:pipeline0/NdiSink:gst-ndi file 2:
Panicked: attempt to multiply with overflow
Execution ended after 0:00:00.128894964
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

In other situations gst ndi
I don't know if the same issue exists on the latest

@minusplusminus

Copy link
Copy Markdown

Never mind. Found that feature "reference-timestamps" is required to run on v14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants