avasset

iOS offline HLS file size

梦想的初衷 提交于 2019-12-22 08:04:03
问题 In iOS 10, Apple added offline HLS. In the documentation, they mention: Important: Downloaded HLS assets are stored on disk in a private bundle format. This bundle format may change over time, and developers should not attempt to access or store files within the bundle directly, but should instead use AVFoundation and other iOS APIs to interact with downloaded assets. It appears the access to information about these files is limited. I'm trying to find the size of the stored file. Here is

Crop area different than Selected Area in iOS?

心已入冬 提交于 2019-12-21 05:02:09
问题 Here is link on github https://github.com/spennyf/cropVid/tree/master to try it out your self and see what I am talking about it would take 1 minute to test. Thanks! I am taking a video with a square to show what part of vid will be cropped. Like this: Right now I am doing this of a piece of paper with 4 lines in the square, and half a line difference on top and bottom. And then I crop the video using code I will post, but then when I display the video I see this (Ignore background and green

How does AVPlayer / AVPlayerItem inform my application about unreachable network failure?

依然范特西╮ 提交于 2019-12-21 04:38:09
问题 I’m using AVPlayer to implement a custom video player in an iOS application. To play video from the network I allocate a player: [[AVPlayer alloc] initWithURL:_URL]; Create an asset: AVURLAsset *asset = [AVURLAsset URLAssetWithURL:self.URL options:@{AVURLAssetPreferPreciseDurationAndTimingKey : @(YES)}]; load the playable key asynchronously: NSArray *keys = @[@"playable"]; [asset loadValuesAsynchronouslyForKeys:keys completionHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ for

AVAssetExportSession giving me a green border on right and bottom of output video

血红的双手。 提交于 2019-12-20 12:15:24
问题 Here's the code: AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetHighestQuality]; exporter.outputURL = outputUrl; exporter.outputFileType = AVFileTypeQuickTimeMovie; exporter.videoComposition = mainComposition; exporter.shouldOptimizeForNetworkUse = YES; [exporter exportAsynchronouslyWithCompletionHandler:^{ //completion }]; I've tried different quality settings. I always get a 1-2 pixel border running down the right

Create video with AVVideoCompositionCoreAnimationTool and AVAssetExportSession SLOW

ぃ、小莉子 提交于 2019-12-20 05:53:50
问题 I create an animation with layers and I want to export a video with that animations. So I use AVAssetExportSession, but it take a long time to export. Maybe I can use another thing? I really need help! let videoURL = NSURL.init(fileURLWithPath: "/Users/Downloads/img_2040.mp4") let audioURL = NSURL.init(fileURLWithPath: "/Users/Downloads/music_10sm.m4a") let videoAsset = AVURLAsset.init(url: videoURL as URL) let audioAsset = AVURLAsset.init(url: audioURL as URL) let mixComposition =

Need to show the image of video in mpmovieplayercontroller swift

微笑、不失礼 提交于 2019-12-20 04:17:32
问题 I have already asked this doubt in my co workers profile, but no solution yet get. Please help me to solve this problem. i am struck more than 4 hours. So far i did: I use to choose the video from gallery and display that in screen using mpmovieplayercontroller . Here i am choosing 2 video one by one. If i select first video and to display and when i move to load second video my first video screen is in black . But i need to display the video image in that player. How to do that.please help

How to fix video orientation issue in iOS

半城伤御伤魂 提交于 2019-12-17 23:07:33
问题 I am working with an app in which user picks video from Photos and uploads it to server. As my server is .Net server , the video gets rotated. I know the reason of problem is probably same as was in case of image (you may refer my earlier answer https://stackoverflow.com/a/10601175/1030951 ) , So i googled and got a code to fix video orientation , I got a code from RayWenderlich.com and modified in following way. Now my output video works fine but the video is mute. it plays but doesn't play

How to fix my orientation issue with merging videos from front and back camera

白昼怎懂夜的黑 提交于 2019-12-17 19:10:54
问题 I am merging multiply videos (implantation of pause button) and everything working fine exept when merging video from back camera with video from front camera then one of the videos comes turned upside down in the new video(merged video). My code: let mixComposition = AVMutableComposition() let videoTrack = mixComposition.addMutableTrackWithMediaType(AVMediaTypeVideo, preferredTrackID: CMPersistentTrackID()) let trackAudio = mixComposition.addMutableTrackWithMediaType(AVMediaTypeAudio,

Add a Watermark on Video after merging Video and Audio Asset into one in Swift3 iOS

为君一笑 提交于 2019-12-17 10:14:13
问题 I am working on Video based application in Swift3 . As per my requirement I have to merge Video and Audio AVAsset into one, adjust their volumes separately and save the final Video in iPhone Device gallery . This is working fine using below code: func mergeVideoAndMusicWithVolume(assetVideo: AVAsset, assetMusic: AVAsset, startAudioTime: Float64, volumeVideo: Float, volumeAudio: Float){ //To merging a video and a music and set it a volume let dirPaths = NSSearchPathForDirectoriesInDomains(

ios - AVAssetWriter Writes Video but does not record AUDIO

左心房为你撑大大i 提交于 2019-12-13 03:45:03
问题 I have been successfull in making viedo (though Blur) but have been Unsuccessful in recording audio Please Help. I am using the following code Pls go through it ans suggest some solution or a working tutorial. I am Appending the Sample Buffer using [encoder._writerInput appendSampleBuffer:sampleBuffer]; And The App Crashes When the following statement is called [encoder.audioWriterInput appendSampleBuffer:sampleBuffer]; - (void) initPath:(NSString*)path Height:(int) height andWidth:(int)