问题描述
我正在编写一个可以录制3GP视频的应用程序.我已经尝试了MMAPI和Invoke API.但是有以下问题.
I am writing an application that can record a 3GP video.I have tried both MMAPI and Invoke API. But have following issues.
使用MMAPI:
- 当我录制流媒体时,它以RIMM流媒体格式录制视频.当我尝试播放此视频播放器时出现错误
"Unsupported media format."
- 当我记录到文件中时.它将创建一个大小为0的文件.
使用调用API:
- 在彩信模式下,录制视频的时间不得超过30秒.
- 在正常模式下,文件的大小非常大.
- 一旦调用相机应用程序,我将无法对该应用程序进行任何控制.
这是我的源代码:
_player = javax.microedition.media.Manager
.createPlayer("capture://video?encoding=video/3gpp&mode=mms");
//我已经尝试过从System.getProperty("video.encodings")方法返回的每种编码方式
// 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();
在开始菜单项中选择:
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());
}
如果我做错了请让我.
推荐答案
-
我有同样的问题,我只知道这是RIM专有格式: http://docs.blackberry.com/en/developers/deliverables/11942/RIM_proprietary_video_format_1001586_11.jsp
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
您得到的文件大小为0,因为此代码:
you get the file size 0 because this code:
_recordControl.setRecordLocation(videoPath + "RecordedVideo.3gp");
复制RIM演示时,我遇到相同的问题,但这是错误的. 使用setRecordStream()
代替.
I have the same issue when I copied the RIM demo, but it is wrong. use setRecordStream()
instead.
这篇关于RIM黑莓Record 3GP视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!