I am trying to get the duration of a video taken with the camera using UIImagePickerController on the iphone, has anyone found a solution to this?
Thanks
Daniel
You can now do this using AVFoundation you can make your movie into an AVAsset and then check the duration property
Oh, why, hello hopelessly obsolete answer. I'm afraid you're only left here as historical evidence that yes, before iOS 4 if you wanted to do anything remotely interesting on a recorded video (besides playing it) you had to implement the processing yourself.
I don't know of any framework function to do so, so I'm afraid you'll have to parse the video container yourself (which by the way, is QuickTime/.mov) to extract this info. It's not like it's not documented. Luckily since the provider is known, you can trust all info to be truthful, which you can't assume of random videos found on the web.
Related
We are creating an app using Swift on IOS that needs to use custom audio controls: a play button, a stop button, a current time/pos indicator, the duration and perhaps even a seek bar to play 1 audio file that is built into the application. My friend has worked hard on this project but so far was unable to find a solution. Is it possible using mediaplayer or is another api easier, possibly something similar to exoplayer for android apps.
Thanks.
In my opinion I would say that using AVFoundation would probably be easiest since it is built into swift you just have to do import AVFoundation and you would probably want to create an AVAudioPlayer to listen to the music. Also the API is pretty simple. If you need any help getting started I found this article on Mashable that shows how to play audio and how to control it with a custom play and pause button. https://medium.com/yay-its-erica/creating-a-music-player-app-in-swift-3-53809471f663. Also I found on Apple's documentation how to get the current time of the audio playing https://developer.apple.com/documentation/avfoundation/avaudioplayer/1387297-currenttime. I hope I was able to help and if you have anymore questions don't hesitate to ask!
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
It's easy enough to use the system-supplied user interfaces for taking pictures and movies on supported iOS devices. How do I do raw video capture and manipulation in iOS 3 and iOS 4? I'm looking for the names of the relevant classes and methods, and possibly a tutorial or reference from Apple...
You can look at these place
AVCam sample
How to Play, Record, and Edit Videos in iOS
Audio & Video Starting Point
AVCaptureSession preference
Wrapper library by Andrew
If you're looking for tuts, there are a lot here.
There good start from Apple with a lots of links that can help. See Audio & Video Starting Point.
You can't do raw video capture on iOS anymore (there used to be hack for iOS3, but now that's it's official in iOS4, they disallowed the hack).
And on iOS 4 - I believe this is the best start:
http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/03_MediaCapture.html
(Read a little, then browse to Processing Frames of Video)
Cheers,
Oded.
I need to play mp3 audio data in iPhone continuously. I am getting continuous mp3 data via server in iPhone. Now I need to play this data in iPhone. I cannot access url to play as it is of mms protocol. So, for playing this type of data which is the best method to use. Can anyone help me out with this thing.
Thanks in advance.
You have a few options sanctioned by or directly from Apple. You should look into:
Core Audio and the Audio Toolbox
The AVFoundation Framework
The OpenAL Framework
Also, you can try Matt Gallagher's AudioStreamer class. It should be able to do the job, or at least help you figure out how to do so, if you look at the code.
Between those four options, there should be something to help.
NOTE:
After writing this, I did a bit of Googling and I found this thread that discusses the possibility of streaming MMS media to iPhone. It appears that it is not possible, due to the cost of a license from Microsoft. In theory, the above-mentioned frameworks should do everything you need, but it seems that you cannot because of the licensing issue.
Good luck!
audioPlayer = [[AVAudioPlayer alloc]initWithData:<#(NSData )data#> error:<#(NSError *)outError#>];
try this else tell me more clear what you want to do
how to set the video format of the iPhone camera captured? I think that can be mov,mp4, h.2x , because iPhone can play it, but can not find API to set the video format to recording .....
also want upload the video to youtube, anyone know where can find a good open source code for this purpose, I think that this feature will be commonly and it must be done by other coder....just want save time for this purpose ..
thanks for your help
use gdata is enough
Using gdata is the way to go as Robin mentioned above. Here is a great article that outlines what you need to do and provides a great set of source code to get you started.
Hope this helps!!