Hi folks,
i'm trying to record a video. But, i don't know why, either only the sound is been recorded or the way i am redering the recorded video is wrong. Bellow follows the codes:
The first code is related to recording video.
The bellow code stops recording video.Code:RecordControl recordControl = (RecordControl) player.getControl("RecordControl") ByteArrayOutputStream outputVideo = new ByteArrayOutputStream(); recordControl.setRecordStream(this.outputVideo); recordControl.startRecord(); this.canvasCamera.setTitle("Recording...");
The bellow code belongs to a Canvas class which implements RunnableCode:public void commandAction(Command cmd, Displayable displayable) { if(cmd == this.cmdStopRecording) { try { recordControl.stopRecord(); recordControl.commit(); } catch (IOException e) { e.printStackTrace(); } }
So, my approach records a video. However, when i try to rendering it, i just can hear the sound, and the video is not been showing!Code:InputStream in = new ByteArrayInputStream(this.outputVideo); Player player = Manager.createPlayer(in, "video/mpeg"); player.realize(); VideoControl videoControl = (VideoControl) player.getControl("VideoControl"); videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this); videoControl.setDisplayLocation(0, 0); player.start();
Thanks!

Reply With Quote

