Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chirone

macrumors 6502
Original poster
Mar 2, 2009
279
0
NZ
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?
 

Chirone

macrumors 6502
Original poster
Mar 2, 2009
279
0
NZ
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:
 

yomi.odeleye

macrumors newbie
Jun 7, 2008
10
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.