How to combine text with video using AVFoundation.framework

Go To StackoverFlow.com

1

Please teach me how to insert text to video using AVFondation.framework. I want to combine current date and time with recording video.

I tried using CALayer, but I couldn't.

So please give me solution of this problem.

Thank you.

Kyohei Ota

2012-04-05 01:20
by kyoheialfaromeo2010


1

Simply, you should make a Label. Clearly, using CALayer be implemented, but that maybe simply able not resolved.

First, you should to add a label to the moviePlayerView.

|                   |
|  moviePlayerVew   |
|                   |
|                   |
|[Your Label]       |

I recommend following codes.

If the code below if you want to know more about, refer here.

https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40009530

and

https://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html

Speaking briefly, player 10 times per second while running will generate block portion.

[yourPlayer addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(0.1, NSEC_PER_SEC) queue:queue usingBlock:^(CMTime time)
{
 yourLabel.text = @"your string".
}
2012-04-05 01:33
by bitmapdata.com
Ads