I am generating an RSTP stream using a webcam using the following command.
cvlc v4l2:///dev/video0 --sout="#transcode{vcodec=h264}:rtp{mux=ts,sdp=rtsp://0.0.0.0:8080/cam.sdp}"
I have setup IOTEdge on Jetson Nano and running lvaEdge. I am following the example in the link.
https://learn.microsoft.com/en-us/azure/media-services/live-video-analytics-edge/detect-motion-record-video-clips-media-services-quickstart
I created the following Media Graph
{
"@apiVersion": "2.0",
"name": "EVRtoAssetsOnMotionDetection",
"properties": {
"description": "Event-based video recording to Assets based on motion events",
"parameters": [
{
"name": "rtspUserName",
"type": "String",
"description": "rtsp source user name.",
"default": "dummyUserName"
},
{
"name": "rtspPassword",
"type": "String",
"description": "rtsp source password.",
"default" : "dummyPassword"
},
{
"name": "rtspUrl",
"type": "String",
"description": "rtsp Url"
},
{
"name": "motionSensitivity",
"type": "String",
"description": "motion detection sensitivity",
"default" : "medium"
},
{
"name": "hubSinkOutputName",
"type": "String",
"description": "hub sink output name",
"default" : "iothubsinkoutput"
}
],
"sources": [
{
"@type": "#Microsoft.Media.MediaGraphRtspSource",
"name": "rtspSource",
"endpoint": {
"@type": "#Microsoft.Media.MediaGraphUnsecuredEndpoint",
"url": "${rtspUrl}",
"credentials": {
"@type": "#Microsoft.Media.MediaGraphUsernamePasswordCredentials",
"username": "${rtspUserName}",
"password": "${rtspPassword}"
}
}
}
],
"processors": [
{
"@type": "#Microsoft.Media.MediaGraphMotionDetectionProcessor",
"name": "motionDetection",
"sensitivity": "${motionSensitivity}",
"inputs": [
{
"nodeName": "rtspSource"
}
]
},
{
"@type": "#Microsoft.Media.MediaGraphSignalGateProcessor",
"name": "signalGateProcessor",
"inputs": [
{
"nodeName": "motionDetection"
},
{
"nodeName": "rtspSource"
}
],
"activationEvaluationWindow": "PT1S",
"activationSignalOffset": "PT0S",
"minimumActivationTime": "PT30S",
"maximumActivationTime": "PT30S"
}
],
"sinks": [
{
"@type": "#Microsoft.Media.MediaGraphAssetSink",
"name": "assetSink",
"assetNamePattern": "sampleAssetFromEVR-LVAEdge-${System.DateTime}",
"segmentLength": "PT0M30S",
"localMediaCacheMaximumSizeMiB": "2048",
"localMediaCachePath": "/var/lib/azuremediaservices/tmp/",
"inputs": [
{
"nodeName": "signalGateProcessor"
}
]
},
{
"@type": "#Microsoft.Media.MediaGraphIoTHubMessageSink",
"name": "hubSink",
"hubOutputName": "${hubSinkOutputName}",
"inputs": [
{
"nodeName": "motionDetection"
}
]
}
]
}
}
and running an instance using the following.
{
"@apiVersion" : "2.0",
"name" : "Sample-Graph-2",
"properties" : {
"topologyName" : "EVRtoAssetsOnMotionDetection",
"description" : "Sample graph description",
"parameters" : [
{ "name" : "rtspUrl", "value" : "rtsp://IP:8080/cam.sdp" }
]
}
}
I keep getting this error
{
"body": {
"code": "459",
"target": "rtsp://IP:8080/cam.sdp",
"protocol": "rtsp"
},
"properties": {
"topic": "/subscriptions/subscription-id/resourceGroups/IOT_Product/providers/microsoft.media/mediaservices/vmedia",
"subject": "/graphInstances/Sample-Graph-2/sources/rtspSource",
"eventType": "Microsoft.Media.Graph.Diagnostics.ProtocolError",
"eventTime": "2021-02-01T23:59:42.887Z",
"dataVersion": "1.0"
},
"systemProperties": {
"iothub-connection-device-id": "Nano1",
"iothub-connection-module-id": "lvaEdge",
"iothub-connection-auth-method": "{\"scope\":\"module\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
"iothub-connection-auth-generation-id": "auth id",
"iothub-enqueuedtime": 1612223982902,
"iothub-message-source": "Telemetry",
"messageId": "msg id",
"contentType": "application/json",
"contentEncoding": "utf-8"
}
}
The stream displays fine in VLC. I am unable to debug the issue.