REST Api smil example ?

Hello,

I’m trying to create smil file with the REST API (wowza 4.2).

I follow the instruction here : https://www.wowza.com/docs/how-to-use-curl-to-query-wowza-rest-api

and I managed to create a new application without problem.

But I can’t create a smil file with this call :

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

{
    "restURI": "http://XX.XX.XX.XX:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/cdn/smilfiles/myfile",
    "serverName": "",
    "smilStreams": [
        {
            "systemLanguage": "en",
            "dur": "",
            "ngrp": "",
            "keyFrameOnly": "",
            "src": "myfile_750.mp4",
            "systemBitrate": "",
            "serverName": "",
            "videoCodecId": "",
            "type": "video",
            "version": "",
            "audioBitrate": "44100",
            "audioCodecId": "",
            "videoBitrate": "750000",
            "restURI": "",
            "isWowzaCaptionStream": "",
            "videoOnly": "",
            "audioOnly": "",
            "width": "640",
            "saveFieldList": [],
            "idx": 0,
            "begin": "",
            "wowzaCaptionIngestType": "",
            "height": "360"
        },
        {
            "systemLanguage": "en",
            "dur": "",
            "ngrp": "",
            "keyFrameOnly": "",
            "src": "myfile_1100.mp4",
            "systemBitrate": "",
            "serverName": "",
            "videoCodecId": "",
            "type": "video",
            "version": "",
            "audioBitrate": "44100",
            "audioCodecId": "",
            "videoBitrate": "1100000",
            "restURI": "",
            "isWowzaCaptionStream": "",
            "videoOnly": "",
            "audioOnly": "",
            "width": "1272",
            "saveFieldList": [],
            "idx": 1,
            "begin": "",
            "wowzaCaptionIngestType": "",
            "height": "720"
        }
    ],
    "saveFieldList": [],
    "title": "myfile",
    "version": "1434975987"
}

I have this result

{"success":false,"message":null,"data":null}

Can you provide a working example of this call please ?

Thanks

Hello

You’ll want to ensure you define the restURI and be case sensative. Here was a quick test that was successful for me (testing against 4.2.0)

curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil -d'
{
   "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil",
   "smilStreams": [
         {
            "systemLanguage": "en",
            "src": "myfile_750.mp4",
            "systemBitrate": "50000",
            "type": "video",
            "audioBitrate": "44100",
            "videoBitrate": "750000",
            "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil",
            "width": "640",
            "height": "360"
        },
        {
            "systemLanguage": "en",
            "src": "myfile_1100.mp4",
            "systemBitrate": "50000",
            "type": "video",
            "audioBitrate": "44100",
            "videoBitrate": "1100000",
            "restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mytestsmil",
            "width": "640",
            "height": "360"
        }
        ]
}'

Thanks,

Matt

Hello,

Thanks Matt !

Your example is working for me.

It seems that systemBitrate is a mandatory field

Hello Carlos,

I saw your other post and replied there. I’ll also reach out directly.

-Lisa

What version of Wowza are you using? Ensure you are on the latest and that the smil file doesn’t already exist. Restart Wowza and try again. If the problem remains, please zip up your conf/ and logs/ and include your curl command and result in a ticket submitted here.

Thanks,

Matt

Hello

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

{

“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/smilfiles/mytestsmil”,

“smilStreams”: [

{

“systemLanguage”: “en”,

“src”: “myfile_750.mp4”,

“systemBitrate”: “50000”,

“type”: “video”,

“audioBitrate”: “44100”,

“videoBitrate”: “750000”,

“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/smilfiles/mytestsmil”,

“width”: “640”,

“height”: “360”

},

{

“systemLanguage”: “en”,

“src”: “myfile_1100.mp4”,

“systemBitrate”: “50000”,

“type”: “video”,

“audioBitrate”: “44100”,

“videoBitrate”: “1100000”,

“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/smilfiles/mytestsmil”,

“width”: “640”,

“height”: “360”

}

]

}’

output:

{“success”:false,“message”:“null/mytestsmil.smil (No such file or directory)”,“data”:null}

path error.How can I solve this problem?

Hello,

Can you check this?

There is a good/working example there using PHP.

Cheers