Skip to main content

Source Stream Element

Source elements bring in data and push it into the pipeline, they contain three mandatory fields and two optional fields: address, rate and type and timeout and proxy respectively.

type: "video"                     # string: "video", "file", "youtube", "inf", "zmq", "zmqinternal"
address: "rtsp://camera:554/path" # string: url or path, depending on 'type' property
rate: 25 # integer: desired input rate
timeout: -1 # integer: if source is disconnected try to reconnect for this many minutes, -1 is try indefinitely
proxy: true # boolean: whether to enable MP4 proxying of video stream
  • address is a URL to a camera, video stream, or a zmq publisher. There are two forms:
    • Short-form: A simple URL string. May include username and password if they don't contain special characters.
    • Long-form: An object containing a URL with extra authentication properties.
      • url: A URL string without username and password.
      • user: A username for HTTP authentication.
      • pass: A password for HTTP authentication.
  • rate is the desired input data rate for the source, sources that provide data faster than the rate will drop packets appropriately.
  • type is the source type, there are 6 different options:
    • video : https or rtsp video stream.
    • file : stream from a video file.
    • youtube : stream from a youtube video.
    • zmqinternal : for connecting nimble containers together, must be connected to a nimble zmqinternal sink.
    • zmq : stream from an external zmq publisher.
    • inf : infinite source of random data.
  • timeout if source is disconnected try to reconnect for the specified many minutes, -1 is try indefinitely.
  • proxy if false this will disable the MP4 proxy for trans-encoding the input stream to streaming MP4 for consumption by a GUI.

Adding your own camera feeds

Using your own cameras involves modifying the config.yaml, a sample is provided in samples/c1_camera_person-detection.yaml.

Setup steps are as follows:

  • First, make sure the camera is accessible by the host machine.
  • Copy samples/c1_camera_person-detection.yaml to config.yaml:
    user@host:~$ cp samples/c1_camera_person-detection.yaml config.yaml
  • Modify config.yaml, replace <CAMERA_FEED_HERE> with your rtsp/http address. Leave rate as 30 and type as "video".
  • Run the demo: docker-compose up

Known Issues

  • There is a rare GStreamer issue that prevents the source from starting, the fix is currently to restart Nimble.