google / grafika

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

ContinuousCaptureActivity -- Incorrect buffer time #86

Closed pro-softs closed 6 years ago

pro-softs commented 6 years ago

Hi, I am setting the buffer time for the circular buffer in the ContinuousCaptureActivity to 20 sec but the timer keeps on increasing much more than 20 sec and the captured video is of higher length too. Can anyone please explains this behavior as I think it is happening to higher buffer values like in 40 sec buffer time, the timer goes up to 80 sec (just double).

Thanks.

pro-softs commented 6 years ago

Any Help??

zhogar commented 6 years ago

Hi, this is related to the codec used. The fact is that you have a fixed buffer size, but at low video quality, the mpeg codec squeezes the data much more.

zhogar commented 6 years ago

Try to shoot the video in sunny weather, make sure the video takes 20 seconds. This will be the high quality you set when creating the object.

zhogar commented 6 years ago

See the code: public CircularEncoderBuffer(int bitRate, int frameRate, int desiredSpanSec) {

and comment: adjust bit rate based on frame rate?