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

If quit before video processed, frames still exist in sqlite db, but produce grey screen #4

Open
jasonjmcghee opened this issue Dec 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jasonjmcghee
Copy link
Owner

For example, frames without associated video:

sqlite> select * from video_chunks order by id desc limit 2;
10|/Users/jason/Library/Application Support/today.jason.rem/output-1703765761.890883.mp4
9|/Users/jason/Library/Application Support/today.jason.rem/output-1703765749.5049071.mp4

sqlite> select * from frames order by id desc limit 2;
80|11|1|2023-12-28T12:16:06.476|System Settings
79|11|0|2023-12-28T12:16:04.026|System Settings
@jasonjmcghee jasonjmcghee added the bug Something isn't working label Dec 29, 2023
@cparish312
Copy link
Contributor

@jasonjmcghee I think I have a potential solution:

  1. Move let _ = DatabaseManager.shared.startNewVideoChunk(filePath: outputPath) to the end of the processChunk() and check that the ffmpegProcess exited successfully
  2. Change getCurrentChunkId() in DB.swift to return the chunkId of the last inserted frame
  3. Any process accessing the frames can ignore frames whose chunks don't exist in the videoChunks table

@jasonjmcghee
Copy link
Owner Author

That sounds like a good plan.

We might even be able to get all available frames joined on video chunks table (paginated) and select from those

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants