MPMoviePlayerController alternatives on iPhone? - iphone

I am looking for alternatives to the MPMoviePlayerController on the iPhone. As a video player its functionality is very limited. According to the class reference there is no way to get the current play back time or set a new time, for example. It's just play and stop.
Are there any middleware solutions out there for iPhone video playback that offer more functionality? CRI has something in development but it has not been released. I haven't been able to find anything else.
Thanks.

Keep in mind that even though a project is GPL, that does not mean you can't contact the author's about an LGPL option on the underlying code.
A possible roll your own solution would be to use openGL as a compositing surface for the video and obtain a behind the scenes library like ffmpeg if you need to process specific video types.
NeHe has an example of rendering AVI's to openGL: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35
FFMpeg has recently been ported to iPhone and is an LGPL based product: http://geek.thinkunique.org/2008/03/05/ffmpeg-on-the-iphone/
(Note: There is some debate over the commercial use of LGPL on iPhone because the license references the phrase "dynamic" when referring to library linkage, which iPhone doesn't allow. I have not seen any project teams balk at their code being used on the iPhone statically, but you should contact the authors directly for clarification.)
Another (though GPL) version of an OpenGL video player is: http://code.google.com/p/glover/
What your getting through a solution like this is basically a bypass on the iPhone/Mac/CALayer specific technical details and leveraging an existing knowledge base of video through OpenGL which although not extensive, is still broadly supported.
If you are dealing with a specific video style, then you may want to see if a library is avaiable for the specific video format direct from the vendor instead of using a multi-purpose tool like FFMpeg. Once you have the compositing working, the video can come from most any library.
Barney

You could use AVPlayer. See the documentation
You can then get the current playback time with currentTime and seek to a specified time with seekToTime:.
You have to direct the visual output of an AVPlayer instance to an AVPlayerLayer object (subclass of CALayer). See the first listing here.

VLC has been ported to iPhone but not using the official SDK.

Related

How to encode artist name image to audio recording in iOS?

I am working for Music app in that one of the feature is recording user voice and playback the same. So far all things are in control. Yesterday I got a thought and straight away I started Googling, the idea is adding artist names and album image to my recorded audio using AVAudioRecorder, But there is not much success in it.
I also seen AV Foundation Audio Settings Constants to set the AVAudioRecorder settings, failed in this also.
You probably can use an existing audio tagging library, so after creating the file, you can use it to add the required data. I did a quick search and found this libraries:
SonatinaTag: It was made for OSX but it may work for iOS (The project state that has very few external requirements). Not sure if support writing.
TagLib-ObjC: A wrapper for the popular TagLib. Seems to be in development.
TagLib: TagLib, I know is just pure C pain, but maybe is not that hard to use.
Good luck!

Personalized Video / Facebook App - What is the best approach?

I want to build a facebook app featuring a personalized video which imports content assets from the user's facebook profile and their extended social graph and integrates these assets within the timeline. I am thinking of using Flash however a key stipulation is that the app works on mobile - and so I would need to use HTML5. My question is: Can I use Flash to build the application and then compile the app as HTML5 - or is there an alternative solution in the form of a HTML5 video toolkit with a programming layer that would allow me to build a web app / access the Facebook API?
I have done this a few times over the years and yes flash was the easiest however there are a few options which you have available to you that I know of which will be purely HTML5 based, personally I'd stay away from flash here as it will end up just getting int he way:
1- The cleanest method is to use a video compositing tool on the server side which can be programmed to accept variables. Personally I have only ever done this using ffmpeg however there a couple of alternatives which are out there.
The basic process would be to grab the media from FB then to composite them at certain point on top/below/around a base video which is sitting on the server using a shell script which you then pass the media assets to as variables. There are so many options as to how you might want this to be done, probably best id to have a look at some of these examples:
http://broadcasterproject.wordpress.com/2010/05/18/how-to-layerremix-videos-with-free-command-line-tools/
http://graphcomp.com/ffmpeg/
ffmpeg watermark without vhook?
note that last time I did this I used vhooks and custom filters, vhooks are now deprecated
This method will mean a reasonably heavy server load if your app is popular but it's probably the most robust across devices etc.
2- Use Popcorn.js, and let the processing be done on the client side. you could hard code it using css/js/html but popcorn is pretty stable although I havent seen how it runs on devices but in theory it should work (all standardized technologies). Basically the process would be to use javascript to fire the display of images overlayed on the video base file at preset cue points. Popcorn has all of the methods and means for you to do this already.
Hope this helps a bit. Good luck, sounds fun.
we realised some interactive video apps and one recent project was quite like your question describes.
We used adobe flash to track the motion - and published the project via create.js. You could have an image sequence from within create.js or put a video in a layer behind. This video would then control the player head time of the create.js motion tracked sequence via jquery.
worked fine - here a link to a testsetup with an image sequence.
Video Integration would be the next step.
http://www.jungeroemer.net/projekte/testpersvid/elftest01.html
(German text, sorry but it's nothing important to read there.
Just click the images and go for it)
you can download the sources from the link, if you need i can also upload the flash file to show you the motion tracking.

iOS video player metadata

My question is if there is any built-in interpretation of metadata by the video player in iOS. I know one can add meta-data to a video and interpret it within a custom application as shown here.
In iOS on ipod or iphone, an HTML video is opened within the native player. I would like to display a message above or below the video for a short duration at the beginning. Since I cannot control the native player I thought there might be some built in metadata interpretation that could be used to perform this. I have not been able to find any information on this.
Any help is appreciated.
The blog you've posted includes details on using the native player MPMoviePlayerController to display meta data, which is pretty cool actually. You learn something new every day! If you're making a Phonegap App I suppose you could write a plugin to do this?
Or alternatively, have a look at this other OS question which appears to suggest that it is possible - though not seemingly with metadata embedded in the actual video. Apparently this works on iOS.
Reading metadata from the <track> of an HTML5 <video> using Captionator

tutorial using gstreamer for saving photos and videos from web cam

I know that i have to use gstreamer for creating an application to capture photo and videos
from web cam. But, i could not find any documentation describing vividly the steps for creating the
same. It will be very pleased,if any one could helped me in this.
Regards,
iSight
There is a GNOME/vala tutorial in the work that shows you how to make a Gtk application to grab pictures:
https://developer.gnome.org/gnome-devel-demos/3.10/magic-mirror.vala.html.en
Saving a video is left for you to do, you'll have to use a tee to have both live preview and recording simultaneously.
Also, there is a high-level object, camerabin, for your case, but I never used it myself.
Camerabin is being used by libcheese, that is even higher level and depends on Clutter (but not Gtk), and allows you to plug effects with cheese_camera_set_effect().
Pick what you need!

How do I extract a screenshot from a video in the iPhone SDK?

I'd like to be able to take a screenshot of an MPEG recorded using the iPhone camera at set intervals.
I've seen a few ways to do this; namely compiling and using FFmpeg (Using FFMPEG library with iPhone SDK for video encoding), however it seems it's quite difficult to comply with the LGPL (http://ffmpeg.org/legal.html) for commercial use.
This term of the contract pretty much makes it useless to us:
Q: Is it perfectly alright to incorporate the whole FFmpeg core into my own commercial product?
A: You might have a problem here. There have been cases where companies have used FFmpeg in their products. These companies found out that once you start trying to make money from patented technologies, the owners of the patents will come after their licensing fees. Notably, MPEG LA is vigilant and diligent about collecting for MPEG-related technologies.
Is there any other way? - or simply by accessing the rendering layer of an MPEG am I going to be "making money from patented technologies"?
As usual - any help on this would be greatly appreciated.
Cheers!
Yes, you can do it - if I am not wrong, since iOS 3.2... at least for the videos you have on your library. After loading the movie on your MPMoviePlayerController object, do this
UIImage *aThumbnail = [player thumbnailImageAtTime:timeCode timeOption:MPMovieTimeOptionExact];
//timeCode is a time within de video length, for example: 3.12 seconds.
//player is the MPMoviePlayerController object.
Unfortunately there is no official way to grab image frames from the camera in realtime.
I encourage you to file a bug report / feature request with Apple. Many people want this. If many people request a specific feature then they might consider to actually put this in.