I\'m looking for the best way (if any...) to capture continuous video to a circular buffer on the SD card, allowing the user to capture events after they have happened.
In Android's MediaRecorder
there is two way to specify the output. One is a filename and another is a FileDescriptor
.
Using static method fromSocket
of ParcelFileDescriptor
you can create an instance of ParcelFileDescriptor
pointing to a socket. Then, call getFileDescriptor
to get the FileDescriptor
to be passed to the MediaRecorder
.
Since you can get the encoded video from the socket (as if you were creating a local web server), you will be able to access individual frames of the video, although not so directly, because you will need to decode it first.