{"_id":"59a6f06ba675c0000fbaa4a9","project":"5669937dfc5abf2300afe7de","version":{"_id":"59796d1140a3a2001f068cb4","project":"5669937dfc5abf2300afe7de","__v":2,"createdAt":"2017-07-27T04:33:21.278Z","releaseDate":"2017-07-27T04:33:21.278Z","categories":["59796d1140a3a2001f068cb5","59796d1140a3a2001f068cb6","59796d1140a3a2001f068cb7","59796d1140a3a2001f068cb8","5acb7bc606a2ce0003f28da4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"59796d1140a3a2001f068cb6","version":"59796d1140a3a2001f068cb4","project":"5669937dfc5abf2300afe7de","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-12-23T15:52:27.836Z","from_sync":false,"order":1,"slug":"foo","title":"Core"},"user":"599b4786eac604000fedaf43","githubsync":"","__v":1,"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-08-30T17:05:47.092Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"name":"","code":"{\n  \"status\": \"READY\",\n  \"containers\": {\n    \"href\": \"https://api.safestream.com/player/1.0/?href=https%3A%2F%2Fsafestream-api.shiftplatform.io%2F1.0%2Fwatermark%2F1741b0ce-71d7-439e-a52b-f1dc61ee7f0c%2F42d9f235443bdea89139a3243594389abe5f9b46%3Fcontainers%3Dmp4%26containers%3Dm3u8%26expiration%3D1478877353611%26signature%3DaRO9RIF1uuhXiss3lKMxIrUqCjI%253D\",\n    \"m3u8\": \"https://api.safestream.com/1.0/watermark/1741b0ce-71d7-439e-a52b-f1dc61ee7f0c/42d9f235443bdea89139a3243594389abe5f9b46/video.m3u8?x=y&expiration=1478877353611&signature=Wgbr4AKZFCzo877Nz78Jf84TCFo%3D\"\n  },\n  \"href\": \"https://api.safestream.com/1.0/watermark/1741b0ce-71d7-439e-a52b-f1dc61ee7f0c/42d9f235443bdea89139a3243594389abe5f9b46?containers=mp4&containers=m3u8&expiration=1478877353611&signature=aRO9RIF1uuhXiss3lKMxIrUqCjI%3D\"\n}","language":"json","status":200},{"name":"","code":"{ message: [Array of error messages] }","language":"json","status":400},{"code":"{\n  \"message\": \"Access Denied\"\n}","language":"json","status":401},{"language":"json","status":403,"code":"{\n  \"message\": \"Access Denied\"\n}"}]},"method":"post","examples":{"codes":[{"code":"curl -X \"POST\" \"https://s2-api.safestream.com/2.0/watermark\" \\\n     -H \"Content-Type: application/json\" \\\n     -H \"x-api-key: [[app:apiKey]]\" \\\n     -H \"x-api-client-id: [[app:apiClientId]]\" \\\n     -d $'{\n  \"videoId\": \"831623c0-72ff-4a91-aa6b-323d7ef2ab9a\",\n  \"settings\": [\n     {\n      \"content\": \"Any publically accessible image url\",\n      \"type\": \"IMAGE\",\n      \"x\":0.2,\n      \"y\":0.2,\n      \"align\": \"LEFT\",\n      \"verticalAlign\": \"middle\",\n      }\n  ],\n  \"viewLimit\" : 5,\n  \"expiration\" : 1523640477\n}'\n","language":"curl"}]},"auth":"required","params":[{"_id":"568a7b50bf86800d00fe310c","ref":"","in":"body","required":false,"desc":"Optional: The key of the video that you'd like to watermark.","default":"","type":"string","name":"key"},{"_id":"568a7bd18360c00d00a0e72b","ref":"","in":"body","required":false,"desc":"Optional: Use the ID SafeStream assigned to this asset during ingest","default":"","type":"string","name":"videoId"},{"_id":"568a7c40d4e2360d0098002b","ref":"","in":"body","required":false,"desc":"An array of watermark settings to be applied to the video that should be watermarked. See below for details on the watermark setting properties.","default":"{\"content\": \"Joe Smith\",                 \"type\": \"IMAGE\",                \"align\":\"center\",                 \"verticalAlign\":\"middle\"             }","type":"array_object","name":"settings"},{"_id":"58248f95d90fa027009b2597","ref":"","in":"body","required":false,"desc":"Defaults to m3u8 for HLS playback but also supports MP4 to specifically request a watermarked mp4 video for download.","default":"[\"m3u8\",\"mp4\"]","type":"array_string","name":"containers"},{"_id":"582494658d0ac71b00780e89","ref":"","in":"body","required":false,"desc":"A mapping object that references an existing watermark template and maps values to placeholders.","default":"\"settingsTemplateMapping\": {         \"id\": \"74fc00c8-847d-4631-94a4-f4ac7d1e4748\",         \"mappings\": {             \"name\": \"User Name\"         }     }","type":"object","name":"settingsTemplateMapping"},{"_id":"5ad0e908f672e80003ad5c11","ref":"","in":"body","required":false,"desc":"determines the number of times the watermarked file can be requested. After the limit is reached, the watermarked file will no longer be available.","default":"null","type":"int","name":"viewLimit"},{"_id":"5ad0e908f672e80003ad5c10","ref":"","in":"body","required":false,"desc":"determines the exact epoch time in SECONDS that the watermark file will no longer be accessible.","default":"null","type":"long","name":"expiration"}],"url":"/watermark"},"isReference":true,"order":4,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Watermarking Overview\"\n}\n[/block]\nOnce a video has been [ingested](doc:video), you can request a watermark for the video using this endpoint. At it's simplest you just need the ID or KEY of the video and the text that you'd like you have as your watermark. SafeStream will locate the video that you've already ingested and it will apply the watermark to the file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"key\\\": \\\"my-internal-id\\\",\\n    \\\"settings\\\": [\\n           {\\n        \\\"content\\\": \\\"https://s3-us-west-1.amazonaws.com/watermark-api/stormtrooper.jpg\\\",\\n      \\\"type\\\": \\\"IMAGE\\\",\\n      \\\"x\\\":0.2,\\n      \\\"y\\\":0.2,\\n      \\\"align\\\": \\\"LEFT\\\",\\n      \\\"verticalAlign\\\": \\\"middle\\\",\\n      }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"Add a visual or forensic watermark to you video","slug":"watermark-a-video-with-an-image","type":"endpoint","title":"Watermark a Video with an Image"}

postWatermark a Video with an Image

Add a visual or forensic watermark to you video

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

key:
string
Optional: The key of the video that you'd like to watermark.
videoId:
string
Optional: Use the ID SafeStream assigned to this asset during ingest
settings:
array of objects{"content": "Joe Smith", "type": "IMAGE", "align":"center", "verticalAlign":"middle" }
An array of watermark settings to be applied to the video that should be watermarked. See below for details on the watermark setting properties.
containers:
array of strings["m3u8","mp4"]
Defaults to m3u8 for HLS playback but also supports MP4 to specifically request a watermarked mp4 video for download.
settingsTemplateMapping:
object"settingsTemplateMapping": { "id": "74fc00c8-847d-4631-94a4-f4ac7d1e4748", "mappings": { "name": "User Name" } }
A mapping object that references an existing watermark template and maps values to placeholders.
viewLimit:
integernull
determines the number of times the watermarked file can be requested. After the limit is reached, the watermarked file will no longer be available.
expiration:
longnull
determines the exact epoch time in SECONDS that the watermark file will no longer be accessible.

Examples


Result Format


Documentation

[block:api-header] { "type": "basic", "title": "Watermarking Overview" } [/block] Once a video has been [ingested](doc:video), you can request a watermark for the video using this endpoint. At it's simplest you just need the ID or KEY of the video and the text that you'd like you have as your watermark. SafeStream will locate the video that you've already ingested and it will apply the watermark to the file. [block:code] { "codes": [ { "code": "{\n \"key\": \"my-internal-id\",\n \"settings\": [\n {\n \"content\": \"https://s3-us-west-1.amazonaws.com/watermark-api/stormtrooper.jpg\",\n \"type\": \"IMAGE\",\n \"x\":0.2,\n \"y\":0.2,\n \"align\": \"LEFT\",\n \"verticalAlign\": \"middle\",\n }\n ]\n}", "language": "json" } ] } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}