RIM blackberry Record 3GP video

荒凉一梦 提交于 2019-12-24 10:39:28

问题


I am writing an application that can record a 3GP video. I have tried both MMAPI and Invoke API. But have following issues.

Using MMAPI:

  1. When I record to stream, It records video in RIMM streaming format. when I try to play this video player gives error "Unsupported media format."
  2. When I record to a file. It will create a file of size 0.

Using Invoke API:

  1. In MMS mode it does not allow to record a video more than 30 seconds.
  2. In Normal mode size of the file is very large.
  3. Once I invoke camera application I do not have any control on application.

Here is my source code:

       _player = javax.microedition.media.Manager

                .createPlayer("capture://video?encoding=video/3gpp&mode=mms");

// I have tried every encoding returns from System.getProperty("video.encodings") method

        _player.realize();

        _videoControl = (VideoControl) _player.getControl("VideoControl");
        _recordControl = (RecordControl) _player.getControl("RecordControl");
        _volumeControl = (VolumeControl) _player.getControl("VolumeControl");



       String videoPath = System.getProperty("fileconn.dir.videos");
        if (videoPath == null) {
            videoPath = "file:///store/home/user/videos/";
        }


        _recordControl.setRecordLocation(videoPath + "RecordedVideo.3gp");
        _player.addPlayerListener(this);





         Field videoField = (Field) _videoControl.initDisplayMode(
                VideoControl.USE_GUI_PRIMITIVE,
                "net.rim.device.api.ui.Field");

        _videoControl.setVisible(true);
        add(videoField);

        _player.start();

ON start menu item Selection:

     try {
            _recordControl.startRecord();


        } catch (Exception e) {

            _player.close();
            showAlert(e.getClass() + "  " + e.getMessage());
        }

On stop menuItem selection:

     try {
            _recordControl.commit();

        } catch (Exception e) {

            _player.close();
            showAlert(e.getClass() + "  " + e.getMessage());
        }

Please let me if I am doing something wrong.


回答1:


  1. I have the same issue, I just know this is RIM proprietary format: http://docs.blackberry.com/en/developers/deliverables/11942/RIM_proprietary_video_format_1001586_11.jsp

  2. you get the file size 0 because this code:

_recordControl.setRecordLocation(videoPath + "RecordedVideo.3gp");

I have the same issue when I copied the RIM demo, but it is wrong. use setRecordStream() instead.



来源:https://stackoverflow.com/questions/4666057/rim-blackberry-record-3gp-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!