5

Is it possible using the iPhone SDK to grab a frame from a video in iPhone and save it or use it in any way in the application? Does the SDK give any control over the video other than play/stop or maybe access to the binary data of the video?

Also is it possible to know the time at which the user stopped watching the video (i know in SDK 3.0 it is possible to start the video from a specific time).

Thanks

EDIT: If not through the official APIs, is there another way to do any of the above in a way that won't ban the application from the AppStore?

Dimitris
  • 13,480
  • 17
  • 74
  • 94
  • Are you wanting to get a frame from a video from their ipod? or from a video your app streams down? – Jab May 01 '09 at 17:21
  • Seconded. Where the video is coming from will play a key role in this. If it's a movie from iTunes, you really have no access to the bits. (Very much by design.) If it's your video, then there are more options. – Sixten Otto Oct 25 '09 at 23:03
  • I'm talking about an .mp4 from the application's bundle being played through the movie player controller. Also if there is a way to this for something streamed, please let me know :) – Dimitris Oct 26 '09 at 12:28

4 Answers4

4

Here's a blog post about extracting frames from movies using ffmpeg:

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

The corresponding project on github: iFrameExtractor

lajos
  • 25,525
  • 19
  • 65
  • 75
  • I saw something like this a while ago, thanks for sharing it here. – Dimitris Feb 10 '10 at 16:11
  • 1
    i tried to follow the install instructions (the blog post instructions are obsolete) and just couldn't figure out.. is this still the best way of doing this? downloading two libraries with a total of like 200mbs then going through installation hell? [this](http://stackoverflow.com/questions/10586589/getting-a-still-image-from-the-video-output-on-the-iphone) solutions seems more reasonable – abbood Nov 28 '13 at 09:31
3

You can use lib used by ffmpeg to extract a frame like libh264

http://en.wikipedia.org/wiki/X264

Live TV apps on iPhone do that.

Hope this helps.

Thierry

thierryb
  • 3,660
  • 4
  • 42
  • 58
  • But how can i do this with the APIs Apple gives me? I don't have any video data anywhere as a variable to use one the library you suggest. I only give a path (string) to the MediaPlayer and it plays. – Dimitris May 05 '09 at 11:28
  • the path string you have is a filename; you can read from it and give the data to ffmpeg. – David Maymudes Jul 21 '09 at 13:04
0

please see the answer to my question here iphone sdk > 3.0 . Video Thumbnail? which answers this

Community
  • 1
  • 1
ADAM
  • 3,903
  • 4
  • 29
  • 45
0

Check the sample code at This URL:https://github.com/benlodotcom/MyAVControllerDemo for extracting frames from video

iosdev1111
  • 1,048
  • 1
  • 13
  • 32