This page shows you how to create and manage Live Stream API input endpoints. You send input video streams to these endpoints.
Set up your Google Cloud project and authentication
If you have not created a Google Cloud project and credentials, see Before you begin.Create an input endpoint
To create an input endpoint, use the
projects.locations.inputs.create
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location in which to create the input endpoint; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: a user-defined identifier for the new input endpoint to create (to which you send your input stream). This value must be 1-63 characters, begin and end withINPUT_ID [a-z0-9]
, and can contain dashes (-) between characters. For example,my-input
.
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
cat > request.json << 'EOF' { "type": "RTMP_PUSH" } EOF
Then execute the following command to send your REST request:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs?inputId=INPUT_ID "
PowerShell (Windows)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
@' { "type": "RTMP_PUSH" } '@ | Out-File -FilePath request.json -Encoding utf8
Then execute the following command to send your REST request:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs?inputId=INPUT_ID " | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Get input endpoint details
To get the details of the input endpoint, use the
projects.locations.inputs.get
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your input endpoint is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: the user-defined identifier for the input endpointINPUT_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ", "createTime":CREATE_TIME , "updateTime":UPDATE_TIME , "type": "RTMP_PUSH", "uri": "INPUT_STREAM_URI ", # For example, "rtmp://1.2.3.4/live/b8ebdd94-c8d9-4d88-a16e-b963c43a953b", "tier": "HD" }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Update an input endpoint
To update an input endpoint, use the
projects.locations.inputs.patch
method.
The following example updates the video cropping fields. Not all fields can be updated; see the list of supported fields.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location in which to create the input endpoint; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: the user-defined identifier for the input endpointINPUT_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
cat > request.json << 'EOF' { "preprocessingConfig": { "crop": { "topPixels": 10, "bottomPixels": 10, "leftPixels": 5, "rightPixels": 5 } } } EOF
Then execute the following command to send your REST request:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ?updateMask=preprocessingConfig"
PowerShell (Windows)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
@' { "preprocessingConfig": { "crop": { "topPixels": 10, "bottomPixels": 10, "leftPixels": 5, "rightPixels": 5 } } } '@ | Out-File -FilePath request.json -Encoding utf8
Then execute the following command to send your REST request:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ?updateMask=preprocessingConfig" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ", "verb": "update", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
List input endpoints
To list all of the input endpoints you created in a location, use the
projects.locations.inputs.list
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your input endpoint is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs"
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "inputs": [ { "name": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/my-input ", "createTime":CREATE_TIME , "updateTime":UPDATE_TIME , "type": "RTMP_PUSH", "uri":INPUT_STREAM_URI , # For example, "rtmp://1.2.3.4/live/b8ebdd94-c8d9-4d88-a16e-b963c43a953b", "tier": "HD" }, { "name": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/my-input2 ", "createTime":CREATE_TIME , "updateTime":UPDATE_TIME , "type": "RTMP_PUSH", "uri":INPUT_STREAM_URI , # For example, "rtmp://1.2.3.4/live/b8ebdd94-c8d9-4d88-a16e-b963c43a953b", "tier": "HD" } ] }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Delete an input endpoint
To delete an input endpoint, use the
projects.locations.inputs.delete
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your input endpoint is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: the user-defined identifier for the input endpointINPUT_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID "
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID ", "verb": "delete", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
What's next
Learn how to create and manage channels that use the input endpoint.