likaiyuan559 / TikTokDemo

仿抖音录制、特效处理、裁剪视频(也与微信裁剪视频类似)
407 stars 116 forks source link

Facing video height compress issue. Need help soon #41

Open techpkm opened 3 years ago

techpkm commented 3 years ago

when we see the preview of the video in-app it looks perfect but when the video is saved to the phone gallery, the height of the video is being compressed. It should crop the video centrally to 640 x 360 instead it takes width to 360 but height is compressed to 640 instead of cropping. please help me soon with this. @likaiyuan559

po1xiao commented 3 years ago

in CameraEngine.java file ,change the setDefaultParameters method code : public static void setDefaultParameters() { if (camera == null) { return; } Parameters parameters = camera.getParameters(); if (parameters.getSupportedFocusModes().contains( Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)) { parameters.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE); } Size previewSize = CameraUtils.getLargePreviewSize(camera); PREVIEW_WIDTH = previewSize.width; //add this line PREVIEW_HEIGHT = previewSize.height; //add this line parameters.setPreviewSize(PREVIEW_WIDTH, PREVIEW_HEIGHT); .... }

techpkm commented 3 years ago

Thanks for your fast support on this. There is one more issue in this, .so files are 32bit and playstore is rejecting them. Did you have solved this?