iphone - Cocoa - Add Video Watermark General Info -
How to programmatically add a watermark or some type of overlay to video using a cocoa step by step (Although it would be terrible), but more or less is looking for where I should start learning how. Have the frameworks been developed to work for it? I would like to make some originals for cocoa or purpose-C or C because I would eventually like to go to the iPhone. Any help would be great.
I'm not sure whether you meant only for playback, or if you had a watermark
If you only mean for playback, you can probably add a scene on top of the player view on Mac and iPhone, which includes Watermarks < / P>
If you want a watermark on the video, then this is hard on the Mac And probably it is impossible on the iPhone without writing QuickTime
On the Mac, the code can look like this (you have to import QTKit):
// Make a new movie so that we do not destroy the existing one. QTMOVY * Movie = [[QTMOVY ALLOC] Init Vthmovia: Current Moody Timezone: QtMake timorange (QTMacTime (0,1000), [current duration period]) Error: zero]; // Make it editable [movie set: attribute: [nsnumber number for worldbuilds: yes] k: qtmovi additive attribute]; // Size NSValue * Value = [Movie Specialty Foreaki: QTMovieNaturalSizeAttribute]; NSSize size = [value value of value]; // Add a new track to the movie and add it to the top layer QTTrack * track = [movie addVideoTrackWithSize: size]; [Track set attribute: [NSNM number number short: -1]: QTtrackLayer Attribute]; // We create a codec dictionary about adding an image to the NS * image. Image = [Object] with the NSDictionary dictionary: "Tough", QATID image coded type, [NSNumber number with long: codec highwive], QATID image codequality, zero]; // Get the length of video in QT QTTime qttime = [currentMovie period] Speak; NSTEInterval Rifetime; QTGetTimeInterval (quetaim, and reftime); // Add image for the entire duration of the video [Track ADIMAGE: Duration for Image: Attributes with qttime: imageDict]; // Finally, tell this track that it should use its alpha right MediaHandler Media = GetMediaHandler ([[Track Media] QuickTimeMedia]; MediaSetGraphicsMode (Media, GraphicsSystemTerraFlafa, NULL);
... and this is it! There is now a watermark in your movie, and you can export it to the file.
Comments
Post a Comment