Notes:
- This is not a bug, but an enhancement
- Implementing it would not have a (direct) functional benefit on videotemplate
- Might apply to other elements
Describe the bug
I created a tool (pycfgst, CristiFati/pycfgst) that converts a programmatically created pipeline (from Python) into its gst-launch-1.0 equivalent (of course considering all the latter's limitations).
It does that by identifying the elements, links between them and for each element getting its properties and their values and filtering the ones that are not needed / relevant.
The problem is that for elements like nvdsvideotemplate that is not possible, because when setting customlib-props multiple times (a very common scenario) only the last one is possible to be retrieved back
Steps/Code to reproduce bug
Running the PipelineParserNVidiaTestCase.test_videotemplate_original_separate from CristiFati/pycfgst - test_gstreamer.py yields:
[root@cfati-desktop:/mnt/work/github/cfati/pycfgst/src]> python -m unittest pycfgst.tests.test_gstreamer.PipelineParserNVidiaTestCase.test_videotemplate_original_separate
------- Custom0::SetProperty: [prop0] = [val0]
------- Custom0::SetProperty: [prop1] = [val1[{]},<.>/?|;:]
------- Custom0::SetProperty: [prop2] = [val 2 ]
Output:
gst-launch-1.0 -e \
videotestsrc \
num-buffers=1 \
pattern=18 \
! nvvideoconvert \
src-crop=0:0:0:0 \
dest-crop=0:0:0:0 \
! nvdsvideotemplate \
customlib-name=/mnt/work/github/cfati/pycfgst/src/pycfgst/tests/data/nvdsvideotemplate/testlib0/libvttest0.so \
customlib-props='prop2:val 2 ' \
! fakevideosink \
max-lateness=20000000
.
----------------------------------------------------------------------
Ran 1 test in 0.408s
OK
Although properties are correctly propagated to the library, only the last one is got back.
Expected behavior
The output pipeline command string should contain all 3 properties.
Environment details (please complete the following information):
N/A - tried in a Ubuntu DS container
Additional context
although I know DeepStream is not accepting any contributions, I took the liberty of creating a patch (nvdsvideotemplate-ds90-sep_del.patch) that fixes this issue:
Running the test_videotemplate_original_joined test (from above) with and without the patch applied (in the 2nd run, the properties are correctly passed to the custom library):
[root@cfati-desktop:/mnt/work/github/cfati/pycfgst/src]> python -m unittest pycfgst.tests.test_gstreamer.PipelineParserNVidiaTestCase.test_videotemplate_original_joined
videotemplate does NOT support customlib-props-sep, 1 line(s) from custom library should be displayed
------- Custom0::SetProperty: [prop0] = [val0;;;prop1:val1[{]},<.>/?|;:;;;prop2:val 2 ]
Output:
gst-launch-1.0 -e \
videotestsrc \
num-buffers=1 \
pattern=18 \
! nvvideoconvert \
src-crop=0:0:0:0 \
dest-crop=0:0:0:0 \
! nvdsvideotemplate \
customlib-name=/mnt/work/github/cfati/pycfgst/src/pycfgst/tests/data/nvdsvideotemplate/testlib0/libvttest0.so \
customlib-props='prop0:val0;;;prop1:val1[{]},<.>/?|;:;;;prop2:val 2 ' \
! fakevideosink \
max-lateness=20000000
.
----------------------------------------------------------------------
Ran 1 test in 0.483s
OK
[root@cfati-desktop:/mnt/work/github/cfati/pycfgst/src]> python -m unittest pycfgst.tests.test_gstreamer.PipelineParserNVidiaTestCase.test_videotemplate_original_joined
videotemplate DOES support customlib-props-sep, 3 line(s) from custom library should be displayed
------- Custom0::SetProperty: [prop0] = [val0]
------- Custom0::SetProperty: [prop1] = [val1[{]},<.>/?|;:]
------- Custom0::SetProperty: [prop2] = [val 2 ]
Output:
gst-launch-1.0 -e \
videotestsrc \
num-buffers=1 \
pattern=18 \
! nvvideoconvert \
src-crop=0:0:0:0 \
dest-crop=0:0:0:0 \
! nvdsvideotemplate \
customlib-name=/mnt/work/github/cfati/pycfgst/src/pycfgst/tests/data/nvdsvideotemplate/testlib0/libvttest0.so \
customlib-props='prop0:val0;;;prop1:val1[{]},<.>/?|;:;;;prop2:val 2 ' \
customlib-props-sep=';;;' \
! fakevideosink \
max-lateness=20000000
.
----------------------------------------------------------------------
Ran 1 test in 0.423s
OK
By submitting this issue, you agree to follow our code of conduct and our contribution guidelines.
Notes:
Describe the bug
I created a tool (pycfgst, CristiFati/pycfgst) that converts a programmatically created pipeline (from Python) into its
gst-launch-1.0equivalent (of course considering all the latter's limitations).It does that by identifying the elements, links between them and for each element getting its properties and their values and filtering the ones that are not needed / relevant.
The problem is that for elements like
nvdsvideotemplatethat is not possible, because when settingcustomlib-propsmultiple times (a very common scenario) only the last one is possible to be retrieved backSteps/Code to reproduce bug
Running the
PipelineParserNVidiaTestCase.test_videotemplate_original_separatefrom CristiFati/pycfgst - test_gstreamer.py yields:Although properties are correctly propagated to the library, only the last one is got back.
Expected behavior
The output pipeline command string should contain all 3 properties.
Environment details (please complete the following information):
N/A - tried in a Ubuntu DS container
Additional context
although I know DeepStream is not accepting any contributions, I took the liberty of creating a patch (nvdsvideotemplate-ds90-sep_del.patch) that fixes this issue:
customlib-propsspecificationcustomlib-props-sepproperty tonvdsvideotemplatethat is used to separate library propertiesRunning the
test_videotemplate_original_joinedtest (from above) with and without the patch applied (in the 2nd run, the properties are correctly passed to the custom library):By submitting this issue, you agree to follow our code of conduct and our contribution guidelines.