Search Unity

Bug VideoCapture API - "StopRecordingAsync" always return error

Discussion in 'Audio & Video' started by danielesuppo, Dec 4, 2022.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    We banged our heads for hours to try to understand how VideoCapture API could work under the hood, and why the demo from the docs is not working.
    Unfortunately the docs don't help at all.

    We obviously tried with a webcam playing (with its audioSource)
    In every try we did, when the video stop to record we get the error message "The VideoCapture is not in the correct state to stop recording video", and finally the video is not recorded (0Kb).

    P.S. we would have some questions about this API, to better understand if it's really actually working:
    1 - what is this state? is it an Enum? is it readable somehow?
    2 - from where the VideoCapture should take the source for the video?
    3 - from where the VideoCapture should take the source for the audio?

    Finally, what is missing from the demo code, to (maybe) make it work?

    Many thanks!