Blackberry: how to set video resolution before recording

I need to record a video with a specific resolution (as little as possible).

private void startRecording(Player player, net.rim.device.api.ui.Manager parentManager) { try { if (player == null) { player = javax.microedition.media.Manager.createPlayer("capture://video?encoding=video/3gpp"); player.addPlayerListener(this); player.realize(); RecordControl recordControl = (RecordControl) player.getControl("RecordControl"); VideoControl videoControl = (VideoControl) player.getControl("VideoControl"); if (videoControl != null) { final Field videoField = (Field)videoControl.initDisplayMode( VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field" ); try { videoControl.setDisplaySize(1, 1); }catch(Exception e) { System.out.println(e); } videoControl.setVisible(true); UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { if(parentManager != null) { if(videoField.getIndex() == -1) { parentManager.insert(videoField, 1); } } } }); } } // here i get null CameraControl cameraControl = (CameraControl) player.getControl("CameraControl"); int[] resolutions = cameraControl.getSupportedVideoResolutions(); cameraControl.setVideoResolution(resolutions.length / 2 - 1); recordControl.setRecordLocation("test.3gp");\ recordControl.startRecord(); player.start(); }catch(Exception e) { System.out.println(e); } } 

but for some reason (CameraControl) player.getControl("CameraControl"); return null

How can I specify the permission to record video?

PS Blackberry OS 5.0 Torch 9800

Update:

If i use

 capture://video?encoding=video/3gpp&mode=mms 

or

 capture://video?encoding=video/3gpp&width=240&height=180&video_codec=MPEG-4&audio_codec=AMR 

I get event=error and eventData=2 in the PlayerListener.playerUpdate(Player player, String event, Object eventData) method

Description for eventData=2 I found here :

Invalid parameter: The parameter was specified with an invalid value.

Can someone explain to me why my parameters are wrong?

+4
source share
2 answers

This link below can help you:

Blackberry Video Recording

+1
source

The user can change the recording settings - on higher phones there are three different quality levels, but by default the recorder has the highest quality. I tried to set it to an average level of quality - 640x480, but could not find a way to do this.

Since you are asking for low quality, you may be lucky. You can specify the quality of "MMS", and the video will be of very low quality, which is what you need.

I referred to the " RIM blackberry Record 3GP video , which states that adding &mode=mms to the player string will give you MMS quality. Unfortunately, it also limits the duration to 30 seconds.

+2
source

Source: https://habr.com/ru/post/1483962/


All Articles