I am interested in adding text (in close captioned style) to an existing video on the iPhone. Some solutions to this on stackoverflow suggest to add a transparent UIView to overlay the video. That is all good, but, I cannot save that as a "new and modified video".
The only solution that I see is to take the text, take a single frame from the video, add the text to the frame, and push the modified frame with text back into the video, replacing the original frame in the video.
Does anyone know how to take a frame out of the video, (I think I can figure out the adding text), and then how to push the frame back into the video? If you have some idea, or know of a tutorial, I would appreciate it..
You don't need to do this on a frame by frame basis. AVFoundation supports subtitles since iOS 4.0.
You could for instance create a AVMutableComposition and then add a subtitle track on top of your video. AVMediaTypeSubtitle is the type for subtitles (or AVMediaTypeClosedCaption for closed captions). You can then feed the composition to either a player or a AVAssetWriter. Saves you all the trouble.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With