Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44241

Viewfinder stops updating during video recording on iOS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.4.0, 5.5.0 Alpha
    • Multimedia
    • None
    • iPad 2, iOS 8.1
    • iOS/tvOS/watchOS

      There is a QTBUG-37655, but I am not sure if it describes my problem because desription is too short.
      So, when I start video recording on my iPad 2, viewfinder freezes.
      Video recording goes well and after I stop recorder fiewfinder unfreezes.
      During video recording it seams that application stopped working.

      The root of the problem is in incorrect implementation of video recording in AVF plugin.
      In the current implementation of viewfinder AVCaptureVideoDataOutput is used.
      For recording AVCaptureMovieFileOutput is also added to the session.
      But the thing is, that these both just cannot be used at the same time.
      Check here: http://stackoverflow.com/questions/3968879/simultaneous-avcapturevideodataoutput-and-avcapturemoviefileoutput
      As soon as you add AVCaptureMovieFileOutput, previously added AVCaptureVideoDataOutput stops working.
      Moreover you even cannot use two AVCaptureVideoDataOutput at the same time. Second one will not be added.

      My solution was to use AVCaptureVideoDataOutput from renderer and save captured frame into the file using AVAssetWriter.
      My references:
      http://stackoverflow.com/questions/4944083/can-use-avcapturevideodataoutput-and-avcapturemoviefileoutput-at-the-same-time
      http://w3facility.org/question/avcapturesession-with-multiple-outputs/
      http://stackoverflow.com/questions/8058891/avcapturesession-with-multiple-outputs

      The solution works in general however there are several problems:

      • I haven't implemented audio stream writting yet
      • AVCaptureVideoDataOutput should be probably moved to separate class from renderer because now it is also used in recorder
      • I am usgin vImageRotate90_ARGB8888 for frame rotation. Maybe there is a better way
      • I am not sure how to handle device rotation during video recording. For example if I initialized asset writer as 640*480 video, how should I handle that new frame will be 480*640 because device was rotated?
      • I have not tested this on Mac
      • There is a very rare crash during recording. I suppose it is because of some multithreading problems

        1. QTBUG-44241.patch
          17 kB
          Stepan Prokipchyn
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ylopes Yoann Lopes
            korvin Stepan Prokipchyn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes