avfoundation

How to play m3u audio stream in iOS app

十年热恋 提交于 2019-11-28 05:14:30
问题 I'm trying to create an iOS/iPhone radio app using Xcode 4.5.2. I wanted to stream @"http://xx.xxxxxxx.com/8111/radio.m3u" with play, pause, volume control and able to play on background feature/multitasking. I've added AVFoundation , Mediaplayer and AudioToolBox frameworks thus far. I've added play, pause and slider objects to xib. ViewController.h @interface ViewController : UIViewController @property (strong,nonatomic) MPMoviePlayerController *myPlayer; @property (weak, nonatomic) IBOutlet

CoreAnimation - Opacity Fade In and Out Animation Not Working

久未见 提交于 2019-11-28 05:01:58
I'm attempting to create a fairly simple CoreAnimation for use in an AVComposition . My goal is to create a CALayer which, through various sublayers, fades a title in and out, then fades in an out images. A slideshow, basically. This is being exported to a .mov using AVAssetWriter . With help from the WWDC 2011 AVEditDemo, I've been able to get a title and images appearing. The problem is that they are all on screen at the same time! I have created each layer with an opacity of 0.0. I have then added an CABasicAnimation to fade them from 0.0 to 1.0, using the following code: CABasicAnimation

How can I convert mov to mp4 on ios device [closed]

筅森魡賤 提交于 2019-11-28 04:43:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am writing ios app that should convert mov file to mp4. Is there any ways to that using AVFoundation or something similar? I will really appreciate your help! Thanks! 回答1: Do you need to do AV media transcoding

AVPlayer buffering, pausing notification, and poster frame

我只是一个虾纸丫 提交于 2019-11-28 04:35:07
I have some questions related to AVPlayer which are: When we pause the AVPlayer through [player pause] does the AVPlayer keep buffering the video from the network or does it just stop? I couldn't get any info related to this in apple's documentation. Also, is it possible to force the AVPlayer to keep buffering while in pause, so that if we have the paused video is in waiting for the first video to be ended then we wouldn't find any gap in between the videos? On pausing the AVPlayer can we have any event on [player pause] . Can we show still image on AVPlayer for some seconds? Thanks djromero 1

iOS: How to use MPMoviePlayerController

好久不见. 提交于 2019-11-28 04:31:33
I've created a blank project (iOS) and put this in my viewDidLoad: NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"m4v"]; MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]]; [self presentMoviePlayerViewControllerAnimated:playerController]; [playerController.moviePlayer play]; When the app starts all I get is a white screen with error messages in the log : <Error>: CGContextSaveGState: invalid context 0x0 <Error>: CGContextClipToRect: invalid context 0x0 <Error>:

What's the best way of live streaming iphone camera to a media server?

荒凉一梦 提交于 2019-11-28 04:13:32
According to this What Techniques Are Best To Live Stream iPhone Video Camera Data To a Computer? is possible to get compressed data from iphone camera, but as I've been reading in the AVFoundation reference you only get uncompressed data. So the questions are: 1) How to get compressed frames and audio from iPhone's camera? 2) Encoding uncompressed frames with ffmpeg's API is fast enough for real-time streaming? Any help will be really appreciated. Thanks. You most likely already know.... 1) How to get compressed frames and audio from iPhone's camera? You can not do this. The AVFoundation API

iOS 4: Remote controls for background audio

牧云@^-^@ 提交于 2019-11-28 03:49:53
I'm currently attempting to set up background audio for an app I'm developing for iOS 4. The app doesn't have a dedicated music player viewController , however, unlike other background audio apps such as Pandora, which makes the task a bit more confusing. I've set the appropriate Info.plist settings correctly and have an AVAudioPlayer object in my app delegate which is accessible from everywhere. When the user plays a song, I replace the AVAudioPlayer with a new one initialized with the song and play it. This all works great, except now I have no idea how to go about supporting remote control

iOS: error in __connection_block_invoke_2: Connection interrupted [duplicate]

一个人想着一个人 提交于 2019-11-28 03:33:45
问题 This question already has an answer here : What is “error in __connection_block_invoke_2: Connection interrupted” in iOS? (1 answer) Closed 4 years ago . Xcode/iOS 8/AVFoundation related error in console: error in __connection_block_invoke_2: Connection interrupted I am just adding AVCaptureVideoDataOutput to Apple's sample app 'AVCamManualUsingtheManualCaptureAPI' What I added was: // CoreImage wants BGRA pixel format NSDictionary *outputSettings = @{ (id)kCVPixelBufferPixelFormatTypeKey :

Using AVAssetReader to read (stream) from a remote asset

故事扮演 提交于 2019-11-28 03:20:44
My main goal is to stream a video from a server, and cut it frame by frame while streaming (so that it can be used by OpenGL). For that, I've used this code that I found everywhere on the Internet (as I recall it was from Apple's GLVideoFrame sample code): NSArray * tracks = [asset tracks]; NSLog(@"%d", tracks.count); for(AVAssetTrack* track in tracks) { NSLog(@"type: %@", [track mediaType]); initialFPS = track.nominalFrameRate; width = (GLuint)track.naturalSize.width; height = (GLuint)track.naturalSize.height; NSError * error = nil; // _movieReader is a member variable @try { self.

AVPlayer stops playing and doesn't resume again

梦想的初衷 提交于 2019-11-28 03:04:34
In my application I have to play audio files stored on a web server. I'm using AVPlayer for it. I have all the play/pause controls and all delegates and observers there which work perfectly fine. On playing small audio files everything works great. When a long audio file is played it also starts playing fine but after some seconds the AVPlayer pauses the playing (most probably to buffer it). The issue is it doesn't resume on its own again. It keeps in a pause state and if I manually press the play button again it plays smoothly again. I want to know why AVPlayer doesn't resume automatically