Wowza Community

SMIL FILE GENERATE WITH REST API

I am trying to create a smil file with REST API.
this is my CURL request:

curl -X POST -H ‘Accept:application/json; charset=utf-8’ -H ‘Content-Type:application/json; charset=utf-8’ --digest --user ‘:http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/instances/smilfiles/mytestsmil -d

{
“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/smilfiles/mytestsmil”,
“title” => “apiTest”,
“smilStreams”: [
{
“systemLanguage”: “en”,
“src”: “myStream_160.mp4”,
“systemBitrate”: “50000”,
“type”: “video”,
“audioBitrate”: “44100”,
“videoBitrate”: “64000”,
“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/smilfiles/mytestsmil”,
“width”: “640”,
“height”: “480”
},{
“systemLanguage”: “en”,
“src”: “myStream_360.mp4”,
“systemBitrate”: “50000”,
“type”: “video”,
“audioBitrate”: “44100”,
“videoBitrate”: “850000”,
“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/smilfiles/mytestsmil”,
“width”: “640”,
“height”: “360”
}, {
“systemLanguage”: “en”,
“src”: “myStream_160.mp4”,
“systemBitrate”: “50000”,
“type”: “video”,
“audioBitrate”: “44100”,
“videoBitrate”: “200000”,
“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/smilfiles/mytestsmil”,
“width”: “284”,
“height”: “160”
}]
}’

RESPONSE:

{“success”:false,“wowzaServer”:“4.7.8”,“message”:“The server has not found anything matching the request URI”,“code”:“404”}

let me know for any clue,

Thanks

If you are creating the smilfile, the URI should not include the name. Supply the smilfile name in the body as part of the SMILFileAppConfig.

/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/smilfiles

Thanks Amara,

I was following this tutorial to create smil file "

https://www.wowza.com/docs/smil-files-query-examples" may be its outdated.

Can you share with me detailed request data example to generate smil file ? As i am unable to locate.

My mistake. I was looking at the wrong call in the API reference. Your URI appears to be correct. I’ll have to take a closer look at this.

Here are steps to get the API reference running - https://www.wowza.com/docs/how-to-access-documentation-for-wowza-streaming-engine-rest-api

Quick update here. I was able to run the request from the API reference and I was also able to run the example from the link you referenced in a simple bash script, both successfully. When I run your code, I do see the same error. Going to dig in and see what is different with your code.

Your URI is incorrect,

http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/smilfiles/mytestsmil

should be (remove instances)

http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil

Remove this line, = is unexpected in JSON

"title" => "apiTest",