gstd-1.x icon indicating copy to clipboard operation
gstd-1.x copied to clipboard

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

Open DeveloperRachit opened this issue 5 years ago • 12 comments

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

DeveloperRachit avatar Mar 26 '20 06:03 DeveloperRachit

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.

fischer avatar Mar 26 '20 15:03 fischer

@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!

rrcarlosrodriguez avatar Mar 26 '20 16:03 rrcarlosrodriguez

can i get example using pygstc with python

DeveloperRachit avatar Mar 27 '20 03:03 DeveloperRachit

how to create pipeline by using pipeline_create these kind of example

DeveloperRachit avatar Mar 27 '20 04:03 DeveloperRachit

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

rrcarlosrodriguez avatar Mar 27 '20 15:03 rrcarlosrodriguez

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

DeveloperRachit avatar Mar 30 '20 07:03 DeveloperRachit

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 avatar Mar 30 '20 11:03 DeveloperRachit

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

DeveloperRachit avatar Mar 30 '20 11:03 DeveloperRachit

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 avatar Apr 02 '20 16:04 jafet-chaves

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.

jafet-chaves avatar Apr 02 '20 16:04 jafet-chaves

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

DeveloperRachit avatar Apr 02 '20 16:04 DeveloperRachit

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

Abrahamon avatar Jun 10 '20 17:06 Abrahamon