Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisionReplayManager.create always gives me an error #249

Closed
gariyanto opened this issue Oct 30, 2019 · 12 comments
Closed

VisionReplayManager.create always gives me an error #249

gariyanto opened this issue Oct 30, 2019 · 12 comments

Comments

@gariyanto
Copy link

Description

Got an error when running this command, although I already had a valid directory path with Mapbox recording data.

guard let visionReplayManager = try? VisionReplayManager.create(recordPath: path) else {
fatalError("(path) doesn't exist")
}

Expected behavior

visionReplayManager should be created and ready to be used for testing.

Actual behavior

Throw an exception complaining that the directory doesn't exist

Screenshots

If applicable, add screenshots to help explain your problem.

Configuration

  • Device: [e.g. iPhoneXS Max]
  • OS: [e.g. iOS13.1]
  • Frameworks versions (leave the ones you're using):
    • MapboxVisionNative [e.g. 0.10.0]
    • MapboxVisionARNative [e.g. 0.10.0]
    • MapboxVisionSafetyNative [e.g. 0.10.0]
    • MapboxVision [e.g. 0.10.0]
    • MapboxVisionAR [e.g. 0.10.0]
    • MapboxVisionSafetyNative [e.g. 0.10.0]

Additional context

When running in the simulator, I can see the content of the directory with the recorded data below:
camera.bin ml_errors.bin
config.bin motion.bin
detections.bin platform_performance.bin
device.bin position.bin
fps_snapshots.bin road_description.bin
frames.bin signs.bin
gps.bin vcore_statistics.bin
heading.bin videos.json
images vm_statistics.bin
mappings.bin world_transform.bin

@chezzdev
Copy link
Contributor

Hey @gariyanto. Could you please show how your path looks like? Also please elaborate on where the recorded session is stored. Is it a Documents dir, app bundle or something else?

@gariyanto
Copy link
Author

gariyanto commented Oct 31, 2019

Hey @gariyanto. Could you please show how your path looks like? Also please elaborate on where the recorded session is stored. Is it a Documents dir, app bundle or something else?

Hi @chezzdev, I created the storage path as follows:
let docs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
let docDir = docs[0]
storagePath = docDir.path + "/Mapbox/1/"

After recording the session, I tried to play it using VisionReplayManager but the error always happened.

@chezzdev
Copy link
Contributor

chezzdev commented Nov 1, 2019

Creating the path looks right.

I looked at the file list you've provided and I can't find a video.mp4 file in the list you've provided. This is required to replay the recorded video stream.

Did you use startRecording / stopRecording methods on VisionManager to record the session?

@gariyanto
Copy link
Author

Creating the path looks right.

I looked at the file list you've provided and I can't find a video.mp4 file in the list you've provided. This is required to replay the recorded video stream.

Did you use startRecording / stopRecording methods on VisionManager to record the session?

Yes, I used startRecording / stopRecording methods on VisionManager as described in the documentation.

@stale
Copy link

stale bot commented Dec 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the staled marked by stalebot according to config label Dec 21, 2019
@xyzbilal
Copy link

I m trying to run Example project and I m getting same error. Nothing changed in code. any solution advised??

@stale stale bot removed the staled marked by stalebot according to config label Apr 19, 2020
@xyzbilal
Copy link

Hey @gariyanto. Could you please show how your path looks like? Also please elaborate on where the recorded session is stored. Is it a Documents dir, app bundle or something else?

here is the path

let documentsPath =
            NSSearchPathForDirectoriesInDomains(.documentDirectory,
                                                .userDomainMask,
                                                true).first!
    let path = documentsPath.appending("/safety-alerts-drawing")

@gariyanto
Copy link
Author

gariyanto commented Apr 19, 2020

Hey @gariyanto. Could you please show how your path looks like? Also please elaborate on where the recorded session is stored. Is it a Documents dir, app bundle or something else?

here is the path

let documentsPath =
            NSSearchPathForDirectoriesInDomains(.documentDirectory,
                                                .userDomainMask,
                                                true).first!
    let path = documentsPath.appending("/safety-alerts-drawing")

Hi @xyzbilal, I had the same documentDirecory path as yours, and actually that's not the problem.
The problem was no video.mp4 saved into the directory. You need to implement VisionManagerDelegate then you will be able to automatically save the video.mp4 and eventually you can replay the recorded data.

@chezzdev
Copy link
Contributor

Hey @xyzbilal! If you're trying to run Safety Alerts example, please follow the steps in Getting started section of the corresponding tutorial.
You'll need to download a session and upload it to the app so that it could be replayed.
Please write back if you have any difficulties.

@xyzbilal
Copy link

@chezzdev , @gariyanto thank you very much for valuable replies. I will consider what you suggest. thanks.

@chezzdev
Copy link
Contributor

@gariyanto please try to record the sessions with the latest version of the framework: we've fixed a couple of issues with the file system, so video file should be saved more consistently.

@chezzdev
Copy link
Contributor

Considering as solved. Please reopen the issue if you still see the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants