pankaj_shukla
pankaj_shukla

Reputation: 11

RIM blackberry Record 3GP video

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.

Upvotes: 1

Views: 836

Answers (1)

Steve Zhang
Steve Zhang

Reputation: 363

  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.

Upvotes: 1

Related Questions