[J2ME Q&A]MMAPI"Cannot parse this type of AMR"异常之讨论
来源:互联网 发布:1024是什么网站 知乎 编辑:程序博客网 时间:2024/05/01 03:57
[J2ME] MMAPI的Cannot parse this type of AMR异常之讨论
郑昀 草拟 20060417
[现象]
首先,我们假设遇到这种错误的人们了解如何使用MMAPI,从而排除代码使用不当问题。
那么在播放3gp媒体文件时遇到“java.lang.Exception: Cannot parse this type of AMR”的异常错误,如果怀疑是ffmpeg或者其他转换程序造成的话,那么你可以把Nokia手机自己拍摄的录像传到PC机上,这种文件格式就是3gp的,而且肯定是Nokia自己的手机程序能播放的。
但是,我用mmapi在Nokia S60模拟器(Nokia Developer's Suite 3.0 for J2ME所携带的模拟器)上播放这种Nokia手机生成的3gp文件时依然得到“java.lang.Exception: Cannot parse this type of AMR”错误,没有声音,只有视频。
我用下面的命令行:
Ffmpeg转换命令
ffmpeg -y -i test.mpeg -bitexact -vcodec h263 -b 128 -r 15 -s 176x144 -acodec aac -ac 2 -ar 22500 -ab 24 -f 3gp test.3gp
或者
ffmpeg -y -i test.mpeg -ac 1 -acodec amr_nb -ar 8000 -s 176x144 -b 128 -r 15 test.3gp
转换出来的3gp文件,都只能够在Nokia S60模拟器(Nokia Developer's Suite 3.0 for J2ME所携带的模拟器)上播放视频,但没有声音,也得到了大量的java.lang.Exception: Cannot parse this type of AMR错误提示。
我为什么要怀疑仅仅是S60模拟器的问题呢。因为我把转换好的3gp文件放在我的服务器上,用
简单的播放代码
player = Manager.createPlayer(url);
player.realize();
player.prefetch();
这种代码在Nokia7610真机上运行播放这个远端资源http://218.249.90.118/toodou/test.3gp ,结果正常地播放了,有声音,有图像!
所以说明Nokia 7610真机的MMAPI对于3gp文件中的音频解析是没问题的。出问题的是S60模拟器(Nokia Developer's Suite 3.0 for J2ME所携带的模拟器)。
[小结]
综上所述,如果你遇到了"Cannot parse this type of AMR"的异常,那么请考虑你用来测试j2me程序的模拟器是不是有问题。不妨到真机上测试。
- [J2ME Q&A]MMAPI"Cannot parse this type of AMR"异常之讨论
- [J2ME Q&A]MMAPI"Cannot parse this type of AMR"异常之讨论
- *** cannot be resolved to a type异常
- WebLogic之Cannot parse POST parameters of request解决方法
- Cannot initialize a parameter of type id<NSFileManagerDelegate&
- Cannot initialize a parameter of type 'char **' with
- Cannot initialize a parameter of type 'NSString *_Nullable' with an rvalue of type ''UITouchPhase"
- cannot initialize a parameter of type 'IPCameraNightMode' with an rvalue of type 'int'
- 了解J2ME可选包MMAPI
- 了解J2ME可选包MMAPI
- weblogic Cannot parse POST parameters of request
- Cannot create encoder for Option of Product type, because Product type is represented as a row
- The resolution of ERROR C2662: cannot convert 'this' pointer from "const Class-Type" to "Class&"
- UE4 Inappropriate '*' on variable of type 'F..truct', cannot have an exposed pointer to this type'问题
- Multiple annotations found at this line: - String cannot be resolved to a type
- Multiple annotations found at this line: - String cannot be resolved to a type
- cannot assign value of type
- The type OneInterface cannot be a superinterface of OneInterfaceImpl; a superinterface must be an in
- IT职业教育(11)谈谈中小学的信息教育
- 90天也过去了,我可没忘
- 一些常用的CMD命令
- 在不断地试错中调整向前
- 用SQL在文本文件中追加数据
- [J2ME Q&A]MMAPI"Cannot parse this type of AMR"异常之讨论
- 实例C#开发TCP/IP聊天室
- 期待CSDN2007技术英雄会之IBM大中华区总架构师寇卫东
- 跨域或者Internet访问Remoting[Remoting FAQ]
- 塑造敏捷企业:第二届“敏捷中国”技术大会将于北京召开
- [MSN谈话]专注、口碑和猎头
- 物有本末、事有终始-访CSDN总裁蒋涛
- [推介]明朝的那些事儿-历史应该可以写得好看
- 利用SQL移动硬盘文件