Which video formats to use for Java ME in mobile phones?

﹥>﹥吖頭↗ 提交于 2019-12-13 16:47:07

问题


I (or rather some of my students) have a Java ME (the platform everyone still calls J2ME) application that shows videos using JSR-135 and VideoControl. They have created mpeg-1 video files, and it works in the emulator, but not on any of the actual phones they have tried. The call to getControl in Player returns null.

I think this is because the phone can't show the video format, but the emulator can. Does that sound right?

Is there some format that they should use, in order to maximize the likelihood that various phones will be able to handle it? Yes, mpeg-1, but any specific resolution and so on?


回答1:


What you are looking for is the value of the video.encodings system property for a number of phones.

For example, the Nokia N95, firmware v20 says:

'encoding=video/3gpp encoding=video/3gpp2 encoding=video/mp4'

(generally, a phone is capable of both recording and playing back the same video formats)

Unfortunately, gathering this information on a large scale, with many devices is not cheap and i don't expect you will find a free online repository for this information.

If you look for the capability of a specific device, then the manufacturer's website for developers is probably where you will find the best information.

You might also want to see if www.deviceanywhere.com will give deals to educational organizations.




回答2:


For checking video capabilities on a phone you can try using the WURFL (wurfl.sf.net). It is a MASSIVE xml file containing a map of phone browser user-agent to phone capabilities. You could try taking a sample from that to see what the most commonly supported formats are. The API itself isn't the best but for your purposes you can probably just parse out the playback_* properties from the xml.




回答3:


In my experiments, I have come across different JVM's being quite finicky about the video frame rate as well as the video format. You can find out the video format using the System.getProperty("video.encodings"); as mentioned in the first answer. But for the video frame rate, I havent found any code to do that. You might be better off with a trial-and-error method. Hope this helps!



来源:https://stackoverflow.com/questions/968658/which-video-formats-to-use-for-java-me-in-mobile-phones

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