Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In startVideoRecording I call (I assume you are calling this at some point)</p> <pre><code>[_capSession startRunning] ; </code></pre> <p>In stopVideoRecording I do not call</p> <pre><code>[_videoWriterInput markAsFinished]; [_videoWriter endSessionAtSourceTime:lastSampleTime]; </code></pre> <p>The markAsFinished is more for use with the block style pull method. See requestMediaDataWhenReadyOnQueue:usingBlock in AVAssetWriterInput for an explanation. The library should calculate the proper timing for interleaving the buffers. </p> <p>You do not need to call endSessionAtSrouceTime. The last time stamp in the sample data will be used after the call to</p> <pre><code>[_videoWriter finishWriting]; </code></pre> <p>I also explicitly check for the type of capture output.</p> <pre><code>else if( captureOutput == _audioOutput) { [self newAudioSample:sampleBuffer]; } </code></pre> <p>Here is what I have. The audio and video come through for me. It is possible I changed something. If this does not work for you then I will post everything I have.</p> <pre><code>-(void) startVideoRecording { if( !_isRecording ) { NSLog(@"start video recording..."); if( ![self setupWriter] ) { NSLog(@"Setup Writer Failed") ; return; } [_capSession startRunning] ; _isRecording = YES; } } -(void) stopVideoRecording { if( _isRecording ) { _isRecording = NO; [_capSession stopRunning] ; if(![_videoWriter finishWriting]) { NSLog(@"finishWriting returned NO") ; } //[_videoWriter endSessionAtSourceTime:lastSampleTime]; //[_videoWriterInput markAsFinished]; //[_audioWriterInput markAsFinished]; NSLog(@"video recording stopped"); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload