RIM 黑莓录制 3GP 视频

发布于 2024-10-11 13:27:25 字数 1903 浏览 3 评论 0原文

我正在编写一个可以录制 3GP 视频的应用程序。 我已经尝试过 MMAPI 和 Invoke API。但有以下问题。

使用 MMAPI:

  1. 当我录制流时,它以 RIMM 流格式录制视频。当我尝试播放此视频播放器时出现错误“不支持的媒体格式。”
  2. 当我录制到文件时。它将创建一个大小为 0 的文件。

使用 Invoke API:

  1. 在 MMS 模式下,它不允许录制超过 30 秒的视频。
  2. 在正常模式下,文件的大小非常大。
  3. 一旦我调用相机应用程序,我就无法对应用程序进行任何控制。

这是我的源代码:

       _player = javax.microedition.media.Manager

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

// 我已尝试从 System.getProperty("video.encodings") 方法返回的每个编码

        _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();

在开始菜单项选择上:

     try {
            _recordControl.startRecord();


        } catch (Exception e) {

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

在停止菜单项选择上:

     try {
            _recordControl.commit();

        } catch (Exception e) {

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

如果我做错了什么,请告诉我。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与君绝 2024-10-18 13:27:25
  1. 我也有同样的问题,我只知道这是 RIM 专有格式:
    http://docs.blackberry.com/en/developers/deliverables/11942 /RIM_proprietary_video_format_1001586_11.jsp

  2. 你得到文件大小 0,因为此代码:

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

我在复制 RIM 演示时遇到了同样的问题,但它是错误的。
使用 setRecordStream() 代替。

  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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文