• SMIL files query examples for the Wowza Streaming Engine REST API

    Wowza Streaming Engine™ media server software has a REST Application Programming Interfaces (API) that can be used to configure, manage, and monitor the media server through HTTP requests. This article demonstrates ways to list, create, and remove Synchronized Multimedia Integration Language (SMIL) file configurations in a Wowza Streaming Engine instance using some basic cURL examples to query the Wowza Streaming Engine REST service. For a complete breakdown and documentation of the API, see How to access documentation for the Wowza Streaming Engine REST API.

    Notes:
    • Wowza Streaming Engine 4.3.0 or later is required. You must also have working knowledge of cURL and REST-related services.

    • This article uses the live application that installs with Wowza Streaming Engine software. If you want to use a different application, replace live with the application's name in the examples below.

    Contents


    Get a list of SMIL files
    Create a SMIL file
    Remove a SMIL file

    Get a list of SMIL files


    The following example shows how to get a list of all configured SMIL files associated with a given application.
    curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles

    Create a SMIL file


    The following example shows how to create a SMIL file associated with an application:
    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"
            }
            ]
    }'

    Remove a SMIL file


    When you're done with a SMIL file, you can delete it with the following request:
    curl -X DELETE --header 'Accept: application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/smilfiles/mysmilfile

    Originally Published:06-16-2015.
    Updated: For Wowza Streaming Engine 4.3.0 on 10-06-2015.

    If you're having problems or want to discuss this article, post in our forum.