English 中文(简体)
Access to the contents of a QuickTime Movie Track s Edit Atom?
原标题:
  • 时间:2009-12-08 13:27:47
  •  标签:
  • quicktime

Is there any way to get hold of the contents of a QuickTime Movie Track s Edit Atom ( i.e. edts ) in general and the contents of its Edit List Atom ( i.e. elst ) in special using the QuickTime (C) API?

The goal is to identify any edits in a given track along with their duration and start time.

I have been checking the QuickTime Reference Library (both legacy and current) for the last two hours and yet have not been able to identify any API to achieve this.

Any hints would be greatly appreciated.

Cheers,

Bjoern

最佳回答

To answer my own question:

The contents of a track s edit list (if any), i.e. the edits/segments present in a track may be determined via the GetTrackNextInterestingTime() API function (code ripped from Movies.h):

/*
 *  GetTrackNextInterestingTime()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in QuickTimeLib 2.5 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 *    Windows:          in qtmlClient.lib 3.0 and later
 */
EXTERN_API( void )
GetTrackNextInterestingTime(
  Track        theTrack,
  short        interestingTimeFlags,
  TimeValue    time,
  Fixed        rate,
  TimeValue *  interestingTime,
  TimeValue *  interestingDuration);

by passing nextTimeTrackEdit (to look for track edits) and nextTimeEdgeOK (to include borderline cases) in interestingTimeFlags.

For most cases in which you may be interested into the edits being present in a track you will have to map the returned interestingTime from track time to media time (f.e. if you ve been examining the track s edits to determine a possible track offset).

This is accomplished via the TrackTimeToMediaTime() API function:

/*
 *  TrackTimeToMediaTime()
 *  
 *  Availability:
 *    Non-Carbon CFM:   in QuickTimeLib 2.5 and later
 *    CarbonLib:        in CarbonLib 1.0 and later
 *    Mac OS X:         in version 10.0 and later
 *    Windows:          in qtmlClient.lib 3.0 and later
 */
EXTERN_API( TimeValue )
TrackTimeToMediaTime(
  TimeValue   value,
  Track       theTrack);

Edit

The state of the art way to convert track time to media time would be TrackTimeToMediaDisplayTime():

/*
 *  TrackTimeToMediaDisplayTime()
 *  
 *  Summary:
 *    Converts a track s time value to a display time value that is
 *    appropriate to the track s media, using the track s edit list.
 *    This is a 64-bit replacement for TrackTimeToMediaTime.
 *  
 *  Discussion:
 *    This function maps the track time through the track s edit list
 *    to come up with the media time. This time value contains the
 *    track s time value according to the media s time coordinate
 *    system. If the time you specified lies outside of the movie s
 *    active segment or corresponds to empty space in the track, this
 *    function returns a value of -1. Hence you can use it to determine
 *    whether a specified track edit is empty.
 *  
 *  Parameters:
 *    
 *    value:
 *      The track s time value; must be expressed in the time scale of
 *      the movie that contains the track.
 *    
 *    theTrack:
 *      The track for this operation.  Your application obtains this
 *      track identifier from such functions as NewMovieTrack and
 *      GetMovieTrack.
 *  
 *  Result:
 *    The corresponding time in media display time, in the media s time
 *    coordinate system. If the track time corresponds to empty space,
 *    this function returns a value of -1.
 *  
 *  Availability:
 *    Non-Carbon CFM:   not available
 *    CarbonLib:        not available
 *    Mac OS X:         in version 10.4 (or QuickTime 7.0) and later
 *    Windows:          in qtmlClient.lib version 10.4 (or QuickTime 7.0) and later
 */
EXTERN_API( TimeValue64 )
TrackTimeToMediaDisplayTime(
  TimeValue64   value,
  Track         theTrack);
问题回答

暂无回答




相关问题
Display MPEG-4 Export Component Dialog

Below is my code for a doc based QTKit app that exports to the fixed Apple device formats by way of a popUp that displays the three device options. The [NSNumberWithLong:mpg4 ] option works fine as ...

Quicktime Framework and opening Transport Streams

I have noticed that Quicktime 10 is now able to open Transport Stream Video files and also search reliably within that video file(Which is something that VLC can not seem to handle). Quicktime 7, on ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...

热门标签