HMS-Core / hms-ml-demo

HMS ML Demo provides an example of integrating Huawei ML Kit service into applications. This example demonstrates how to integrate services provided by ML Kit, such as face detection, text recognition, image segmentation, asr, and tts.

Home Page:https://developer.huawei.com/consumer/en/hms/huawei-mlkit?ha_source=hms1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to support video recording in future?

edisonlao opened this issue · comments

Hello, hms-ml-face is a great library.
Is it possible to support video recording function in future?
when i using MediaRecorder to record video
the MediaRecorder will take over Camera From hms-mlsdk's MLLensSelector

Thank you for produced hms-ml-face
it will be better If record function can be supported in future

commented

Could you please tell us your detailed demand? Do you want to output the face detection result as a video?

Could you please tell us your detailed demand? Do you want to output the face detection result as a video?

Hello, I have implemented the recording function.
In order to perform ml-face while recording video,
I have modified the three methods of

①LensEngine.run()
run(Camera lens){
-return this.a(var2) ;
+return this.a(var2, lens);
}

②LensEngine.a()
a(SurfaceWrapper var1, Camera lens){
-this.e = this.d.selectLens(this.b, this.c);
+this.e = this.d.selectLens(this.b, this.c, lens);

-var2.setPreviewDisplay(var1.getSurfaceHolder());
-var2.setPreviewTexture(var1.getSurfaceTexture());
-var2.startPreview();
}
③MLLensSelector.selectLens()
selectLens(Context var1, LensRequest var2, Camera lens){
-var3 = Camera.open(var6);
+var3 = lens;

-var3.setParameters(var10);
}

So I can sync control Camera in somewhere else
final result:
preview on own SurfaceView or use MediaCodec to recording video when running FaceAnalyzer