Questions tagged [avassetreader]

You use an AVAssetReader object to obtain media data of an asset, whether the asset is file-based or represents an assemblage of media data from multiple sources (as with an AVComposition object).

AVAssetReader lets you:

Read raw un-decoded media samples directly from storage, obtain samples decoded into renderable forms. Mix multiple audio tracks of the asset and compose multiple video tracks (by using AVAssetReaderAudioMixOutput and AVAssetReaderVideoCompositionOutput). AVAssetReader’s pipelines are multithreaded internally. After you initiate reading with initWithAsset:error:, a reader loads and processes a reasonable amount of sample data ahead of use so that retrieval operations such as copyNextSampleBuffer (AVAssetReaderOutput) can have very low latency. Note, however, that AVAssetReader is not intended for use with real-time sources, and its performance is not guaranteed for real-time operations.

Click Here for Apple documentation.

98 questions
1
vote
0 answers

MAC - AVAssetReader for TRIM - reading samples OUT OF ORDER

I am trying to read and write the samples from a video file at a specific start point and end point for trimming a video. I am using AVAssetReader and AVAssetWriter. The logic used here is - STEP A: Create asset reader instance with the specified…
1
vote
1 answer

How to decode multiple videos simultaneously using AVAssetReader?

I'm trying to decode frames from multiple video files, and use them as opengl texture. I know how to decode a h264 file using AVAssetReader object, but it seems you have to read the frames after you call startReading in a while loop when the status…
Zhiqiang Li
  • 401
  • 7
  • 16
1
vote
1 answer

Using AVAssetWriter and AVAssetReader for Audio Recording and Playback

My app uses AVAssetReader to play songs in the iPOD library. Now I want to add the audio recording capability. I recorded audio using AVAssetWriter. I checked the resulting audio file(MPEG4AAC format) by playing it back successfully using…
Wonka Gollum
  • 79
  • 1
  • 6
1
vote
1 answer

Getting Exc_Bad_access in AVAssetReader

I am getting Exc_bad_Access exception while reading a file with AVAssetReader . The File is located in document directory and is in m4a format. Here is the code i am using. Not able to figure out where m getting it wrong: NSArray *paths =…
Tornado
  • 1,069
  • 12
  • 28
1
vote
1 answer

Get a particular frame by time value using AVAssetReader

I have checked this http://www.7twenty7.com/blog/2010/11/video-processing-with-av-foundation to get a video frame by frame. But my real requirement is to get a frame at particular time. I know that it should be possible by AVAssetReader, I wonder is…
Nikhil.T
  • 241
  • 2
  • 13
1
vote
0 answers

Incompatible pointer types assigning to 'AVAssetReaderTrackOutput *' from 'AVAssetReaderOutput *'

I am getting a warning 'incompatible pointer types assigning to 'AVAssetReaderTrackOutput *' from 'AVAssetReaderOutput *'' while using GPUImage library. I have edited 'GPUImageMovie.m' so as to enable audio playback as suggested here. Please help…
QUserS
  • 512
  • 5
  • 13
1
vote
1 answer

combining video files with AVAssetWriter

I'm attempting to combine a number of video files into a single file with specific codec settings. I used to use the AVAssetExportSession for this, but I now need more control over the codec than the AVAssetExportSession offers. Below I've posted…
agressen
  • 459
  • 1
  • 5
  • 17
1
vote
1 answer

Unable to export AVPlayerItem

I'm using AVQueuePlayer to do playback of a list of videos in our app. I'm trying to cache the videos that are played by AVQueuePlayer so that the video doesn't have to be downloaded each time. So, after the video finishes playing, I attempt to save…
1
vote
0 answers

The samples read from the AVAssetReader is not in order

I have a trouble while reading the sample buffers from a file using AVAssetreader. The timestamps of the samples read seem to be out of order. Is this the expected result or is there something I am doing wrong. Below is the reading and writing code…
borncrazy
  • 1,589
  • 1
  • 12
  • 9
1
vote
0 answers

Why I am receiving only a few audio samples per second when using AVAssetReader on iOS?

I'm coding something that: record video+audio with the built-in camera and mic (AVCaptureSession), do some stuff with the video and audio samplebuffer in realtime, save the result into a local .mp4 file using AVAssetWritter, then (later) read…
Dr_cube
  • 11
  • 1
1
vote
0 answers

Record video with music from iPod Library

I am trying to record video using AVFoundation (AVCaptureOutput + AVAssetWriter) while playing Audio from iPod library instead of the microphone. I took RosyWriter sample code and removed the AudioInput and instead setup AVAssetReader for reading…
1
vote
1 answer

CIImage:imageWithCVPixelBuffer: doesn't work with buffer from copyNextSampleBuffer?

Long time lurker, first time poster. I'm trying to decode a video and save each frame as an image. (The video is one I previously recorded that plays fine on the iPhone.) My first step is to make sure I'm getting correct image data, so this little…
John Fehr
  • 91
  • 2
  • 8
1
vote
1 answer

can AVAssetReader be used to stream audio data over bluetooth/wifi?

According to AVAssetReader documentation AVAssetReader is not intended for use with real-time sources, and its performance is not guaranteed for real-time operations. Yet I see examples of it working with the audio queue services.. which is real…
abbood
  • 23,101
  • 16
  • 132
  • 246
1
vote
1 answer

Setting Time Range in AVAssetReader causes freeze

So, I'm trying to do a simple calculation over previously recorded audio (from an AVAsset) in order to create a wave form visual. I currently do this by averaging a set of samples, the size of which is determined by dividing the audio file size by…
Aaron Hayman
  • 8,492
  • 2
  • 36
  • 63
1
vote
2 answers

iOS Capture Video from Camera and Mixing with audio file in real time

I am trying to capture video from iPhone camera and save the movie mixed with an audio file. I can capture the video with the audio (from mic) with no problems. What I want to do is capture the video but instead of mic audio, use a music track (a…