Wowza Community

PHP and Wowza to start recording a live stream

To any one that can help.

I am trying from a php script to to launch a url that will start recording on a specific stream i know that the url works because i can try it out side the code and it works.

I have been using fopen() to open the url.

Is there something else that works? All it does know is it times out.

Alin

Alin,

In PHP I think it is the load(url) command.

Richard

Try using “admin-basic” authentication, then you can add in url:

http://richard:myPwd@[wowza-address]:1935/[httpFilter]

Add username and password to /conf/admin.password

Richard

You put the username and password in-line, like this:

curl_setopt($ch, CURLOPT_URL, "http://richard:myPwd@ip:8086/livestreamrecord?app=live&streamname=myStream_160p &outputFile=04_05_2013M_160p.mp4&startonkeyframe=t rue&action=startRecording");

Richard

Alin,

In PHP I think it is the load(url) command.

Richard

I tried it with the load

meaning this command

http://php.net/manual/en/domdocument.load.php

same error. I also have authentication enabled on the links.

Alin

Try using “admin-basic” authentication, then you can add in url:

http://richard:myPwd@[wowza-address]:1935/[httpFilter]

Add username and password to /conf/admin.password

Richard

Richard thank you for your help. But i still can not get it to work.

The link works fine when i paste it in a browser and hit enter, with the “admin-basic” authenication, but when i try to send it from a php script it times out.

I saw that your using port 1935 is that what you recommended?

Alin

So, I have been doing more research and i still have not been able to figure this out.

Can i use curl to do this?

here is an example of my code

$ch=curl_init();

curl_setopt($ch, CURLOPT_URL, “http://ip:8086/livestreamrecord?app=live&streamname=myStream_160p&outputFile=04_05_2013M_160p.mp4&startonkeyframe=true&action=startRecording”);

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

curl_setopt($ch, CURLOPT_USERPWD, “Username:Password”);

curl_exec($ch);

curl_close($ch);

Please help

Alin