Setup
• Hardware Platform GPU
• DeepStream Version 7.0
• TensorRT Version 10.5.0.18
• Issue Type( questions, new requirements, bugs) Questions
Description
I have a python pipeline for which I would like to be able to detect erroneous videos when I’m trying to analyze them in the pipeline. I don’t quite understand de underlying error handling in GST / deepstream I guess, maybe you could help me clear things out?
Reproducible example
I’ve set up an example which can reproduce my problem, based on the sample deepstream_python_apps/apps/runtime_source_add_delete. I will provide my dockerfile so you can try it the same way I am running it
The small changes I made to the sample app is:
- The “bus_call”-method: catching errors and trying to stop and release the source in which the error was caught. I also removed the “loop.quit()” as I want to be able to recover from the error rather than closing down the pipeline
- Main takes more than 1 uri as source just by changing len(args) !=2 to len(args) > 1
The full code for the reproducible example is provided as a an archive so that you can just unzip and run the same way as I do. Hope it works:
reproduce_error_pipeline_test.zip (18.8 KB)
Corrupt file
When testing this I had a corrupt video giving the error: “no known streams found”, but for the purpose of reproducing this easily I also tried with just making an empty file with
touch empty.mp4
and giving it as input, it gives the same behaviour as if I provide a corrupt file (raising errors several times), only a different error message. So I hope this approach works to reproduce the problem. From now on, I use the empty file to display the behaviour.
I also provide the outputs as text files if you want to compare them.
Test happyflow
Running with 2 working source uri:s, ie running program like:
python3 runtime_source_add_delete/deepstream_rt_src_add_del_modified.py file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4 file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_office.mp4
Results in both sources being added and starts playing at the start, after which the addition/deletion of sources happen as expected.
Test 1 empty file
Running with one empty file like:
python3 runtime_source_add_delete/deepstream_rt_src_add_del_modified.py file:///opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/project/empty.mp4
Gives the error “stream contains no data”, which is reasonable given it is an empty file. It also says “STATE CHANGE SUCCESS” which makes me think the source is stopped and released as it should. However, it then tries to stop & release the source again it seems? And the pipeline hangs and won’t add any more sources as it should.
Test 1 working file and 1 corrupt file
Running with 1 legit file and one empty file like:
python3 runtime_source_add_delete/deepstream_rt_src_add_del_modified.py file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4 file:///opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/project/empty.mp4
Gives the same problem, but the video renderer window is at least opened. But the legitimate source file won’t start playing either, so the whole pipeline is frozen it seems?
Questions
So my questions are:
- It seems like the same error is raised several times. Why? And how should I go about handling them to avoid raising the same error several times?
- Is this a reasonable approach to handle erroneous videos? I have a use case where I don’t know in advance which videos will have to be analyzed, so I need a way to handle it during the pipeline running. Is there another better way?
- Are the sources being stopped/released in a faulty way? Do I need to add something to the bus_call to resume playing of the other sources (in the case of providing several sources)