GithubHelp home page GithubHelp logo

ozzie00 / iframeextractor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jayrparro/iframeextractor

0.0 3.0 0.0 34.83 MB

Extract frames from iPhone videos using the FFMpeg libraries.

Home Page: www.codza.com

License: GNU Lesser General Public License v3.0

iframeextractor's Introduction

This project extracts frames from video recorded by iPhone 3Gs 
using the LGPL FFmpeg libraries.

This software is licensed under the GNU-LGPL version 2.1 or later.

Copyright 2010 Lajos Kamocsay

lajos at codza dot com

iFrameExtractor is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

iFrameExtractor is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.


To compile and run the project on your iPhone:

   1. open Terminal
   2. clone the repository: git clone git://github.com/lajos/iFrameExtractor.git
   3. go to the ffmpeg folder in the project: cd iFrameExtractor/ffmpeg
   4. build the ffmpeg libraries: ./build_universal
   5. open the xcode project and run it on your iPhone device

The build_universal shell script creates libraries that work on both armv6 and armv7 processors. If you need libraries for pre-3Gs devices (iPhone 2g, iPhone3G, iPod Touch), use the build_armv6 script. For iPhone 3Gs only libraries, use build_armv7.

iFrameExtractorAppDelegate creates an instance of VideoFrameExtractor (the class that grabs images from the video). When you press the play button, iFrameExtractorAppDelegate sets up a loop and displays all the images from the video until it reaches the end of the movie.

The VideoFrameExtractor class is based on Martin Böhme’s tutorial, upgraded to use swscale. Initialize this class with the full path of the movie:

VideoFrameExtractor *video = [[VideoFrameExtractor alloc]
               initWithVideo:@"/full/path/to/movie.mov"];

By default, the output size will match the movie’s size. You can set outputWidth and outputHeight to change the dimensions:

video.outputWidth = 426;
video.outputHeight = 320;

Use stepFrame to grab the next frame. This method returns false if there are no more frames (reached the end of video):

BOOL result = [video stepFrame];

The processed frame can be accessed as a UIImage on the currentImage property:

UIImage *myImage = video.currentImage;

You can seek to a specific time (in seconds) using the seekTime: method:

[video seekTime:1.0];

The movie’s length can be queried by checking the duration property:

NSLog(@"video duration: %f",video.duration);

http://www.codza.com/extracting-frames-from-movies-on-iphone

iframeextractor's People

Watchers

 avatar  avatar  avatar

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.