google / grafika

Grafika test app
Apache License 2.0
6.03k stars 1.46k forks source link

seconds of video in Continuous Capture mode becomes double after keeping it on for a while. #108

Open Gautam87 opened 4 years ago

Gautam87 commented 4 years ago

eg. It changes from 7 seconds to 14 after sometime.

sambaDaemon commented 4 years ago

In circularEncoderBuffer.java line 275, is: if (size > freeSpace) {

if you make it if (size >= freeSpace) { instead, does the problem go away?

What I think is happening, is that the head of the data ring buffer is able to overtake the tail, and the program doesn't detect when that's happened. It only tries to prevent it, with the tests in the canAdd() function.

It's OK for the buffer time span to grow, because you can fit a lot more video time in the same amount of data buffer if the video is simple, eg. camera face-down on the desk, black screen. The number of seconds of video held, is variable with the bitrate. Where it goes wrong, is if the oldest blocks in the metadata buffer start to point to video data that's already been overwritten due to buffer overlap. Then, saving a video will give bad results.

strmchsr commented 3 years ago

I am facing the same issue , any update regarding this issue? @Gautam87 @sambaDaemon

Michaelj-maker commented 1 year ago

How's the issue with