Results 1 to 7 of 7

Thread: REST Api smil example ?

  1. #1

    Default REST Api smil example ?

    Hello,

    I'm trying to create smil file with the REST API (wowza 4.2).
    I follow the instruction here : http://www.wowza.com/forums/content....owza-REST-APIs
    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
    Last edited by numsnums2; 06-22-2015 at 05:46 AM.

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    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

  3. #3

    Default

    Hello,

    Thanks Matt !
    Your example is working for me.
    It seems that systemBitrate is a mandatory field

  4. #4
    Join Date
    Sep 2013
    Posts
    11

    Default

    Hello

    curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_de...les/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?

  5. #5
    Join Date
    May 2013
    Posts
    680

    Default

    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

  6. #6
    Join Date
    Nov 2015
    Posts
    9

    Default

    Hello,

    Can you check this?
    https://www.wowza.com/forums/showthr...DK-on-wowza-io

    There is a good/working example there using PHP.

    Cheers

  7. #7
    Join Date
    May 2011
    Posts
    456

    Default

    Hello Carlos,
    I saw your other post and replied there. I'll also reach out directly.

    -Lisa

Similar Threads

  1. Rest api >> wowza 4
    By angelfilm in forum Wowza Streaming Server Java API
    Replies: 4
    Last Post: 07-24-2014, 11:26 AM
  2. Wowza Streaming Engine Manager & REst API
    By gary4gar in forum Wowza Streaming Engine REST API
    Replies: 3
    Last Post: 03-05-2014, 02:52 PM
  3. REST API for interrogating settings like transcoder formats/endpoints
    By piers7 in forum Server Administration Discussion
    Replies: 2
    Last Post: 08-16-2012, 06:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •