Questions tagged [avassetwriter]

on OS X API, you use an AVAssetWriter object to write media data to a new file of a specified audiovisual container type, such as a QuickTime movie file or an MPEG-4 file, with support for automatic interleaving of media data for multiple concurrent tracks

529 questions
0
votes
1 answer

Why do we need to pause the thread after appendPixelBuffer:withPresentationTime:?

When encoding a video on iOS, most of the solutions include this step : while(encoding) { if(assetWriterInput.readyForMoreMediaData) { [adaptor appendPixelBuffer:buffer withPresentationTime:presentTime]; if(buffer) …
Xys
  • 8,486
  • 2
  • 38
  • 56
0
votes
0 answers

ios didOutputSampleBuffer drop first few frames

Iam making an app which needs to record video and audio usingAVCaptureVideoDataOutputSampleBufferDelegate the functions i use are : func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from…
0
votes
1 answer

Color deviation when compose video with picture use AVFoundation

- (void)makeVideoWithImages:(NSArray *)images seconds:(CGFloat)seconds block:(void (^)(NSString *videopath)) block { ... UIImage *source = [images objectAtIndex:0]; CGSize size = CGSizeMake(source.size.width*source.scale,…
Seamus
  • 243
  • 1
  • 12
0
votes
1 answer

AVAssetWriter Recording Video in Swift?

I have successfully set up AVAssetWriter to record and save video to my camera roll. The only problem is that the first frame of the recorded video is a blank white frame. Is there a way I can get around this? What is going on?
Mike Schmidt
  • 945
  • 3
  • 12
  • 31
0
votes
1 answer

Explanation for CVBufferPool with AVAssetWriter?

So let's say I want to make a movie from images. I'm told to use AVAssetWriter, along with an AVAssetWriterInput to append CVPixelBuffer objects. But I'm very confused. Why do we create the pixel buffers, only to create a bitmap context to make a…
rocky raccoon
  • 514
  • 1
  • 8
  • 23
0
votes
1 answer

Create video of 'zooming in on an image'

I have a UIImage and I want to create a video of 'zooming in onto the image'. I've tried creating an array, var imageArray:[UIImage] = [], and then populating it with images, then using AVAssetWriter to convert the images to a video, but it doesn't…
Josh
  • 745
  • 1
  • 7
  • 22
0
votes
0 answers

AVAssetWriter live video recording with 48 KHz audio

I am using to record live video on iOS using AVAssetWriter as demonstrated in RosyWriter. The problem I have is if I set AVAudioSession preferredSampleRate to 48000 Hz, it gives lot of troubles such as audio out of sync with video. Is there a way to…
0
votes
1 answer

Value of type DictionaryLiteral<_,_> does not conform to 'Any' in coersion

I am attempting to set up custom video compression in swift based off of this SO post that used Obj-C instead (How can I reduce the file size of a video created with UIImagePickerController?). However, I am having a few issues converting the…
j. doe
  • 27
  • 4
0
votes
1 answer

Custom video size causes error in AVAssetWriter

I used the below code to render a simple video with a red rectangle. Everything works fine with _CanvasSize = CGSizeMake(320, 200);. However, the video is tearing if I change the size to _CanvasSize = CGSizeMake(321, 200); or (100, 100). Does anyone…
Incpt.Mobis
  • 199
  • 1
  • 2
  • 11
0
votes
0 answers

Create video from images with same size (height and width of all images in given cgsize) in iphone

I want to create video from images taken from gallery. I have stored images into an array. Now I want to create video from it with size user gives. I have written code but it displays black area if image is small then given size. Can anyone kindly…
0
votes
1 answer

converting images to video has wrong FPS ios

Hello guys need a quick help here; I was trying to convert images to video using a tutorial online. The process completes and plays correctly on the iphone/i-devices and on quicktime, however when played on any other player such as VLC realplayer,…
0
votes
0 answers

A video with QuickTime play no sound, with VLC play on the sound

First I use AVCaptureSession capture vedio and audio from camero and micophone. Then delegate method code below: - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer…
alpine
  • 927
  • 6
  • 17
0
votes
1 answer

Compress video THEN add watermark

So, I've been searching around for quite some time without finding any answers. Goal: Compress video for quick uploading to a server, while keeping the added watermark overlay crisp. Problem: When I compress the video, using SDAVAssetExportsession…
trdavidson
  • 1,051
  • 12
  • 25
0
votes
1 answer

Writing to Photos library with AVAssetWriter

I've written code that successfully loads an AVAsset from the Photos library using AVAssetReader, and then saves it using AVAssetWriter. Aside from a few necessary corrections (e.g., finishWriting is deprecated; replaced with didFinish... completion…
James Bush
  • 1,485
  • 14
  • 19
0
votes
0 answers

Set timestamp in CMsampleBuffer using AVAssetWriter not working

Hello I'm working in an app that is recording video + audio. The Video source is the camera, and the audio is coming from streaming. My problem happen when the communication with streaming is closed for some reason. Then in that case I switch the…
Pablo Martinez
  • 1,573
  • 12
  • 31