2
votes

To don't get too much heavy video files or "strange" file formats (because I need to send video post to a server for a social app), I would like to set:

  • a max video acquiring resolution (I suppose that acquiring at the max resolution of recent smartphones can produce too much heavy files to be sent to a server or to be shared with other apps);
  • a max recording time;
  • the use of the "mp4" standard format (that I suppose to be the most compatible one, however I'm not sure that this is the best choice).

All of them are possible using the Camera KIT CN1Lib? I didn't see too much documentation... The target is Android and iOS.

If it's not possible, any alternative solution?

Note for the readers: this question is specific for Codename One only.

1

1 Answers

1
votes

The video file should be mp4, but I'm not 100% sure about that.

You can set the quality using setVideoQuality. It accepts one of the following constants from the Constants interface: VIDEO_QUALITY_480P, VIDEO_QUALITY_720P, VIDEO_QUALITY_1080P, VIDEO_QUALITY_2160P, VIDEO_QUALITY_HIGHEST, VIDEO_QUALITY_LOWEST, VIDEO_QUALITY_QVGA.

I'm guessing that VIDEO_QUALITY_HIGHEST should work.

captureVideo and stopVideo start and stop capture respectively. You can limit the max time based on your code and just invoke stopVideo() based on arbitrary logic.