3

I have created a custom AVVideoComposition class and used it like this:

AVAsset *asset = ...
AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoCompositionWithPropertiesOfAsset:asset];
videoComposition.customVideoCompositorClass = [MyCustomCompositor class];
MyCustomInstruction *instruction = // custom instruction holding CIFilter that is applied to every video frame
videoComposition.instructions = @[instruction];

After export session used like this:

AVAssetExportSession *session = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetHighestQuality];
session.outputURL = ...
session.outputFileType = AVFileTypeQuickTimeMovie;
session.videoComposition = videoComposition;

[session exportAsynchronouslyWithCompletionHandler:^{
    ...
}];

According to the documentation if I'm using AVVideoComposition, a track's preferredTransform won't work. Also with custom AVVideoCompostion instruction I can't set AVMutableVideoCompositionLayerInstruction with setTransform:atTime:.

How to get video with correct orientation?

Tomasz Bąk
  • 6,124
  • 3
  • 34
  • 48
  • http://stackoverflow.com/questions/13465746/ios-avfoundation-setting-orientation-of-video – Vizllx Apr 30 '15 at 08:54
  • Please, read edited end of my question. I have seen this question, but it hasn't been helpful. – Tomasz Bąk Apr 30 '15 at 09:04
  • Did you solve this Tom? We are stuck on the issues ah – Roi Mulia Dec 11 '18 at 14:33
  • It was a long time ago so I'm not 100% sure. I think I ended up manually correcting transformation matrix. – Tomasz Bąk Dec 14 '18 at 08:08
  • Any chacne you have the code you used? – Roi Mulia Dec 15 '18 at 21:18
  • I don't, sorry. – Tomasz Bąk Jan 02 '19 at 13:07
  • Hey Tom, we are still stuck on this issue... I'm talking on behalf of my team. We are a small startup based in Tel Aviv, we are developing advanced video edit app that is using custom AVVideoCompositing to compose the final video. We have encountered some interesting yet challenging issues regarding CIImage and OpenGL conversations within the compositor. We taught, In case you are interested, to do some 2-3 hours consultant session (paid of course) and see maybe you can assist us or direct us to the correct direction. Would it be something you are interested in? – Roi Mulia Jan 13 '19 at 16:11

0 Answers0