HDMI Still image capture

Discussion in 'Development' started by Ivo Skalický, Sep 21, 2015.

  1. Ivo Skalický

    Ivo Skalický New Member

    We have bought couple of X9 recorders hoping that we will be able to develop our own app. We took a look at your github repository https://github.com/zidootech/zidoorecorder and created own app that records video without any problems. But we need not only to capture video to MP4 but also to capture still images any time user wants to. There is no API calls in JNI wrapper com.mstar.hdmirecorder for capturing images, I was also unsucessful with attemps to render SurfaceView to Bitmap (probably due to use of HW acceleration). The only working function I have found is getPixelRgb in PictureManager, but it returns only value off 1 pixel and it is extremly slow when I try to fetch whole screen (1920×1080 px).

    Is there any way to capture image to bitmap? If we solve this problem, we would probably use your device for our app and order much more devices.
  2. Dylan

    Dylan Member Zidoo TECH Supporter

    Hi, Ivo Skalicky:
    Sorry to reply you late. We don't known how to cputure still image in encoder side.
    You can send a key to system(if you can), then system will take snapshoot of the screen, and the picture will be stored on the storage.

    There is no more key on remote control. so we remove this function key. you can insert this key into system input quenue, becuare you have the system permission, if you sign your apk with system key.

    / * On TV remotes, corresponds to the screenshot key. */
    public static final int KEYCODE_SCREENSHOT = 265;
  3. papiguy

    papiguy Member

    Why creating an app to capture still images, while the feature already exists:
    Let appear the control bar at the bottom of the screen (click with the mouse at the bottom right of the screen, and the second button from the right allows to capture image of the whole screen.
    The result is in "Flash/Pictures/Screenshots" Screenshot_2015-12-14-18-19-32.png
  4. Dylan

    Dylan Member Zidoo TECH Supporter

    HAHA you are right. I thought he wanted his app to do this self.
  5. Ivo Skalický

    Ivo Skalický New Member

    Hello, thank you for your replies, but I have already solved my problem. This is DEVELOPMENT thread, solution with clicking some button is really off-topic. To share my solution:
    1) Open Camera object with ID = 5, even thought there is no Camera ID 5 listed in available devices (it is hardcoded feature in MStar toolkit)
    2) Setup common parameters of Camera object + you can set special parameters from MCamera class. Personally I am using these:
    camParams.set(MCamera.Parameters.KEY_TRAVELING_RES, MCamera.Parameters.E_TRAVELING_RES_1920_1080);
    camParams.set(MCamera.Parameters.KEY_TRAVELING_MODE, MCamera.Parameters.E_TRAVELING_ALL_VIDEO);
    camParams.set(MCamera.Parameters.KEY_TRAVELING_MEM_FORMAT, MCamera.Parameters.E_TRAVELING_MEM_FORMAT_YUV422_YUYV);
    camParams.set(MCamera.Parameters.KEY_MAIN_INPUT_SOURCE, MCamera.Parameters.MAPI_INPUT_SOURCE_HDMI);
    camParams.set(MCamera.Parameters.KEY_TRAVELING_FRAMERATE, frameRate);
    camParams.set(MCamera.Parameters.KEY_TRAVELING_SPEED, MCamera.Parameters.E_TRAVELING_SPEED_FAST);
    3) Call Camera.takePicture as in every other android app.
  6. limam sami

    limam sami New Member

    Hi Ivo,
    I tried the code below and the app crashes so can you send me your code.

Share This Page