Code Monkey home page Code Monkey logo

cemoviemaker's People

Contributors

cameronehrlich avatar rahuldeojoshi avatar ttseng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cemoviemaker's Issues

Problem with generating movie

Hi!
I have a problem with generating a movie.
This is my method for creating a movie:

+ (NSURL *)processMovieWithPhotos:(NSArray *)photosArray
{
    __block NSURL *finalMovieURL = nil;
    NSMutableArray *frames = [[NSMutableArray alloc] init];

    NSArray *resizedPhotosArray = [self resizedPhotosToCreateMovieFromArray:photosArray];
    UIImage *onePhoto = resizedPhotosArray[0];

    NSDictionary *settings = [CEMovieMaker videoSettingsWithCodec:AVVideoCodecH264 withWidth:onePhoto.size.width andHeight:onePhoto.size.height];
    CEMovieMaker *movieMaker = [[CEMovieMaker alloc] initWithSettings:settings];
    [frames addObjectsFromArray:resizedPhotosArray];

    [movieMaker createMovieFromImages:[frames copy] withCompletion:^(BOOL success, NSURL *fileURL){
        if (success) {
            finalMovieURL = fileURL;
        }
    }];

    return finalMovieURL;
}

Method resizedPhotosToCreateMovieFromArray: resizes photos proportion for height of 1920 and returns photos array.

The problem is that Movie file size is 0 kbytes and in method createMovieFromImages:withCompletion: success is equal to NO.
Any idea for this issue?

Image Cropping in Video Output

Using your code, I'm able to export a video, but it seems to crop the images incorrectly.

Here is what my code looks like:

UIImage *resizedPhoto = [self imageWithImage:rotatedPhoto scaledToSize:CGSizeMake(704, 704)];

        // save resizedPhoto to gallery for testing
//        UIImageWriteToSavedPhotosAlbum(resizedPhoto, nil, nil, nil);

        // add image to spin array
        [_spinImages addObject:resizedPhoto];
        imgUploadedCount++;

        if(imgUploadedCount == SPIN_IMAGES){
            NSLog(@"generating video");
            NSDictionary *settings = [CEMovieMaker videoSettingsWithCodec:AVVideoCodecH264 withWidth:resizedPhoto.size.width andHeight:resizedPhoto.size.height];
            self.movieMaker = [[CEMovieMaker alloc]
                               initWithSettings:settings];

            [self.movieMaker createMovieFromImages:[_spinImages copy] withCompletion:^(NSURL *fileURL){
                NSLog(@"movie at fileURL: %@", fileURL);
}];
}

These are the resulting images:

2015-07-10 10 30 53
2015-07-10 10 30 56
2015-07-10 10 31 00-1

and the resulting video:

https://dl.dropboxusercontent.com/u/1000620/2015-07-10%2010.31.00-2.mov

Art effect Video

Hi, I'm doing something like that with your class

NSMutableArray * imageArray = [NSMutableArray new];

[imageArray addObject:[UIImage imageNamed:@"gif-anime.jpg"]];
[imageArray addObject:[UIImage imageNamed:@"gif-anime-2.jpg"]];
[imageArray addObject:[UIImage imageNamed:@"gif-anime-3.jpg"]];

UIImage * first = (UIImage *)imageArray[0];

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

self.movieMaker = [[CEMovieMaker alloc] initWithSettings:settings];


[self.movieMaker createMovieFromImages:[imageArray copy] withCompletion:^(NSURL *fileURL) {
    NSLog(@"succes");
}];

And i'm getting this result :
https://drive.google.com/open?id=0B-M3INH9OA9VUjh2SGl0d1Fxd3M

Images :
https://drive.google.com/open?id=0B-M3INH9OA9VWmFteWpJWVdhX0k
https://drive.google.com/open?id=0B-M3INH9OA9VdHFyNW9OWkhXbWc
https://drive.google.com/open?id=0B-M3INH9OA9VMjZubVFmWjAxeHM

Thanks

Image Aplha Channel is Disturbed

When I convert the image into video using you framework its alpha is disturbed. The Image gets a bit bright then the original one in the video. Can u please help me in this.

Images turned 90 counterclockwise

I have an array of square images that are perfectly fine but when I create a movie from them, the images are turned 90 degrees counterclockwise. Any idea why this is happening?
Thanks!

Length of time onscreen

Hi!
I'm having a problem with changing the length of time that each image stays on the screen. For example I'd like the user to choose an amount of time, in seconds, and the image would be on the screen for that length of time. I've tried changing the _frameTime variable, but to no avail. It's set default to CMTimeMake(1,1) which places each image on the screen for 1 second. However if I change it to another number, such as _frameTime = CMTimeMake(10, 2); this should show each image for 5 seconds, however it only applies to the first image, then the rest of the images are shown for a minimal length of time.

Thanks
Kieran

looping video

is it possible to create a looping video? I want to have a similar effect as an animated GIF but with video files.

Save Created Video

Thanks for creating this library. Using it, I get the message that the video has been created, but I'm not able to save it to my library.

This is what I currently have:

 [self.movieMaker createMovieFromImages:[_spinImages copy] withCompletion:^(NSURL *fileURL){
                NSLog(@"movie at fileURL: %@", fileURL); // this gives me the log movie at fileURL: file:///var/mobile/Containers/Data/Application/7AF6F798-346B-4CE8-B5FA-88C7FB8D5BA0/Documents/export.mov

                UISaveVideoAtPathToSavedPhotosAlbum ([fileURL absoluteString],self,nil, nil);
            }];

Going into my photo album, I don't see the saved video.

Memory warning and crash

CEMovieMaker works perfectly in my app to generate a video from UIImages. But it use a lot of memory and sometimes too many.
My tests on an iPhone 6 show that you can pass about 350-400 images maximum. After this, the application crash because of memory excess.

I will try to use less memory but maybe you already have an idea ?

MPMovieViewController crashing with Swift

Hi Cameron, just wanted to say that you've done a really nice job on this project! However, I'm having trouble with some Swift code. Whenever I call the MPMovieController, a black screen shows. Here is some code:

    func makeMovie(){

        let settings:NSDictionary = CEMovieMaker.videoSettingsWithCodec(AVVideoCodecH264, withWidth: images![0].size.width, andHeight: images![0].size.height)
        let movieMaker = CEMovieMaker(settings: settings as [NSObject : AnyObject])

        movieMaker.createMovieFromImages(self.images) { (fileURL:NSURL!) -> Void in

            self.viewMovieAtURL(fileURL)
        }
    }

    func viewMovieAtURL(fileURL:NSURL){
        var moviePlayer : MPMoviePlayerController?
        moviePlayer = MPMoviePlayerController(contentURL: fileURL)
        if let player = moviePlayer {
            player.view.frame = self.view.bounds
            player.prepareToPlay()
            player.scalingMode = .AspectFill
            self.view.addSubview(player.view)
        }
    }

I think it may be a problem with the fileURL, though no errors are being thrown. The MPMoviePlayer just shows a black screen. Thoughts?

Variable speed per frame

Hello, I have an application which uses an array of images and a variable time per frame starting from 0.04 seconds to 2 seconds. So if the array has 20 images and the time per frame is 0.5 , the total video time should be 20 * 0.5 = 10 seconds.

Would it be possible to do something like this? I am trying to modify the self.movieMaker.frameTime = CMTimeMake(self.frameArray.count, 1.0 / speedPerFrame); but I get some unexpected video output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.