How to record live video and audio and save in a file?

How the flash player build a record button and the live video and audio be recorded on remote server when click it?

Wowza has a working example that includes source code. If you have Wowza Pro 10 installed on your computer look here:

[wowza-install-dir]/examples/VideoRecording/client/videorecording.fla

Richard

You can append the date to the filename you are publishing in AS3 code.

What is the file extension of the recorded file?

The file extension is .flv by default. But if you are publishing h.264/AAC video/audio, you can record to mp4 content by adding mp4: prefix to the name of the stream: “mp4:” + nameStr.txt

What are the difference of append and record?

Append adds new video to the same file. Record starts a new file with that stream name, and changes the name of the previously recording of the same name, adding a versioning suffix: myStream_0.flv

Can they be control in java extended module?

You can override Publish in a Wowza module, like this:

https://www.wowza.com/forums/showthread.php?t=6311#7

You could add the date to the stream name in the publish method instead of in the client AS3 code.

If I do not need the AppendCheckbox, how should I pass the parameter?

Whatever method you want to use. The default is “record” so you don’t have to include any parameter unless you want to append.

How to monitor the record file size? Can I set a limit?

Here is a way to check file size. You could use this in a client to set a size limit:

package com.wowza.wms.example;

import com.wowza.wms.amf.AMFDataList;
import com.wowza.wms.client.IClient;
import com.wowza.wms.module.*;
import com.wowza.wms.request.RequestFunction;
import com.wowza.wms.stream.IMediaStream;

public class CheckRecordingSize extends ModuleBase {

	public void checkFile(IClient client, RequestFunction function, AMFDataList params) 
	{
		try
		{
			String streamname = params.getString(PARAM1);
			IMediaStream stream = client.getAppInstance().getStreams().getStream(streamname);
			
			if (stream==null)
				return;
			
			sendResult(client, params, stream.getStreamFileForRead().length());				
		}
		catch (Exception e)
		{		
		}
	}
}

client side as3 is something like this:

// run this in a timer handler
netconnection.call("checkFile", new Responder(checkFileResponse), "myStream");

private function checkFileResponse(ret:Number):void
{
	trace(ret);
	// set limit here. 
	if (ret > limit)
		stopPublishing();
}

Richard

In this example, the limit is set on the client but the actual size of the video is being checked on the server. The AS3 function is getting the size from the server.

Richard

There is a code in AS3:

nsPublish.publish(nameStr.text, (AppendCheckbox.selected?“append”:“record”));

Q.1 How can the video be recorded in rtmp server with “streamname”+“Datetime” as file name (for each time of recording)?

Q.2 What is the file extension of the recorded file?

Q.3 Can they be control in java extended module?

Q.4 If I do not need the AppendCheckbox, how should I pass the parameter?

Q.5 What are the difference of append and record?

Q.6 How to monitor the record file size? Can I set a limit?

In your limit size logic, it sets in the AS3.

Here is my case:

Each registered user has allowed 1GB size of disk space for him to record video.

Can I check his remaining disk space on server side? because if it is done in client side, it cannot check his remaining disk space on server.

How should I write the java code to check it?

The structure of the user store video path is D:/video/username on windows OS.