Skip to main content

Stream profiles

This guide shows you how to create, use, and remove stream profiles. A stream profile is a named set of streaming parameters that you can reference by name in stream requests. For background, see What is stream sharing.

Prerequisites

You need:

  • An Axis camera: <ip> to replace in commands
  • Camera user credentials with operator or administrator privileges: <user> and <pass> to replace in commands
  • ffplay and curl

How to create a stream profile

Create a stream profile called Example with resolution 480x360 and 5 FPS:

curl -s -d "{\"apiVersion\": \"1.0\", \"method\": \"create\", \"params\": {\"streamProfile\":[{\"name\": \"Example\", \"description\": \"An Example\", \"parameters\": \"resolution=480x360&fps=5\"}]}}" --anyauth -u '<user>:<pass>' "http://<ip>/axis-cgi/streamprofile.cgi"

On success, it returns {"method": "create", "apiVersion": "1.0", "data": {}}.

How to list stream profiles

curl -s -d "{\"apiVersion\": \"1.0\", \"method\": \"list\", \"params\": {\"streamProfileName\": []}}" --anyauth -u '<user>:<pass>' "http://<ip>/axis-cgi/streamprofile.cgi"

Example output:

{
"method": "list",
"apiVersion": "1.0",
"data": {
"streamProfile": [
{
"name": "Example",
"description": "An Example",
"parameters": "resolution=480x360&fps=5"
}
],
"maxProfiles": 26
}
}

How to use a stream profile

Specify the profile name with the streamprofile URL parameter:

ffplay -rtsp_transport http "rtsp://<user>:<pass>@<ip>/axis-media/media.amp?camera=1&streamprofile=Example"

You can override individual parameters from the profile by appending them after the profile name. The last value wins:

ffplay -rtsp_transport http "rtsp://<user>:<pass>@<ip>/axis-media/media.amp?camera=1&streamprofile=Example&resolution=1920x1080"

How to remove a stream profile

curl -s -d "{\"apiVersion\": \"1.0\", \"method\": \"remove\", \"params\": {\"streamProfileName\": [{\"name\": \"Example\"}]}}" --anyauth -u '<user>:<pass>' "http://<ip>/axis-cgi/streamprofile.cgi"

On success, it returns {"method": "remove", "apiVersion": "1.0", "data": {}}.

See also