Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Pipeline error when using some RTSP cameras #114

Closed
yockgen opened this issue Jun 25, 2022 · 4 comments
Closed

Pipeline error when using some RTSP cameras #114

yockgen opened this issue Jun 25, 2022 · 4 comments

Comments

@yockgen
Copy link

yockgen commented Jun 25, 2022

I've a RTSP camera is running, and confirm able to access from the host (tested via VLC), however, receiving following error:

{"levelname": "INFO", "asctime": "2022-06-25 11:18:23,224", "message": "Creating Instance of Pipeline object_detection/person_vehicle_bike", "module": "pipeline_manager"}
{"levelname": "ERROR", "asctime": "2022-06-25 11:18:23,501", "message": "Error on Pipeline 868ccefef47811ecbc670242ac110002: gst-resource-error-quark: Could not write to resource. (10): ../gst/rtsp/gstrtspsrc.c(7562): gst_rtspsrc_setup_streams_start (): /GstPipeline:pipeline18/GstURISourceBin:source/GstRTSPSrc:source:\nError (500): Internal Server Error", "module": "gstreamer_pipeline"}

Restful call as below:

curl localhost:8080/pipelines/object_detection/person_vehicle_bike -X POST -H 'Content-Type: application/json' -d '{
"source": {
"uri": "rtsp://xxxx:[email protected]:554/videoMain.sdp",
"type": "uri"
},
"destination": {
"metadata": {
"type": "file",
"format": "json-lines",
"path": "/tmp/results.jsonl"
},
"frame": {
"type": "rtsp",
"path": "person-detection"
}
}

}'

Any advice for next step is appreciated!

@brmarkus
Copy link

Can you provide more details about your environment (software and hardware), please?
Which version of PipelineServer do you use, how do you use it, how have you configured it, how did you start your usecase?
Looks like a permission-related issue.

@yockgen
Copy link
Author

yockgen commented Jun 27, 2022

This is how I started the pipeline server:

Terminal 1:

  1. git clone https://github.com/dlstreamer/pipeline-server
  2. cd /root/pipeline-server
  3. ./docker/build.sh
  4. docker/run.sh --enable-rtsp -v /tmp:/tmp

Terminal 2:
curl localhost:8080/pipelines/object_detection/person_vehicle_bike -X POST -H 'Content-Type: application/json' -d '{
"source": {
"uri": "rtsp://xxxx:[email protected]:554/videoMain.sdp",
"type": "uri"
},
"destination": {
"metadata": {
"type": "file",
"format": "json-lines",
"path": "/tmp/results.jsonl"
},
"frame": {
"type": "rtsp",
"path": "person-detection"
}
}

}'

I'm using master branch of pipeline-server.

Another finding, it seems only happened to RTSP source, I've tried Internet RTSP source as below and confirmed I could use VLC to play the stream on the machine run pipeline-server:
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4

I can occasionally get it work after like tried for 20+ times on the curl, once I restart the container, then I need to try with my luck again, and I'm seeing this error if the curl failed:

{"levelname": "INFO", "asctime": "2022-06-27 11:48:22,961", "message": "Creating Instance of Pipeline object_detection/person_vehicle_bike", "module": "pipeline_manager"}
{"levelname": "ERROR", "asctime": "2022-06-27 11:48:23,235", "message": "Error on Pipeline 0c1a2084f60f11ec9ab00242ac110002: gst-resource-error-quark: Could not open resource for reading and writing. (7): ../gst/rtsp/gstrtspsrc.c(8025): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline19/GstURISourceBin:source/GstRTSPSrc:source:\nFailed to connect. (Generic error)", "module": "gstreamer_pipeline"}

Hope the info is enough.

@whbruce
Copy link

whbruce commented Jun 29, 2022

I think decodebin is struggling to deal with your RTSP camera. Switch out the source part of your request for this and let me know how it goes.

  "source": {
      "type": "gst",
      "element": " urisourcebin",
      "properties": {
          "uri": "rtsp://xxxx:[email protected]:554/videoMain.sdp",
          "latency": 0
      },
      "postproc": "rtph264depay"
  }

@yockgen
Copy link
Author

yockgen commented Jun 30, 2022

Thanks! The solution work like a charm.

curl localhost:8080/pipelines/object_detection/person_vehicle_bike -X POST -H 'Content-Type: application/json' -d '{
"source": {
"type": "gst",
"element": " urisourcebin",
"properties": {
"uri": "rtsp://xxxxx:[email protected]:554/videoMain.sdp",
"latency": 0
},
"postproc": "rtph264depay"
},
"destination": {
"metadata": {
"type": "file",
"format": "json-lines",
"path": "/tmp/results.json1"
},
"frame": {
"type": "rtsp",
"path": "person-detection"
}
}

}'

@yockgen yockgen closed this as completed Jun 30, 2022
@whbruce whbruce changed the title RTSP error - Could not write to resource Pipeline error when using RTSP camera Jun 30, 2022
@whbruce whbruce pinned this issue Jun 30, 2022
@whbruce whbruce changed the title Pipeline error when using RTSP camera Pipeline error when using some RTSP cameras Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants