• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AudioTrack to movie.......
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



Imagine
 _______________________________________________
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

  • Follow-Ups:
    • Re: AudioTrack to movie.......
      • From: Mark Munte <email@hidden>
  • Prev by Date: Parsing AAC/m4a With AudioConverterFillComplexBuffer
  • Next by Date: Re: AudioTrack to movie.......
  • Previous by thread: RE: Parsing AAC/m4a With AudioConverterFillComplexBuffer
  • Next by thread: Re: AudioTrack to movie.......
  • Index(es):
    • Date
    • Thread