0

I want to make an app where users can create funny stick figure animations.

It would be cool if it is possible to export them as video. Can I "draw" video frames frame by frame and render them into a H.264 or other video format?

The length will be between 2 seconds and 5 minutes. I heared a while back that there is a framework to edit video but in my case I really need to create a video from scratch. What are my options?

  • It is very possible and not that complicated, once you understand the framework. Here is your answer: http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie It uses UIImages but you can accommodate it to your drawings. – Zebs Jun 26 '11 at 14:05
  • If another question answers this one so completely that all you have to do answer is link to the other, then please flag as duplicate rather than posting. – jscs Jun 26 '11 at 20:10
  • Unfortunately only available in iOS > 4.1 – Serious Rabbit Jun 27 '11 at 18:54
  • Besides the other answer won't do, since it uses AVFoundation – Samssonart Aug 31 '11 at 15:21

2 Answers2

0

Yes, you can examine : CEMovieMaker

Usage:

UIImage *frameImg = <Some Image>;

    NSDictionary *settings = [CEMovieMaker videoSettingsWithCodec:AVVideoCodecTypeH264
                                                        withWidth:source.size.width
                                                        andHeight:source.size.height
                              ];

    ///
    CEMovieMaker * movieMaker = [[CEMovieMaker alloc] initWithSettings:settings];


    /// Complete video
    [movieMaker createMovieFromImages:[self.movieImages copy] withCompletion:^(NSURL *fileURL){

        //AVPlayerViewController or
        MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
        [playerController.view setFrame:self.view.bounds];
        [self presentMoviePlayerViewControllerAnimated:playerController];
        [playerController.moviePlayer prepareToPlay];
        [playerController.moviePlayer play];
        [self.view addSubview:playerController.view];
    }];
Aleksandr B.
  • 505
  • 4
  • 6
0

You might need to use a multimedia framework which provides more lower level control, like gstreamer or ffmeg.

Alternately, you can create an MJPEG and figure out a way to transcode it.

sparkymat
  • 9,938
  • 3
  • 30
  • 48