QTMovie tracks count == 0??

Discussion in 'Mac Programming' started by Chirone, Mar 26, 2009.

  1. macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #1
    if i load an existing quicktime clip as a QTMovie, and it has a video and audio track i should be able to get the tracks by going
    Code:
    [mQTMovie tracks]
    right?
    and being an NSArray i should just be able to go
    Code:
    [[mQTMovie tracks] count]
    and get the number of tracks right?
    for some reason the count is 0...

    has anyone else had this sort of problem?
     
  2. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    Is nQTMovie nil? How did you initialize it? Do other things you call on it work?

    -Lee
     
  3. thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #3
    ok,

    i just printed the number in the wrong string format for the quicktime clip from disk....
    i went
    Code:
    printf("on load: %f\n", [[mQTMovie tracks] count]);
    instead of
    Code:
    printf("on load: %d\n", [[mQTMovie tracks] count]);
    which i didn't think would make a difference... maybe i'm too used to java *shudder*...

    however, this line
    Code:
    printf("QTGraphics tracks: %d\n", [[mQTGraphics tracks] count]);
    prints out 0 tracks....

    i think there is something wrong with the way it was initialized but i can't figure out what's wrong...

    i initialize it like this:
    Code:
    mQTGraphics = [QTMovie movie];
    		[mQTGraphics setAttribute: [NSNumber numberWithBool: YES] forKey: QTMovieEditableAttribute];
    that should be fine right? i'm just grabbing an empty QTMovie and making it editable

    then i add images to it
    Code:
    NSBitmapImageRep *image = [self getCurrentFrame];
    	
    	QTTime time = QTMakeTime(100, 10);
    	NSDictionary *attrs = [NSDictionary dictionaryWithObject:@"png " forKey:QTAddImageCodecType];
    	NSImage *img = [[NSImage alloc] initWithData:[image TIFFRepresentation]];
    	
    	[mQTMovieExport addImage:img forDuration:time withAttributes:attrs];
    	
    	[image release];
    Surely that should work... it worked for the other QTMovie that was initialized like this:
    Code:
    mQTMovieExport = [[QTMovie alloc] initToWritableFile:[savePanel filename] error:nil];
    what's so different about the two methods of initializing that one will add images and the other wont? :confused:
     
  4. macrumors newbie

    yomi.odeleye

    Joined:
    Jun 7, 2008
    #4
    merge two QTMovies together.

    Hi Every one. I just want to find out is there a way to join Two or more QTMovies together. If any one knows any line of code that can help me plx let me know. Thank you very much.
     

Share This Page