Wowza Community

Recording Wowza with URL Queries from Postman or Java


I am currently doing a simple service application that is making live broadcas of wowza apps, for me it is so clear that how to make streaming lively with wowza and i’ve reached that goal.

Currently, my expectations is to use also start recording in cases using url queries of wowza media engine, but somehow my implementations are always getting “401 unauthorized”. Trying to making it via browser always works with correct credentials, but Postman or java always get response as 401.


Above url, is easliy reachable from Chrome, but when i try to use Postman, i can’t get any result. I don’t know how i can start and stop recording by usage of below queries if i can’t manage to reach wowza media engine :



I am using retrofit2 on my android application and here is the code that i am using it :


public class WowzaInterfaceUtils {
    public static final String BASE_URL = "http://username:password@ipadress:8086/";
    public static WowzaInterfaceController getWowzaInterfaceController(){
        return WowzaInterfaceClient.getClient(BASE_URL).create(WowzaInterfaceController.class);



public class WowzaInterfaceClient {private static Retrofit retrofit = null;

    public static Retrofit getClient(String baseUrl) {
        if (retrofit==null) {
            OkHttpClient.Builder client = new OkHttpClient.Builder();
            OkHttpClient httpClient =;
            retrofit = new Retrofit.Builder()
        return retrofit;


Call<ResponseBody> livestreamrecord(@Query("app") String app, @Query("streamname") String streamName,
                                    @Query("action") String action, @Query("outputFile") String outputFile);

//On Retrofit call

public void startCameraRecording(String app, String streamName,String outputFile){
    wowzaInterfaceController = WowzaInterfaceUtils.getWowzaInterfaceController();
    Log.i("YTA_CameraRecording","Camera recording will be started");

    wowzaInterfaceController.livestreamrecord(app,streamName,"startRecording",outputFile).enqueue(new Callback<ResponseBody>() {
        public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
                Log.i("YTA_CameraRecording", "Start camera responded : " + response.code());

        public void onFailure(Call<ResponseBody> call, Throwable t) {
            Log.e("YTA_CameraRecording", "Start camera failed");

The 401 error you are getting is caused by not providing a username or password. Additional information on enabling and disabling authentication can be found in the article below.

Authentication would look like this.

curl --digest -u "username:password" http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/incomingstreams/myStream

Below is an example of creating a recorder by using our REST API that will:

1) Record the myStream live stream that is under the default live application to the default content folder.

2) Give the recording the Base name of the live feed and specify that segment numbers should be used.

3) Specifying the file template can be done only through the API. This value is never saved in Application.xml.

4) Configure the segment duration to be 15 minutes (900,000 milliseconds)

Note that API authentication is disabled in this example.

curl -X POST --header 'Accept:application/json; charset=utf-8' --header 
'Content-type:application/json; charset=utf-8' 
 -d '
"recorderState":"Waiting for stream",
"segmentSchedule":"0 * * * * *",
"option":"Version existing file",

Wowza Streaming Engine will, by default, save all recordings in the default content location.

You can specify an alternate location for the content to be saved to by adding the “outputPath” option as shown in the article below:

Please note that Wowza Streaming Engine needs write access to the location you specify. Please adjust user and/or service permissions accordingly.

There is no way to specify recording time limits either inside or outside of the API. If you need an exact 15 minute recording and no segments created outside of that one 15 minute segment then you will need to stop the recorder manually, create a script for automation, or delete any additional or unwanted segments once the recording has stopped.

The recording can be stopped via our REST API as follows:

curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 
'Content-type:application/json; charset=utf-8' 

I suggest that if you are unfamiliar with Wowza Streaming Engine’s REST API that you use our Swagger documentation. More information on how to enable both the REST API and the documentation can be found in the following article:

The download link is buried in the article above. You can download the documentation here:

Yes this is working through your browser as you already have authenticated and already have a cookie. Try it in incognito mode or clear your cookies and you won’t see it.

Basically you’ll have to acquire an authentication cookie and then try again, sending this cookie in the request.

I am running the curl command via bash. There is no cookie involved. I can also run it via Cygwin and there is still no cookie involved. Curl works on servers that have no web browsers installed.