If you are looking to create a QuickTime video with embedded subtitles (AKA soft subtitles) in it, see avsubtitleswriterOSX sample code from WWDC 2013.
If you prefer to burn subtitles into a video, you can use AVVideoCompositionCoreAnimationTool
, as described in this tutorial