Results 1 to 7 of 7

Thread: LiveStreamRecord HTTP Success/Fail?

  1. #1
    Join Date
    May 2014
    Posts
    5

    Cool LiveStreamRecord HTTP Success/Fail?

    I'm using the HTTP livestreamrecord functionality via php curl. I'm wondering - is there a way to determine whether the recording successfully started or stopped via my command?

    My code works, but I get no response that it succeeded, nor do I get anything returned if it fails. Is there any way to gain this response?

  2. #2
    Join Date
    May 2014
    Posts
    5

    Default

    Note - using the URL query method. I'm simply looking for a way to see which streams are currently being recorded and which are not. Thanks!

  3. #3
    Join Date
    May 2013
    Posts
    680

    Default

    >> As a simple example to initiate a live stream record via php, you could try something like this to build off of:
    $url = "http://[wowza-ip]:8086/livestreamrecord?app=live&streamname=test&action=startRecording";
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); 
    curl_setopt($ch, CURLOPT_USERPWD, "[user]:[pass]");
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
    $contents = curl_exec($ch);
    $status = curl_getinfo($ch,CURLINFO_HTTP_CODE);
    curl_close($ch);
    //var_dump($contents);
    if(intval($status)==200){
       echo "Success";
    }
    else{
       echo "Failed";
    }
    Note: The 200 response only indicates a successful connection and not that the recording started successfully.

    >> As a simple example to obtain a list, you can utilize the record manager as follows :
    Map<String, IStreamRecorder> recordingMap = vhost.getLiveStreamRecordManager().getRecordersMap(appInstance);
    
    Set<String> recorders = recordingMap.keySet();
    for(String key : recorders){
    	IStreamRecorder recorder = recordingMap.get(key);
    	String thisAppInstanceName = recorder.getAppInstance().getName();
    	String thisAppName = recorder.getAppInstance().getApplication().getName();
    	WMSLoggerFactory.getLogger(getClass()).info(">> Recording in progress: "+thisAppName+"/"+thisAppInstanceName+"/"+key);
    }
    You can put this snippet into an http provider and have your php script query it for list of recordings.
    Last edited by matt_y; 09-02-2014 at 01:24 AM.

  4. #4
    Join Date
    May 2014
    Posts
    5

    Default

    Matt - you are awesome. Thank you!

    Can you point me to your documentation on putting that snippet into an http provider? Also, what URL would I query for the list after I have that snippet loaded?

  5. #5
    Join Date
    May 2013
    Posts
    680

    Default

    You can take a look at this example HTTP Provider as a good starting point. When you set up your HTTP Provider in your VHost.xml file, you will define the filter that you would query via your external script.

    As an example under HostPort 8086:
    <HTTPProvider>
        <BaseClass>com.package.test.HTTPProviderTest</BaseClass>
        <RequestFilters>recordings*</RequestFilters>
        <AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
    In the above case, if you have a jar file with the class com.package.test.HTTPProviderTest within it, you would query the following:
    http://[your-wowza-ip]:8086/recordings
    Thanks,

    Matt

  6. #6
    Join Date
    May 2014
    Posts
    5

    Default

    Great - so just use the IDE to create the JAR file and then drop it in (wowza)/lib, correct?

  7. #7
    Join Date
    May 2013
    Posts
    680

    Default

    Hello

    Yes, that is correct.

    Thanks,
    Matt

Similar Threads

  1. c# HTTP get method for livestreamrecord
    By TGGCBen in forum General Forum
    Replies: 7
    Last Post: 08-02-2014, 05:34 AM
  2. HTTP LiveStreamRecord and fileTemplate
    By jdbell in forum General Forum
    Replies: 1
    Last Post: 02-12-2014, 07:27 AM
  3. LiveStreamRecord HTTP API 3.5
    By novazion in forum AddOn: Other AddOns
    Replies: 7
    Last Post: 12-07-2012, 02:02 PM
  4. HTTP streams fail after encoder reconnect due to network issues
    By DWBN Streaming in forum Live Streaming and Encoder Discussion
    Replies: 2
    Last Post: 08-13-2012, 07:36 AM

Posting Permissions

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