I will explore the possibility to record to two separate files (the
original idea was to merge the two streams on the fly). I will then
load both streams, read the video stream QTSampleBuffer by
QTSampleBuffer and add audio samples according to the read
presentationTime in order to get a properly synchronized movie. I will
report back.
Ivan Guajana
On 9-feb-08, at 01:34, David Underwood wrote:
Hi Ivan.
The QTCaptureDecompressedVideoOutput delegate method
both provide a QTSampleBuffer object which contains the sample data
and media metadata for the sample being captured. You can use
QTSampleBuffer's presentationTime method to extract the presentation
time stamps from each sample buffer you receive. All sample buffers
captured within a QTCaptureSession are time stamped from a single
time base, so if you record audio and video samples to separate
files, you can synchronize the two movies when you combine them by
comparing the presentation times of the original sample buffers.
If you go the route of writing your own movie file, you should
probably stick with the lower level ICMCompressionSession APIs.
addImage:forDuration:... does not maintain a session between
invocations, and therefore will not effectively compress to formats
with dependent frames, such as H.264. This is not a problem for
still image codecs, such a jpeg, however.
David Underwood
QuickTime Engineering
On Jan 25, 2008, at 6:22 AM, Ivan Guajana wrote:
Hello everybody,
first of all, let me thank people at Apple for the new QTKit
Capture APIs, which are making my life easier. I could already
spare several thousand lines of code in our app dealing with device
detection/selection/audio metering/etc by just replacing the legacy
QT calls with the new APIs and I even got more functionality/
efficiency.
Using the new APIs, however, I noticed that there are very limited
possibilities to choose the output codec/bitrate/size when using
QTMovieFileOutput. I decided to use an instance of
QTCaptureDecompressedVideoOutput instead and compress the incoming
frames using an ICMCompressionSession. The problem is that I have
to store the compressed video frames along with the audio (which
should also be compressed somehow) in a synchronized fashion. How
can I carry this out? I read something about using QTSampleBuffer
to do this. Can someone provide me with some pointers/pseudocode?
Furthermore, what would be better/worse if I used QTKit's
addImage:forDuration approach instead of ICMCompressionSession?
Would it be at all feasible?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
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:
This email sent to email@hidden