Capabilities Reference : VideoStream NO Video Codec and Audio Codec Information

Hi SmartThings Team,
When I refer the document : Capabilities Reference | SmartThings Developers
, and I want to use the capability of VideoStream, I did not see any information about video codec and audio codec.
I want to know :
Q1. Does smartThings support the rtsp streaming?
Q2. What kind of video codec and audio codec support in here ?
Q3. Does any example about the videostream capability?

Thanks a lot.

Welcome to the SmartThings Community, @VSaaS_Tutk!

Can you share more details about your integration, please? For example, the capabilities supported by the device, the purpose of the integration, etc.

Hi Nayelyz,
Thanks for your reply.
I want to use a witness spotlight cam from leedarson to connect to smarthThings.
This deviceā€™s capabilities is as follows:

  1. 2K QHD
  2. 2-Way Audio
  3. 400lm Spotlight
  4. Alarm Alert
  5. Human Detection
  6. SpotlightNight Vision
  7. 2T2R
  8. IP65
  9. Smoke/CO Alarm and Sound Detection
    10.Glass Break Detection

Ok, up to now, the video plugin works for the capabilities of VideoStream and MotionSensor combined through:

  • The already published device profiles, which are:
    • c1ca6938-e152-4a21-a349-d89df268f126 for RSTP
    • d1fddebd-137b-47fa-a05a-6e8329de19e0 for webRTC
  • You can use different integrations, like:
    • ST Schema > for cloud to cloud connections
    • Edge drivers > for Hub-connected devices (Zigbee, Z-Wave and LAN). Here, you would need to include the same metadata (VID and manufacturerName)

To start the stream you need to define the startStream command to send an event with the following information:

live_video = {
     "InHomeURL": "STREAMING_URL",
     "OutHomeURL": "STREAMING_URL"
 }

//Command used in ST Schema
addState('main', 'st.videoStream', 'stream', live_video)

To stop the stream you need to define the stopStream command to send an event with the following:

live_video = {
      "InHomeURL": "",
      "OutHomeURL": ""
}

//Command used in ST Schema
addState('main', 'st.videoStream', 'stream', live_video)

This is how the Detail View of the Device would look like:

2 Likes

Hi Nayelyz,
Thanks your replay.
How can I get the document about the both of information from smartThings?

  • The already published device profiles, which are:
    • c1ca6938-e152-4a21-a349-d89df268f126 for RSTP
    • d1fddebd-137b-47fa-a05a-6e8329de19e0 for webRTC

Do you mean the details of the device profiles?

You can use the CLI or the APIā€™s endpoint of deviceprofiles. Eg. Using the CLI:

smartthings deviceprofiles id [-j or -y]

This way, you can see which capabilities it uses and its metadata.

I have a few questions:

How is the motion detection working here? Does the plugin itself detect it based on video movement or is it expecting (onvif?) notifications from the camera?

what is the ā€˜addStateā€™ command in Edge?

Can you explain the ā€œInHomeURLā€ vs ā€œOutHomeURLā€ ? In my case I would always be getting a stream IN from a video camera;so would I only use InHomeURL then?

is using this fixed device profile the only way to get video to work? Can I not define my own device just using the videoStream capability? (My first attempt yielded no video window)

As this capability is only listed in the device profile, you should send the capability event but Iā€™m not sure how you would receive the event in the driverā€¦Iā€™ll talk to the engineering team about that

That command comes from the ST Schema SDK to send this new value to the capability in ST. In Edge, it would be device:emit_event.

Let me confirm this with the team.

Did you use the metadata in your profile and it still didnā€™t work?

If you only include the videoStream capability without the proper metadata, the plugin wonā€™t be displayed

@TAustin which are you using, webRTC or RTSP?

If I use the meta then yes, I get the expected presentation. However, Iā€™m passing my RTSP URL in both the in and out elements but not getting anything: (I assume youā€™ve been meaning to say ā€˜RTSPā€™, rather than ā€˜RSTPā€™)

example: rtsp://192.168.1.108:554/h264Preview_01_main

Maybe I should strip out the ā€˜rtsp://ā€™ prefix??

FYI, if I load just the ā€˜outā€™ URL, I eventually get an error message: ā€œThere was a problem streaming the video. Tap the refresh button.ā€. If I just load the ā€˜inā€™ URL, or both, it spins forever with no error.

I just realized something - most RTSP commands to an IP camera (DESCRIBE, SETUP, PLAY, TEARDOWN) are going to require authorization, yet thereā€™s no way you described to even provide a user and password. So Iā€™m not sure how this could even work??

OK, thanks for the info. I found this syntax for the URL, I donā€™t know if all the commands can use the ā€œbaseā€ where the user and password are included:

rtsp://user:pass@192.168.0.6:554/streamurl

I need to gather more information from the team, the integration of videocamaras is not very common and the current ones from official partners are using Schema Connector.

THAT WORKED!! Youā€™re awesome, thank-you :grin:

:hushed: :partying_face: :partying_face:
So, you donā€™t have issues starting/closing the streaming anymore?
What about the motion event?

Itā€™s not 100% - Iā€™m only getting video for a couple of my cameras, but itā€™s something. Iā€™ve figured out that the OUT URL seems to be the right one to use. I can leave the IN URL empty.

No issue with starting/stopping the stream for some cameras - for others itā€™s just spinning indefinitely and Iā€™m not getting any video.

I have the motion events working: that requires setting up event notifications with each camera according to ONVIF spec, which is all working (even if video is not).

@nayelyz Iā€™ve run up against some pretty significant issues trying to implement an Edge video driver:

  1. using the SmartThings-smartthings-c2c-ring-camera VID doesnā€™t appear to be a viable alternative, as it doesnā€™t allow me to have any device Settings. Itā€™s probably because that VID was designed for a cloud-to-cloud implementation in mind. For Edge, I need device Settings defined to be able to have the user configure userID and password, and other configuration settings.

  2. Iā€™ve been able to make another approach work, which is to NOT use that VID and instead rely on creating a camera group. That allows me to get video streaming to work, however it doesnā€™t seem to be very reliable. But, the big issue here is SECURITY. When my driver provides the rtsp streaming URL to SmartThings when requested, it has to include the cameraā€™s UserID and Password. This gets passed in the clear on the network, but even worse, it gets displayed in history!

So given these two issues, I am asking:

  1. We need a more versatile video presentation that is more suited for Edge drivers. Would it be possible for someone to create a new presentation like SmartThings-smartthings-c2c-ring-camera, but that doesnā€™t preclude device Settings? Nirvana would be the ability to also add other capabilities in the presentation, but I can live with the fixed format if only Settings were supported.

  2. We need a more secure way to provide authentication info with the stream URL. Developers also need more control over what gets displayed in history, like a flag parameter added to emit_event to exclude the state change from history. (Iā€™ve pointed out the need for something like this previously in a separate topic)

Iā€™m open to other ideas!

Hi, @TAustin.

It is true that the official integrations like the Ring camera are using a C2C connection and ā€œsettingsā€ are not a ā€œthingā€ there but still, I donā€™t know why the VID is preventing you to show settings.
This option was a workaround, not an official solution, sorry if I wasnā€™t clear about that part before.
I will create a feature request about the ability/options to integrate camera devices using your comments. However, it can take some time to be analyzed and implemented (if it gets approved). It depends on the teamā€™s workload.
For now, thatā€™s all the information I have, sorry.

Thanks for quick reply.

@nayelyz
This really does need immediate attention, it is a major security flaw.
*Resolved

What about the videoCamera capability? What exactly does that do? Is it only for camera controls, or does it include a video display element? Iā€™ve not been able to get it to work, presumably because I donā€™t know what it requires to initialize. Is there any documentation or examples for the attribute called ā€œsettingsā€?

Name        Description                           Type

settings    The current state of the settings     object