Log in

View Full Version : Controlling video stream bandwidth


xilog
24th August 2006, 16:22
Hi. I hope this question is okay, as it's connected with capturing video (but not analog video so I haven't posted it in that forum.)

I have a local html page that I use to load up 2, 3 or 4 video streams from web sources. The problem is that the combined bandwidth of 4 streams at maximum quality is more than I have. (Each stream is 700kbps at max quality including audio, I have a total bw of 2Mbps until my ISP extracts their digit and upgrades me.)

Each stream has three possible bitrates for video, 644, 448 and 302kbps.

I use WM Recorder to proxy and record the streams and the Windows Media Player plugin (not the ActiveX control as I use Opera).

1. Is there a way that I can make WMP choose one of the lower bandwidth streams by default rather than the higher rate ones?

2. When WMP starts a stream at 700kbps and constantly has to rebuffer, isn't it supposed to drop down to a lower rate? This isn't happening for me. Am I misunderstanding what's supposed to happen?

TIA for any help you can give :)

zambelli
24th August 2006, 20:29
1. Is there a way that I can make WMP choose one of the lower bandwidth streams by default rather than the higher rate ones?
You ought to be able to do it by throttling the network bandwidth in WMP:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/networkmaxbandwidth.asp

2. When WMP starts a stream at 700kbps and constantly has to rebuffer, isn't it supposed to drop down to a lower rate? This isn't happening for me. Am I misunderstanding what's supposed to happen?
Only if the stream is encoded as a multi-bitrate stream. If you have actual multiple files encoded, that won't work. It needs to be one file with multiple video and audio streams inside.

xilog
24th August 2006, 21:19
Cool, thanks for the pointer :)

It is a MBR stream so this might well solve my problem. Mind if I ask a followup question?

This is obviously a method that has to be used in code somehow but I need to be able to apply this to the embedded object in a really simple way. I'm not totally clueless as far as the *concepts* of code are concerned, but I have no idea how I might actually use this property.

I've googled for player.network.maxBandwidth and it's come up with a big fat zero.

Do you think you's be able to point me at any kind of resource on how to use this? Preferably something that uses one syllable at a time :)

Thanks :)

zambelli
24th August 2006, 22:09
Do you think you's be able to point me at any kind of resource on how to use this? Preferably something that uses one syllable at a time :)
You mentioned earlier that you were not using the WMP ActiveX object. Which plugin are you using then?

The method I linked to can only be used on the WMP ActiveX object. I doubt it's implemented in any other plugin implementation of WMP.

xilog
24th August 2006, 22:22
Thanks for helping. I'm using this:

<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="{stream}" width=368 height=310 name="MediaPlayer" autostart="True" ShowStatusBar=1 ShowControls=1 ShowTracker=0 mute=1>
</embed>

Which from my limited understanding is the WMP plugin as opposed to ActiveX. Have I misunderstood something?

I can switch to this <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer1">
<param name="URL" value="{stream}">
<param name="width" value ="368">
<param name="height" value="310">
<param name="ShowTracker" value ="-1">
<param name="mute" value ="-1">
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="autoStart" value="0">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="-1">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
</object>
method and use IE instead if that would make it easier for you to help me.

zambelli
25th August 2006, 08:42
I'm using this:
<embed type="application/x-mplayer2"
Which from my limited understanding is the WMP plugin as opposed to ActiveX. Have I misunderstood something?
EMBED is just an alternate way of specifying an embedded object. It uses a MIME type (application/x-mplayer2) to identify the content and needed application. It's up to the OS to make the connection between the MIME type and application. On a standard Windows XP system, application/x-mplayer2 is associated with wmp.dll, which means that it's essentially the same as object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6".

In other words, both methods invoke the WMP ActiveX object. The former is more platform agnostic because it doesn't call out a specific CLSID but relies on the OS to make the association between MIME type and application. For maximum compatibility, you can use both, like this:

<OBJECT ID="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" WIDTH=320 HEIGHT=240>
<PARAM NAME="AutoStart" VALUE="False" >
<PARAM NAME="stretchToFit" VALUE="True">
<PARAM NAME="uiMode" VALUE="full">
<PARAM NAME="URL" VALUE="http://foo.com/foo.asx">
<EMBED TYPE="application/x-mplayer2"
SRC="http://foo.com/foo.asx"
NAME="Player"
WIDTH="320"
HEIGHT="240"
AUTOSTART="0">
</EMBED>
</OBJECT>

The only downside of that approach is that all those PARAM attributes are specific to WMP. If you were to view the same page on Linux with Mozilla, a completely different player might get associated with x-mplayer2, which in turn might not support any of the embed attributes such as AUTOSTART.

There are some pretty good guides online for embedding WMP in HTML. Just google for it, and use the MSDN pages I linked for full reference.

xilog
25th August 2006, 16:29
Thanks again. Having played around learning jscript fast, I think I have it working now.