views:

218

answers:

2

How do I get a thumbnail of a video imported from the camera roll, or the camera itself?

This has been asked before, and has been answered. However, the answers kind of suck for me.

This thread http://stackoverflow.com/questions/1259316/iphone-sdk-3-0-video-thumbnail has some options that boil down to:

  1. Crawl some filesystem directory for a JPG with the latest modification date that should correspond to the video you just picked. This is extremely messy, and involves rooting around in directories Apple would probably not really want me doing.
  2. Use ffmpeg. But this is so general that I cannot seem to figure out the steps that it would take to import ffmpeg into my project and to actually call it to extract images.

Is there really no other way? This seems like a HUGE oversight in the SDK to me. I mean the video picker has thumbnails in it, so Apple must be doing something to generate those, yet does not allow us to?

+1  A: 

We use ffmpeg, you can explore our site for hints on how to do it, eventually I want to put up a tutorial.

But right now I'm more concentrated on getting ffmpeg to play movies. Understand once you have that code the code to generate a thumbnail is just a subset of that. http://sol3.typepad.com/tagalong_developer_journa/

This tutorial here, has helped us and maybe the majority of developers using ffmpeg to get started. dranger.com/ffmpeg/ "

Finally,

Apple probably would maybe not have any problems with using the thumbnail generated from the video camera, I don't think its in a private folder however that is only created by the camera and not for videos picked from the image picker.

michelle
Thanks I will go through this and see if it works, but looks promising.
Squeegy
+1  A: 

Best method I've found... MPMoviePlayerController thumbnailImageAtTime:timeOption

E-Madd