AudioTrack to movie.......
AudioTrack to movie.......
- Subject: AudioTrack to movie.......
- From: "sandeep chandran" <email@hidden>
- Date: 3 Apr 2007 15:37:29 -0000
Hi,
This is the first time i am dealing with the tracks of a movie.
I am trying to change the application QTExtractandConverttoMovieFile to make it add the
converted audio to an existing video which has no audio track.
and i tried like this in moviewriter.m and called along with createOutputFile
-(void)AddAudioToThisFile
{
// To this movie i want to add audio
QTMovie* mov = [[QTMovie alloc]initWithFile:@"/11.mov" error:nil];
mOutputMovie = [mov quickTimeMovie];
Fixed myWidth;
Fixed myHeight;
Track myTypeTrack = GetMovieIndTrackType(mOutputMovie, 1, VideoMediaType,
movieTrackMediaType);
GetTrackDimensions(myTypeTrack, &myWidth, &myHeight);
TimeScale myTimeScale = GetMediaTimeScale(GetTrackMedia(myTypeTrack));
// create the audio track
Track audiotrack = NewMovieTrack(mOutputMovie, myWidth, myHeight, kFullVolume);
Media soundMedia = NewTrackMedia(audiotrack, SoundMediaType, myTimeScale, NULL,
0);
BeginMediaEdits(soundMedia);
}
In the convert audio to file function i added this code
err = AddMediaSample2(soundMedia , mOutputBufferList->mBuffers[0].mData,
mOutputBufferList->mBuffers[0].mDataByteSize, 1, 0,
(SampleDescriptionHandle)mSoundDescription,numSamples, 0, NULL);
and at last ended with
-(void)AddAudioTracktoMovieFinished
{
EndMediaEdits(soundMedia);
InsertMediaIntoTrack(audiotrack, 0, 0, GetMediaDuration(soundMedia), fixed1);
}
i am getting error at Addmedia sample. and also no audio track is added with the
destination movie.
can anybody help me.
regards
Sandeep
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden