Android: I want to record a possible video with low quality and send it in discrete packets. Is it possible? How would you approach him?

Basically, I want you to be able to send a few seconds with a “live” feed delay of less than 3 g. This is normal if it is of very poor quality. I could go with four bits in shades of gray if necessary (although 128-256 colors are preferable). I would be ready to go with 160x120 at> 1fps, if necessary. Completely uncompressed at these most complex settings means an oversaturated connection with low bandwidth.

Should I just consider pictures as images? Can anyone find out what Bitmapfactory can do with JPEG files of the lowest quality?

Should I look in PNG or GIF? I understand that solid fields work best with them. I'm not sure I can depend heavily on solid fields other than a good part of the sky, as I'm looking for control of the drone that sends the “video”. A faux video with a delay of a few seconds is wonderful and even preferable because I expect to lose and reconnect to the server often.

I get as 128k on "3g" with a decent signal, but I can't depend on it for sure. I can do any necessary side of the decoding server - this should not be a problem.

So, I ask you, Stack, you want to see from your smartphone via the Internet and can not depend on a good connection. How do you approach him?

+5
source share
1

, .

, JPEG. . , .

1920x1080 - 150-300 .

    camera.setOneShotPreviewCallback(new PreviewCallback() {
            @Override
            public void onPreviewFrame(byte[] data, Camera camera) {
                try {
                    Camera.Parameters parameters = camera.getParameters();
                    Size size = parameters.getPreviewSize();
                    YuvImage image = new YuvImage(data, parameters.getPreviewFormat(),
                            size.width, size.height, null);
                    File file = new File(getCacheDir().getPath() + "/out.jpg");
                    FileOutputStream filecon = new FileOutputStream(file);
                    image.compressToJpeg(
                            new Rect(0, 0, image.getWidth(), image.getHeight()), 90,
                            filecon);
                } catch (FileNotFoundException e) {
                }
            }
        });

, , .

Camera.Parameters parameters = camera.getParameters();
List<Camera.Size> previewSizes = parameters.getSupportedPreviewSizes();
imageWidth = previewSizes.get(0).width;
imageHeight = previewSizes.get(0).height;
parameters.setPreviewSize(imageWidth, imageHeight);
camera.setParameters(parameters);
+1

All Articles