I am trying to create an empty QTMovie object with which I can add segments and then play. This is easy to do with something like:
movie = [[QTMovie alloc] initToWritableData:[NSMutableData dataWithCapacity:1048576] error:&error];
Then I can use -insertSegmentOfMovie to insert segments from other movies into this so that I can play it. The problem is that I also need to set a specific attribute when creating the QTMovie object. In particular, I need to set the QTMovieRateChangesPreservePitchAttribute attribute so that I can change the playback speed during playback without changing the pitch. This attribute cannot be recorded after initializing the movie.
So, I can create a QTMovie object as follows:
movie = [[QTMovie alloc] initWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], QTMovieRateChangesPreservePitchAttribute, nil] error:&error];
Unfortunately, this cannot be changed. I tried to set QTMovieEditableAttribute also when creating, but this does not help. I still get an exception when I try to insert something into this movie. I assume this is due to the fact that QTMovie does not have a link to a record or data related to QTMovie.
Any ideas on how to solve this?
source
share