Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-channel identification in the python #60

Closed
vtpl1 opened this issue Apr 17, 2020 · 2 comments
Closed

Multi-channel identification in the python #60

vtpl1 opened this issue Apr 17, 2020 · 2 comments

Comments

@vtpl1
Copy link

vtpl1 commented Apr 17, 2020

Hi,
How to identify each channel uniquely in pad probe callback in python for multi channel pipeline?

@mliu2020
Copy link

Hi @vtpl1
Sorry for the late response, I think you can figure out from the message object, it has a "src" field.
You can check MessageType in call back and check the channel info.
https://gstreamer.freedesktop.org/documentation/gstreamer/gstmessage.html?gi-language=python#GstMessageType
Mark

@mikhail-nikolskiy
Copy link
Contributor

mikhail-nikolskiy commented Apr 22, 2020

@vtpl1,

You will need to assign different (unique) name in each channel, ex

channel#1: ... ! gvawatermark name=gvawatermark1 ! ...
channel#2: ... ! gvawatermark name=gvawatermark2 ! ...

then you can set callback for each channel (in the loop)

    pad = pipeline.get_by_name("gvawatermark1").get_static_pad("src")
    pad.add_probe(Gst.PadProbeType.BUFFER, pad_probe_callback)

    pad = pipeline.get_by_name("gvawatermark2").get_static_pad("src")
    pad.add_probe(Gst.PadProbeType.BUFFER, pad_probe_callback)

@vtpl1 vtpl1 closed this as completed May 9, 2020
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

No branches or pull requests

3 participants