avfoundation

Is it possible to add track title to “Now Playing Controls” menu as Music app or ITunesU do?

烈酒焚心 提交于 2019-12-03 16:26:49
I'm, creating a player app. I've implemented 'remoteControlReceivedWithEvent:' method and could change playing state by this buttons ( apple guide ). But when something playing from 'Music' or 'iTunes U' apps, than there are a song title appear under remote controls. Is there any way to show there my own text from my player app? Thanks in advance. Yes, it's done through the MPNowPlayingInfoCenter 来源: https://stackoverflow.com/questions/9384965/is-it-possible-to-add-track-title-to-now-playing-controls-menu-as-music-app-or

How do I export UIImage array as a movie in Swift 3?

隐身守侯 提交于 2019-12-03 16:18:48
I need to export an array of UIImage and build a movie putting some text in front of the image and if it's possible music also. Can you give me an hand with code? I only have found something with Objective-c and old version of Swift . leon wu This is the first answers I posted to the question: create movie from [UIImage], Swift Following is a copy of the answer: I convert the objective-c code that posted by ’@Cameron E‘ to Swift 3, and It's working. the answer's link: @Cameron E's CEMovieMaker import Foundation import AVFoundation import UIKit public typealias CXEMovieMakerCompletion = (URL) -

AVAssetWriterInputPixelBufferAdaptor and CMTime

懵懂的女人 提交于 2019-12-03 16:16:54
问题 I'm writing some frames to video with AVAssetWriterInputPixelBufferAdaptor , and the behavior w.r.t. time isn't what I'd expect. If I write just one frame: [videoWriter startSessionAtSourceTime:kCMTimeZero]; [adaptor appendPixelBuffer:pxBuffer withPresentationTime:kCMTimeZero]; this gets me a video of length zero, which is what I expect. But if I go on to add a second frame: // 3000/600 = 5 sec, right? CMTime nextFrame = CMTimeMake(3000, 600); [adaptor appendPixelBuffer:pxBuffer

How to record video and maintain music playing in the background?

泄露秘密 提交于 2019-12-03 15:50:52
Sorry if this is a duplicate, but I couldn't find a question similar to this. I have a custom camera/recorder that I made with AVFoundation and I was wondering how to keep the audio running from other apps while recording a video because right now it stops the audio (doesn't even pause it) and then records the video If I am thinking correctly, could this be solved by adding something similar to this: [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; Sample Code: AVAudioSession *session = [AVAudioSession sharedInstance]; session.delegate = self; NSError

How to set a transparent background for an AVVideoComposition?

喜夏-厌秋 提交于 2019-12-03 15:47:42
Update - I've added a 50 reputation bounty for answering this question! I have an application that needs to put together some videos and photos to create a movie out of them. I am using AVMutableComposition for that. To be able to instruct it how the videos get composed I have to use an AVMutableVideoComposition. This thing has a property called backgroundColor and Apple Documentation says: Only solid BGRA colors are supported; patterns and other supported colors are ignored. If the rendered pixel buffer does not have alpha, the alpha value of the background color is ignored. What I understand

Setting and accessing iOS seek bar on lock screen

非 Y 不嫁゛ 提交于 2019-12-03 15:44:41
I am playing a audio file in iOS app using AVQueuePlayer/AVFoundation. i have set the MPNowPlayingInfoCenter's now playing information like album title, artist, Artwork, like this NSMutableDictionary *albumInfo = [[NSMutableDictionary alloc] init]; MPMediaItemArtwork *artworkP; UIImage *artWork = [UIImage imageNamed:album.imageUrl]; [albumInfo setObject:album.title forKey:MPMediaItemPropertyTitle]; [albumInfo setObject:album.auther forKey:MPMediaItemPropertyArtist]; [albumInfo setObject:album.title forKey:MPMediaItemPropertyAlbumTitle]; [albumInfo setObject:artworkP forKey

Exporting mp4 through AVAssetExportSession fails

北慕城南 提交于 2019-12-03 15:14:58
I start saying that I spent a lot of time searching through documentation, posts here and somewhere else, but I can't figure out the solution for this problem. I'm using AVAssetExportSession for exporting an .mp4 file stored in a AVAsset instance. What I do is: I check the isExportable property of AVAsset I then get an array of exportPresets compatible with the AVAsset instance I take the AVAssetExportPreset1920x1080 , or, if not existing I try to export the media with AVAssetExportPresetPassthrough (FYI, 100% of times, the preset I need is always contained in the list, but I tried also the

AVAudioRecorder records only the audio after interruption

纵然是瞬间 提交于 2019-12-03 14:32:01
In my application for recording and playing audio using AVAudioRecorder and AVAudioPlayer I came across a scenario in the case of incoming phone call.While the recording is in progress and if the phone call comes,the audio recorded after the phone call is only recorded.I want the recording recorded after the phone call to be the continuation of the audio recorded before the phone call. I track the interruption occuring in audio recorder using the AVAudioRecorderDelegate methods (void)audioRecorderBeginInterruption:(AVAudioRecorder *)avRecorder and (void)audioRecorderEndInterruption:

Xcode ios: Streaming of video file while recording and removed redundant personal statements

余生颓废 提交于 2019-12-03 14:15:11
问题 Can anybody suggest how I can upload video file while recording. As I am recording video using AVFoundation this will save video to some file eg. record.mov . Now my query is how I can upload this video while recording, as I want to save user time as soon as user record his/her video should be uploaded. Right now I am trying with HTTP, File stream to upload video. 回答1: I have found solution to capture videos frame while recording using AVFoundation Apple provided this sample code http:/

Mixing Images and Video using AVFoundation

房东的猫 提交于 2019-12-03 14:11:33
I'm trying to splice in images into a pre-existing video to create a new video file using AVFoundation on Mac. So far I've read the Apple documentation example, ASSETWriterInput for making Video from UIImages on Iphone Issues Mix video with static image in CALayer using AVVideoCompositionCoreAnimationTool AVFoundation Tutorial: Adding Overlays and Animations to Videos and a few other SO links Now these have proved to be pretty useful at times, but my problem is that I'm not creating a static watermark or an overlay exactly I want to put in images between parts of the video. So far I've managed