1

After struggling through exceptions in using jmf, on How do I remove nullpointerexception. I am able to now play my video, but only the .mov file here at this website.

But I am creating my video file using ffmpeg using images and .wav audio files.

I can create it in any format, .avi, .mov, .mp4, but what is important is I should be able to play it in my player, which I built using JMF.

Currently, I am getting this error,

Unable to handle format: FMP4, 1366x768, FrameRate=30.0, Length=3147264 0 extra bytes
java.lang.NullPointerException
        at java.awt.Container.addImpl(Unknown Source)
        at java.awt.Container.add(Unknown Source)
        at javax.swing.JFrame.addImpl(Unknown Source)
        at java.awt.Container.add(Unknown Source)
        at mediaPlayer.<init>(mediaPlayer.java:31)
        at mediaPlayer.main(mediaPlayer.java:38)

The exceptions here are not the problem, since the player works fine with lunarphases.mov on that site.

The problem is

How do I encode the video so that my jmf media player can play it and handle the format?

Thanks for all your help and I really appreciate all your efforts you would put on this problem for me. :)

4

2 に答える 2

0

http://www.oracle.com/technetwork/java/javase/formats-138492.html

avi はコンテナーであり、さまざまな方法でエンコードされたビデオを保持できます。JMF がデコードできる形式とできない形式については、このリストを確認してください。

によると; http://jeshua.me/blog/EncodingvideowithffmpegforJMF

ffmpeg -i input.mpg -vcodec mjpeg -acodec pcm_s16be -ac 2 -y ouput.mov 

動作するはずです。

于 2013-07-27T15:53:18.363 に答える