unstructuredstudio/zub

Audio and video recording feature is buggy

Closed this issue · 4 comments

srish commented

Errors on video record button click:

2019-10-07 16:24:17.252 [info][tid:com.facebook.react.JavaScript] Stop the recording...
2019-10-07 16:24:17.252117-0700 zub[1576:663721] Stop the recording...
2019-10-07 16:24:17.255 [info][tid:com.facebook.react.JavaScript] { [TypeError: null is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:24:17.254886-0700 zub[1576:663721] { [TypeError: null is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }

Errors on video stop button click:

2019-10-07 16:24:49.954 [warn][tid:com.facebook.react.JavaScript] Trying to load empty source.
2019-10-07 16:24:49.954120-0700 zub[1576:663721] Trying to load empty source.
2019-10-07 16:24:50.037 [info][tid:com.facebook.react.JavaScript] Stop the recording...
2019-10-07 16:24:50.037458-0700 zub[1576:663721] Stop the recording...
2019-10-07 16:24:50.038 [info][tid:com.facebook.react.JavaScript] { [TypeError: null is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:24:50.038600-0700 zub[1576:663721] { [TypeError: null is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:24:50.041 [info][tid:com.facebook.react.JavaScript] Stop the recording...
2019-10-07 16:24:50.041620-0700 zub[1576:663721] Stop the recording...
2019-10-07 16:24:50.042 [info][tid:com.facebook.react.JavaScript] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:24:50.042260-0700 zub[1576:663721] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:24:50.094144-0700 zub[1576:648395] Could not find video URL in source '{
    isAsset = 0;
    isNetwork = 0;
    mainVer = 0;
    patchVer = 0;
    requestHeaders =     {
    };
    shouldCache = 1;
    type = "";
    uri = "";
}'
2019-10-07 16:24:50.537 [info][tid:com.facebook.react.JavaScript] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:24:50.536760-0700 zub[1576:663721] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:24:50.613 [info][tid:com.facebook.react.JavaScript] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:24:50.612844-0700 zub[1576:663721] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:25:09.795027-0700 zub[1576:658073] Task <4FDFCE95-385D-4CEC-B372-676E671B1203>.<104> finished with error - code: -1001

Errors on audio start button click:

2019-10-07 16:25:46.631 [info][tid:com.facebook.react.JavaScript] Stop the recording...
2019-10-07 16:25:46.631474-0700 zub[1576:663721] Stop the recording...
2019-10-07 16:25:46.632 [info][tid:com.facebook.react.JavaScript] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:25:46.632349-0700 zub[1576:663721] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:25:46.666 [info][tid:com.facebook.react.JavaScript] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:25:46.665880-0700 zub[1576:663721] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:25:46.959 [info][tid:com.facebook.react.JavaScript] Started Audio Recording
2019-10-07 16:25:46.959359-0700 zub[1576:663721] Started Audio Recording

Errors on audio stop button click:

2019-10-07 16:25:46.631 [info][tid:com.facebook.react.JavaScript] Stop the recording...
2019-10-07 16:25:46.631474-0700 zub[1576:663721] Stop the recording...
2019-10-07 16:25:46.632 [info][tid:com.facebook.react.JavaScript] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:25:46.632349-0700 zub[1576:663721] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:25:46.666 [info][tid:com.facebook.react.JavaScript] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:25:46.665880-0700 zub[1576:663721] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:25:46.959 [info][tid:com.facebook.react.JavaScript] Started Audio Recording
2019-10-07 16:25:46.959359-0700 zub[1576:663721] Started Audio Recording
2019-10-07 16:26:09.278 [info][tid:com.facebook.react.JavaScript] Stop the recording...
2019-10-07 16:26:09.278426-0700 zub[1576:663721] Stop the recording...
2019-10-07 16:26:09.279 [info][tid:com.facebook.react.JavaScript] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:26:09.279211-0700 zub[1576:663721] { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')]
  line: 114406,
  column: 60,
  sourceURL: 'http://10.0.0.239:8081/index.bundle?platform=ios&dev=true&minify=false' }
2019-10-07 16:26:09.699 [info][tid:com.facebook.react.JavaScript] Stopped audio recording, audio file saved at: /var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/audio_0.mp4
2019-10-07 16:26:09.699205-0700 zub[1576:663721] Stopped audio recording, audio file saved at: /var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/audio_0.mp4
2019-10-07 16:26:09.709 [info][tid:com.facebook.react.RNFFmpegModuleQueue][RNFFmpegModule.m:81] Running FFmpeg with arguments: (
    "-i",
    "file:///var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/video_0.mp4",
    "-i",
    "/var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/audio_0.mp4",
    "-c",
    copy,
    "/var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/output_0.mp4"
).

2019-10-07 16:26:09.709358-0700 zub[1576:663975] Running FFmpeg with arguments: (
    "-i",
    "file:///var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/video_0.mp4",
    "-i",
    "/var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/audio_0.mp4",
    "-c",
    copy,
    "/var/mobile/Containers/Data/Application/9BE003A4-B495-4420-8480-F5E76AD47977/Library/Caches/output_0.mp4"
).
2019-10-07 16:26:09.713 [info][tid:com.facebook.react.JavaScript] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:26:09.715256-0700 zub[1576:663721] An error occured while stoping the recording: Error: Not Recording
2019-10-07 16:26:09.735 [info][tid:com.facebook.react.JavaScript] ffmpeg version v4.2-dev-1824
2019-10-07 16:26:09.735424-0700 zub[1576:663721] ffmpeg version v4.2-dev-1824
2019-10-07 16:26:09.736 [info][tid:com.facebook.react.JavaScript]  Copyright (c) 2000-2019 the FFmpeg developers
2019-10-07 16:26:09.735891-0700 zub[1576:663721]  Copyright (c) 2000-2019 the FFmpeg developers
2019-10-07 16:26:09.736 [info][tid:com.facebook.react.JavaScript] 

2019-10-07 16:26:09.736193-0700 zub[1576:663721] 
2019-10-07 16:26:09.736 [info][tid:com.facebook.react.JavaScript]   built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)

2019-10-07 16:26:09.736442-0700 zub[1576:663721]   built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
....
2019-10-07 16:26:11.018 [info][tid:com.facebook.react.JavaScript] FFmpeg process exited with rc 0
2019-10-07 16:26:11.017642-0700 zub[1576:663721] FFmpeg process exited with rc 0
2019-10-07 16:27:09.851724-0700 zub[1576:663727] Task <085C9A30-22F1-4BD3-A593-1AC833D0174F>.<106> finished with error - code: -1001

Even though, the video, audio recording, and merging are working fine the first time (it starts to fail though in multiple attempts), I think the pattern emerging from all these errors is that on every button click, there is an attempt to stop the recording. We should investigate what really is going on here :-/

Investigate errors like this in log:

[03:32:42] I | ReactNativeJS ▶︎ { [TypeError: undefined is not an object (evaluating 'cameraRef.stopRecording')] line: 87, column: 60 }

I can't reproduce this anymore. It seems it was fixed via the change we did in update states in stopAudioRecording()

srish commented

(we still get cameraRef.stopRecording() undefined many times, other errors are gone though)

srish commented

We don't see this bug any more, closing this for now!