[guardian-dev] CipherCam FPS Bug and Potential Solution

Nathan of Guardian nathan at guardianproject.info
Tue Mar 31 10:24:37 EDT 2015


On Mon, Mar 30, 2015, at 10:28 AM, poly wrote:
> First of all I'd like to thank you very much for this app/library, it
> has proven quite helpful.

Great to have someone using it actively!

> I've noticed a FPS bug in CipherCam, namely that the video recorded with
> the app plays at too high an FPS. To investigate this, I opened up the
> MJPEG files with VLC and found that the frame rate is always 20 FPS.

Right.

> The problem the actual FPS varies from device to device and even across
> recordings. With some debugging, I've found that my phone records
> between 10-14 FPS.

Yeah, and that is why we do try to estimate it in real time during
capture.

> It appears that the current jcodec implementation is disregarding the
> 'mFPS' variable set in the code. Instead, only the 'timescale' variable
> in 'ImageToMJPEGMOVMuxer.java' (set to 20 by default) is considered.

Interesting. I have been trying to understand the MJPEG-MP4 spec better
to see if you can really provide per frame/keyframe FPS indicators or
not. I haven't found any spec where that is indicated.

> A potential solution would be to set up a temporary onPreviewFrame
> callback when the camera is first initialized to detect the FPS the
> phone is capable of recording, then passing it to the Muxer constructor
> in place of the 'timescale' variable.

That makes a lot of sense. As soon as the camera opens, we can already
estimate what the FPS is, so that once the user presses the record
button, we can set the appropriate default value.

Thanks for the idea.


-- 
  Nathan of Guardian
  nathan at guardianproject.info


More information about the guardian-dev mailing list