asx files

Author Message
alawoona 03/29/2006 07:01 am
Dear Oleg : You added the ability to specify start and stop times to realmedia files from rtsp servers. Here is a similar issue with asf files -

On this page http://www.abc.net.au/pm/default.htm there is a link to a 50 minute audio file http://www.abc.net.au/pm/20021127pm.asx

further down the page are links to sections within the audio file above, for example for the 5th section -

http://www.abc.net.au/pm/2002/11/27/20021127pm05.asx

which is this asx file -
<asx version="3">
<title>PM - November 27, 2002</title>
<author>ABC News Online</author>
<copyright>2002, Australian Broadcasting Corporation</copyright>
<moreinfo href="http://www.abc.net.au/pm/" />
<logo href="http://www.abc.net.au/streaming/img/smalllogo.gif" style="icon" />
<entry>
<title>US free trade</title>
<startmarker name="05"/>
<endmarker name="06"/>
<ref href="mms://media3.abc.net.au/pm/20021127pm.asf"/>
</entry>
</asx>


The length of the section is specified by the startmarker and endmarker. OE will down load the whole 50 minute file rather than the shorter section. Is it a "doable" modification?
Veblin 03/29/2006 07:01 am
Hello Alawoona, Nice to see you again.

ASX files also sometimes have Start, Duration or End times. I don`t have a current URL but they are like this.

<StartTime value = "00:33:00.000" />
<Duration value = "00:05:00.000" />

Or

<StartTime value = "00:33:00.000" />
<EndTime value = "00:38:00.000" />

I don`t think these work with OEP either. I have not tried one recently but if they are not working it would be a nice feature.
Veblin 03/29/2006 07:01 am
Mistake. Sorry, I guess that EndTime is not valid in a ASX file but StartTime and Duration are.
Oleg Chernavin 03/29/2006 07:01 am
Do you know how these start marker and end marker are defined? How to understand what they mean in minutes/seconds?

I think I can implement the StartTime/Duration tags parsing, but are they important?

Best regards,
Oleg Chernavin
MetaProducts corp.
alawoona 03/29/2006 07:01 am
Dear Oleg : I am not an expert here but I believe these markers are inserted using the Windows Media Author software (part of the Windows Media Resource Kit Tools). On the Insert Menu you can add a marker in the asf file at a specific time. When you do this this marker acts like a book mark in a play list in Windows Media Player.

alawoona
Oleg Chernavin 03/29/2006 07:01 am
OK. But maybe th file should be loaded fully to the disk and when offline browsing, MediaPlayer will skip to the mark in the file itself?

Oleg.
alawoona 03/29/2006 07:01 am
> > OK. But maybe th file should be loaded fully to the disk and when offline browsing, MediaPlayer will skip to the mark in the file itself?
> >
> > Oleg.

Whoops - When OE downloads the whole file the bookmarks do not show up in windows mediaplayer. I will see if i can find the marks in te file using windows media tools.
Oleg Chernavin 03/29/2006 07:01 am
OK. Let me know what you find out, please.

Oleg.
alawoona 03/29/2006 07:01 am
> OK. Let me know what you find out, please.
>
> Oleg.

I D/L the whole file and opened it in asfindexer. There is a timeline with markers labelled 01, 02, 03 etc. ... at various times in the file. You can edit these and change the time for each marker and also change the name for each marker. You can see these markers in Windows Media Player by selecting View, File Markers.... You can select a particular marker and the player will skip to that point in the file.

Not sure this helps as OE would have to scan the whole asf file to find the markers and the particular time defined for each marker. Well, I suppose we can`t have everything :)

Still a great product

alawoona
Oleg Chernavin 03/29/2006 07:01 am
The problem is that the format is not documented, so I am not sure, if I will be able to understand how to find these markers.

Oleg.
alawoona 03/29/2006 07:01 am
Looked in the Wundows Media Tools Help File - found this - Not that much help

Enhancing ASF content
When you are creating and hosting ASF content you can choose to add features and functions to your content. The following items are some of the options available:

Indexing and markers. Makes content seekable, providing fast forward, rewind, and search functions to .asf files unicast from a Windows Media server.
Script commands. Makes the user experience more interactive through Web links and related content topics.
Playlists. Show multiple pieces of ASF content in a specific order. A common use is to intersperse commercials with your content.

Markers
A marker is a pointer to a specific time in an .asf file. Microsoft Windows Media Player uses markers to seek directly to a point in an .asf file. Markers make it possible for viewers to maneuver through an .asf file. A user can skip ahead or skip back to a previous marker to view a portion of the .asf file again. Markers are used only with stored .asf files. You can use Windows Media ASF Indexer to place markers into your .asf file or you can use a script file with the command-line utility ASFChop.

To create a marker with a script file, specify the time where you want to set the marker and name the marker. You can name the markers anything you like. A marker script file looks like this:

; Sample Marker script.txt
start_marker_table
8 Marker 1
1:00 Marker 2
1:15 Marker 3
3:00:03 Marker 4
end_marker_table
Related Topics
Windows Media ASF Indexer
ASFChop


ASFChop
ASFChop is a command-line tool that you can use to delete parts of an .asf file and to add indexing, script commands, markers, and general properties to an .asf file. Deleting parts of a file reduces the length of time required to stream the file. ASFChop creates an index for that file so that you can seek (similar to fast forward) through the file. Windows Media Encoder can also be used to create seekable .asf files. An .asf file must have at least 10 seconds of content to be indexed.

Related Topics
Script files
Markers
Script commands
Windows Media ASF Indexer
To use ASFChop on your .asf file








Oleg Chernavin 03/29/2006 07:01 am
Thank you! I will look at this.

Oleg.
anon 03/29/2006 07:01 am
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/internet/imedia/netshow/seekingtomarkers/default.asp

Description
Goal: To seek to markers within an ASF file in both Microsoft® Internet Explorer and Netscape Navigator®.
The Active Streaming File (ASF) format has marker functionality built-in. Markers are points inside a piece of content that users can skip to, similar to a bookmark. By adding markers (using the ASFIndexer program, which is part of the Windows Media tool package), content authors can direct users to places within any given piece of content.

Markers are like tracks on an audio CD. A CD player will play all of the tracks in order, but you can skip around to other tracks. The same is true of markers.

Code to Include:
We`ll start with our generic cross-browser code embedding code. This code will instantiate the Media Player ActiveX control for browsers which support ActiveX, and the Media Player plug-in for browsers that don`t:

<OBJECT ID="MediaPlayer1" width=160 height=182
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase=
"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="http://webserver/path/your-file.asx">
<PARAM NAME="ShowStatusBar" VALUE="True">
<EMBED type="application/x-mplayer2"
pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
SRC="http://webserver/path/your-file.asx"
name="MediaPlayer1"
width=160
height=182
ShowStatusBar=true>
</EMBED>
</OBJECT>

Next, we`ll define a form and some buttons:

<FORM Name="markerForm">
<INPUT TYPE="button" VALUE="1" onClick="seekToMarker(1)">
<INPUT TYPE="button" VALUE="2" onClick="seekToMarker(2)">
<INPUT TYPE="button" VALUE="3" onClick="seekToMarker(3)">
<INPUT TYPE="button" VALUE="4" onClick="seekToMarker(4)">
</FORM>

In the code above, all of the buttons make calls through JavaScript directly to the Media Player using the Document Object Model(DOM). They call the following function:


<SCRIPT LANGUAGE="JavaScript">
// This function receives an integer from the buttons above and resets the current
// position of the file to that marker.
function seekToMarker(iWhichMarker){
if ((navigator.userAgent.indexOf("IE") > -1) && (navigator.platform == "Win32")) {
// This is an error handler. If the user tries to scan to a marker which doesn`t
// exist, the player will pop an error message. By using this code, we
// can create a custom error message.
if (iWhichMarker <= document.MediaPlayer1.MarkerCount) {
// This resets the current marker in the file.
document.MediaPlayer1.CurrentMarker = iWhichMarker;
} else {
alert("This Marker doesn`t exist.");
}
} else {
if (iWhichMarker <= document.MediaPlayer1.GetMarkerCount()) {
document.MediaPlayer1.SetCurrentMarker(iWhichMarker);
} else {
alert("This Marker doesn`t exist.");
}

}
}
</SCRIPT>

This sample deals with setting the CurrentMarker property and getting the read-only MarkerCount properties. The CurrentMarker property`s value is set to a Marker number and the player automatically goes there. The MarkerCount property is used to make sure that the code doesn`t create an error in the page.
Browser/Platform Compatibility and other Requirements
This code will work with Internet Explorer 4+, and Netscape Navigator 4+ on platforms that support the Windows Media Player plug-in and ActiveX control.