问题
I need to play the 3gp
, mov
and mp4
videos in the media player. Right now I am using JavaFx media player but it supports only mp4
videos. So what I can do to play the other two formats as well in this player or is there any other solution also available for this. Any help and suggestions please?
jdk = 1.7
JavaFx: 2.1
回答1:
Here is a list of JavaFX supported audio and video formats.
For anything unsupported by JavaFX, you have the option of either converting them to another format or finding a way to decode them inside your application.
There are libraries available for decoding, such as JCodec or Jffmpeg
You will need to do some further research to determine your exact requirements and which formats you will need to support. Some solutions are more difficult than others.
回答2:
The supported media types can be viewed on this page: Introduction to JavaFX Media
Quoting:
Video: FLV containing VP6 video and MP3 audio; MPEG-4 multimedia container with H.264/AVC (Advanced Video Coding) video compression
What you may do is convert your videos to .flc
or .mp4
and you will be able to play them with JavaFX MediaPlayer
.
Related StackOverflow questions:
Adding other video codecs / DVD support to JavaFX 2.2
How to play other video formats in JavaFX
来源:https://stackoverflow.com/questions/26378999/javafx-mediaexception-media-unsupported-media-type-not-supported