Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using the audio extraction API



I'm coming in a little late on all this, but here are a couple of clarifications:

1) There is a one-extraction-session-per-movie limitation, at present. Sorry It isn't better documented, but we're hoping to be able to lift the restriction at some point.

2) The movie supplied to MovieAudioExtractionBegin must be set Active. This is another restriction that may eventually be lifted.

3) If you want to start multiple extraction sessions on a single movie, your best bet is to clone the movie and disable any tracks you are not interested in. Alternatively, you can make a new movie with just the track(s) you want to extract from.

4) If you are trying to play the same movie that you are extracting from, you won't want to play too many games with the channel layout, since that will affect playback. But you can extract AllChannelsDiscrete and throw away the channels you don't care about. (I believe you might be able to get away with setting the channel buffer pointer for *all* the channels you don't care about to refer to the same buffer.)

5) If you are dealing with a clone of your movie that you can mess with, you can play some other games to get exactly the channel(s) you want. For instance, if you know that you want only the third channel of a 10-channel track, you can set its channel label to, for instance, Center, and set all the other channel labels to Unused. Then you can set your extraction ASBD to 1-channel, set the extraction channel layout to Center, and you'll get *just* the channel you want. (If you wanted 3 specific channels mixed together without attenuation, you could set them all to Center and disable the rest.)

6) When setting the CurrentTime to position your extraction, you can specify your own timescale, and we will round that position to the nearest sample. However, if you use a timescale equal to the sample rate of the track you care about, then the start position will be sample-accurate.

7) Doing scatter/gather extraction (ie, seaming pieces not extracted contiguously)from MP3 tracks is fraught with difficulties, as i have written about in another post. QT 7.1 should be sample accurate with respect to scatter/gather extraction from most other compressed formats.


Daniel Steinberg QuickTime Engineering



At 4:24 PM -0700 5/22/06, Steve Israelson wrote:
Ok, so this means for a track with 2 channels, I get 2 items per sample (Float32 in my case).
But, since I only want one of those (and with a track with 10 odd channels even) how do I further refine it to pick only the one I want?

Let's say you set "all channels discrete" on a source movie with 10 channels of audio in a single audio track, and you know you want just the second channel of audio. In your resulting AudioBufferList, just use the contents of:


bufferList->mBuffers[1].mData.

The data is still non-interleaved. Unless you specifically set it to be interleaved (you do this by mucking with the flags and various other fields in the audio stream basic description).


Ok, I get it, thanks.
A bit of a waste of buffer space. This could be a big deal. If each buffer is 128K and there are say, realistically, 6 channels, and maybe 4 instances of my component, then I have 128K * 4 * 6 = 6MB of unused buffers.
Would be nice if I left the buffer pointer as NULL if the extraction API just skipped that channel instead of bailing completely.
Not too big a deal on OSX I guess, but on Windows....



But I have another issue. The missing data I discovered was my bug :) But its related to:

When I set: kQTMovieAudioExtractionMoviePropertyID_CurrentTime
How do I know which sample number is being returned?
Presumably if the timescale is 600, and the sample rate os 128K or so, 1/600th covers a lot of samples, so which one did you pick to return as the first byte?


So I go to time: 123456, the time scale is 600, the sample number you return as byte 0 is ????
I can make a guess using 64bit math, which is what I am doing, but I MAY need more accuracy.
I'll know more once I get this all working and throw it by some scientist types :)



_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-API mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-API mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden
References: 
 >Using the audio extraction API (From: Steve Israelson <email@hidden>)
 >Re: Using the audio extraction API (From: Brad Ford <email@hidden>)
 >Re: Using the audio extraction API (From: Steve Israelson <email@hidden>)
 >Re: Using the audio extraction API (From: Brad Ford <email@hidden>)
 >Re: Using the audio extraction API (From: Steve Israelson <email@hidden>)
 >Re: Using the audio extraction API (From: Brad Ford <email@hidden>)
 >Re: Using the audio extraction API (From: Steve Israelson <email@hidden>)
 >Re: Using the audio extraction API (From: Brad Ford <email@hidden>)
 >Re: Using the audio extraction API (From: Steve Israelson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.