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

how could i use gstd with python is there nat way to use with python #91

Open
DeveloperRachit opened this issue Mar 26, 2020 · 12 comments

Comments

@DeveloperRachit
Copy link

how could i use gstd with python is there nat way to use with python

@fischer
Copy link

fischer commented Mar 26, 2020

A python client binding was recently added - https://github.com/RidgeRun/gstd-1.x/tree/master/libgstc/pygstc. Looks like the documentation for using python is not yet in place - https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Daemon. Hopefully you can see the pattern on how to create and control pipes and then transfer that knowledge to enable you to use the python GSTD client binding.

@rrcarlosrodriguez
Copy link
Member

@DeveloperRachit you can find the PyGstc documentation here: https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Daemon_-_Python_Client

We released GstD v0.9.0 yesterday, including this feature, so it is pretty new and the documentation is a work in progress. We would be happy to hear your feedback!

@DeveloperRachit
Copy link
Author

can i get example using pygstc with python

@DeveloperRachit
Copy link
Author

how to create pipeline by using pipeline_create these kind of example

@rrcarlosrodriguez
Copy link
Member

You can check out the examples in our wiki page: https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Daemon_-_Python_API#Examples

@DeveloperRachit
Copy link
Author

i want to switch two source dyanamically using gstd with python have you any solution?

@DeveloperRachit
Copy link
Author

File "/home/rachit/gstd-1.x/libgstc/pygstc/gstc.py", line 222, in _send_cmd_line result = json.loads(jresult) File "/usr/lib/python3.6/json/__init__.py", line 348, in loads 'not {!r}'.format(s.__class__.__name__)) TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType' Traceback (most recent call last): File "/home/rachit/gstd-1.x/libgstc/pygstc/gstc.py", line 222, in _send_cmd_line result = json.loads(jresult) File "/usr/lib/python3.6/json/__init__.py", line 348, in loads 'not {!r}'.format(s.__class__.__name__)) TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "switching_testsrc.py", line 27, in <module> gstd_client.element_set('p_4_sink','interpipesrc1','listen-to','src_2') File "/home/rachit/gstd-1.x/libgstc/pygstc/gstc.py", line 554, in element_set self._send_cmd_line(['element_set'] + parameters) File "/home/rachit/gstd-1.x/libgstc/pygstc/gstc.py", line 227, in _send_cmd_line raise GstcError(type(exception).__name__) pygstc.gstcerror.GstcError: TypeError

@DeveloperRachit
Copy link
Author

i am getting that error when running my code because in element_set i set listen-to property

@jafet-chaves
Copy link
Contributor

Hi @DeveloperRachit, we have a demo available that uses these Python bindings. It's based on interpipes + deepstream, you can check it here: https://developer.ridgerun.com/wiki/index.php?title=NVIDIA_GTC_2020:_How_to_build_a_multi-camera_Media_Server_for_AI_processing_on_Jetson

@jafet-chaves
Copy link
Contributor

About the issue, it seems you're receiving a empty JSON (this is happening because an error generated when setting the listen-to property). Please check you're defining properly your pipelines. You can look at the demo provided above. Also if you can provide code it would be helpful to try to replicate and provide a more precise feedback.

@DeveloperRachit
Copy link
Author

Dear do you hve any kind of switching example between two source using gstd with but should be seamless when I would use live rtmp source

@Abrahamon
Copy link

Hi @DeveloperRachit, the next Gstd Release v0.11 will improve the error handling for the python GSTD client.

i am getting that error when running my code because in element_set i set listen-to property

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

5 participants