Wowza Community

How to improve webcam live video streaming quality

These are Flash actionscript commands. In the VideoRecording client and clientAS2 examples you can find them in the Actionscipt pane of the FLA file. In the clientFlex version they are in RecordingController.as file.

Richard

I thought you were referring to the camera.setQuality and camera.setMode lines. Those are Actionscript commands, not relevant to FMLE.

Richard

No, these settings are relevant to publishing with a Flash application, using NetStream.publish with the Camera object.

Richard

This is probably nothing new: First, use h.264.

Then, if internet delivery and player technologies are not factors, make the bitrate and fps and encoding parameters very high.

If internet delivery and a variety of player technologies are factors, then you have to compromise and play around with all those settings until you find something that first doesn’t buffer, because that’s worse then low resolution.

Richard

(I have noticed that when I set the bitrate higher than 500, I get a lot of phone calls about buffering?)

That’s the trade-off between resolution and user experience, as I was saying. Not buffering is more important than higher resolution.

And the advantage of h.264 is that you can get the same quality with lower bitrates. Make some recordings of equal time length, and compare size on disk and kbs.

size in kilobytes * 8 / duration in seconds = kilobits per second (kbs)

Richard

That message is about the extension of the file name in the “Save to File” box. You can uncheck that. That is saving a file to your computer, it is not what is being streamed.

The name of the file you are streaming is above that, in a box labeled “Stream:” (below the FMS URL and Backup URL).

It is okay to not use any extension. Just enter “myStream” for example. Then play that with h.264 settings. Test in SimpleVideoStreaming example player:

Server: rtmp://[wowza-address]:1935/[appName]

Stream: myStream

Richard

Whatever you put in the “Stream:” box in FMLE is exactly what you should reference in the JW Player “file” flashvar. Exactly. If you want to put an extension, you can, but it’s really not necessary. You should add Flashvar “provider=rtmp”

If you have this:

&stream=rtmp://[wowza-address]:1935/livevideo&provider=rtmp&file=BOD

Then the Stream: in FMLE should be “BOD”

Richard

For reference, take a look at the VideoRecording example that ships with Wowza, in the videorecording.fla file, at the StartCamera function:

function startCamera()
{	
	// get the default Flash camera and microphone
	camera = Camera.getCamera();
	microphone = Microphone.getMicrophone();
	// here are all the quality and performance settings
	camera.setMode(160, 120, 30, false);
	camera.setQuality(0, 88);
	camera.setKeyFrameInterval(30);
	microphone.rate = 11;
	
	nameStr.text = movieName;
	AppendCheckbox.selected = false;
	connect.connectStr.text = serverName;
	connect.connectButton.addEventListener(MouseEvent.CLICK, doConnect);
	enablePlayControls(false);
}

Richard

You don’t have to de-compile anything because there is source code in the example. The VideoRecording has a clientFlex folder with Flex (sdk 3.2) version including source.

Richard

Yes you do.

Richard

how does choosing higher resolution over bandwidth affect the end users’ performance?

I would like to improve picture quality as well currently using 3CCD SD digital cameras into a switcher, then into capture card.

what file is this setting located in?

Thanks for the reply, Richard.

I am not familiar with what you mean by:

VideoRecording client

clientAS2 examples

or clientFlex version

does the fact that I use FMLE to encode make a difference?

Is this only available in vers. 2.0?

Also, I am still using 1.7.xxx version - I do plan to upgrade, but need to find a time when I can shut off the server for a few days and not impact others.

well, I was…sort of.

I did a search of the forum about “improving quality” and this was the only posting I could see in reference to improving quality, so I am trying to understand what the original poster was doping, so that I can also apply the same settings to my streams if possible.

Currently using the JWPlayer vers 4 - would I be able to apply these settings using that player? The forum posts show some issues with vers. 5, so I have not upgraded my player yet.

thanks in advance -

ok…well at the risk of hijacking a thread - is there anything I can do to improve quality of video?

I did try H.264 once, and couldn’t see much of a difference, so maybe I didn’t change the settings correctly?

Format: H.264

Frame Rate: 29.97

Input Size: 320x240

Output Size: 480 x290

Bitrate: I am usually averaging 300 kbps up using wireless, 500+ hardwired.

In the display page I use f4v instead of flv to call the stream up.

(I have noticed that when I set the bitrate higher than 500, I get a lot of phone calls about buffering?)

I use live-record in my Application settings, and I also record a file locally using SaveToFile.

do you have any suggestions?

Hi Richard -

I tried to do a test last night, and when I changed the setting to H.264, FMLE prompted me to change the file extension to f4v instead of flv, which I also did in the JWPlayer page that displays the video.

using live, not VOD.

Got a blank screen, even though video was being streamed.

As soon as I changed all the settings back to VP6/flv, the live video worked.

What am I doing wrong?

Thanks for the suggestions.

Usually I stream LIVE using VP6, and in the webpage (JWPlayer) i have the file extension set to flv like this:

So I tried H.264 using .f4v in the code above, and got a black screen. When I changed it back to VP6 and .flv, it worked well, just like it usually does.

In order to stream live using H.264, what changes do I need to make to the player code?

Oh great !!

It works very fine.

Thanks a lot, Richard.

You can use Camera.setMode and Camera.setQuality:

camera.setMode(320,240,20,false); // set size here
camera.setQuality(0,90); // this favors quality over bandwidth

This is as exact as you can get using Flash plugin as the encoder. You should be able to get better quality from the same camera with a dedicated encoder.

Note, don’t set the 2nd arg of setQuality (quality setting) above 90. It is known to be a problem.

Richard

Richard,

I know this is AS code , but where this code should been put ? On my custom app I don’t have such a thing , so is it in the app itself of can been put in wowza settings somewhere ?