JFjr - the JMF/FOBS/jME video renderer

Hi,



I would like to follow the instuctions to get JMF and FOBS running, but my problem is, that I cannot register the plugin in JMF. (add Parser and Decoder to Demultiplexer Codec) Step 5 from following page doesn’t work:



http://fobs.sourceforge.net/f4jmf_first.html



Can anyone give me a hint?

Looks like FOBS released a new version since I made this… maybe they forgot to update the documentation on their site, you can try an older version perhaps.

Hi,



now I read through the instructions how to JMF and FOBS started.I could include the codecs and so on… . I can play some videofiles in the JM-Studio and all in Fobs_jmstudio, but when I try to run the TestJMFVideoImage.java in Eclipse I get this console-output:



Fobs4JMF - Native shared library found

4.55691First Position: 0, 33 Duration: 4556

Frame Rate: 29.97

Opening Thread[JMF thread: com.sun.media.PlaybackEngine@144b18f[ com.sun.media.PlaybackEngine@144b18f ] ( configureThread),9,system]

Fobs Java2DRenderer: setInputFormat

Fobs Java2DRenderer: setInputFormat

Created player for: file:C:/Programme/Java/workspace/jME/john.mpg

using normal quad

04.04.2007 12:29:19 com.jme.scene.Node attachChild

INFO: Child (quad) attached to this node (rootNode)

Fobs Java2DRenderer: start

java.lang.NullPointerException

at com.jme.scene.state.lwjgl.LWJGLTextureState.load(LWJGLTextureState.java:342)

at com.jme.scene.state.lwjgl.LWJGLTextureState.apply(LWJGLTextureState.java:444)

at com.jme.renderer.lwjgl.LWJGLRenderer.applyStates(LWJGLRenderer.java:1561)

at com.jme.renderer.lwjgl.LWJGLRenderer.draw(LWJGLRenderer.java:918)

at com.jme.scene.batch.TriangleBatch.draw(TriangleBatch.java:249)

at com.jme.scene.TriMesh.draw(TriMesh.java:270)

at com.jme.scene.Spatial.onDraw(Spatial.java:232)

at com.jme.scene.Node.draw(Node.java:505)

at com.jme.scene.Spatial.onDraw(Spatial.java:232)

at com.jme.renderer.lwjgl.LWJGLRenderer.draw(LWJGLRenderer.java:1124)

at com.jme.app.SimpleGame.render(SimpleGame.java:92)

at com.jme.app.BaseGame.start(BaseGame.java:69)

at TestJMFVideoImage.main(TestJMFVideoImage.java:190)

04.04.2007 12:29:19 com.jme.app.BaseSimpleGame cleanup

INFO: Cleaning up resources.

04.04.2007 12:29:19 com.jme.app.BaseGame start

INFO: Application ending.



Has someone an idea what could be the reason for the error?

Fobs Java2DRenderer: start


That's wrong, it should indicate the renderer that I wrote there.. which mean you probably didn't register it correctly, so I'd double check that if I were you.

Sorry, my fault.



Now I registered the correct Renderer and there are no error-messages. However now I have a black screen and nothing is displayed.



??? :?

Anything in the jME logging? Also, which "method of installation" (see my opening post) are you using?

There are no error messages in the eclipse-console. Only these lines appear:



Fobs4JMF - Native shared library found

13.32First Position: 726, 40 Duration: 13320

Frame Rate: 25



I have to abort the program manualy.



I used the 3. method of your instruction. I also tried the 4. method. I also combined both methods for testing. (I tried almost everything)

Strange… maybe you can still try 2+4? I've had all working at one point but 2+4 with the 0.4 version of FOBS is what I was using throughout developement. This played everything in jME that I could play in the JMF/FOBS player.



As another "last hope", try playing a file with no audio in it.

HI when i tried to run movie i got that errors…I followed the example and register every thing ok…the screen blank and i can only hear the audio not video and no lab…in jstudio i can seen the video…

any body have any idea… i am new to jme …



thanks





Fobs4JMF - Native shared library found

33.9135First Position: 0, 0 Duration: 33913

Frame Rate: 23.9728

Opening Thread[JMF thread: com.sun.media.PlaybackEngine@179953c[ com.sun.media.PlaybackEngine@179953c ] ( configureThread),9,system]

Fobs Java2DRenderer: setInputFormat

Fobs Java2DRenderer: setInputFormat

Created player for: c:SharedMoviesheidi.avi

Starting the player…

Fobs Java2DRenderer: start

Initializing BufferToImage…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

Giving Up

"Fobs Java2DRenderer" means either my renderer is not registered or JMF can't find it (not on the classpath correctly or something).

I have register your  render org.llama.jmf.ByteBufferRenderer in jmf . and i removed all sound renders from registry…i am sure it correctly registered as i didnot get the cannot add item message when you try to register any thing into jmf registry



One thing more i can hear the audio and no display and also program stop after few seconds…



i can run the video using jstudio and also i can send and receive that video using AVtransmit2.java and AVreceiver2.java example…only in that example the screen got blank …i have seen that code running on my friend latop and i copied all the instruction and all the libraries from my friend laptop to my desktop pc but no success…



i dont know … if you have updated version of that code.

"Fobs Java2DRenderer" is something that's printed by the java2d renderer, so that means it picked the wrong one.

Are you sure mine is the TOP one too? (try removing all the other renderers I guess, maybe then you'll get an error message or… maybe it will even work?)

HI i tried to make your render on top but it didnot make any different and after that i couldnot see any video in jstudio so then i put it down again… and then i removed all render from jregistry but result is the same…

one question more i want to implement rtp into that application where frame… is it possible to intregrate into AVreceiver2.java class.





Fobs4JMF - Native shared library found

33.9135First Position: 0, 0 Duration: 33913

Frame Rate: 23.9728

Opening Thread[JMF thread: com.sun.media.PlaybackEngine@6355dc[ com.sun.media.PlaybackEngine@6355dc ] ( configureThread),9,system]

Fobs Java2DRenderer: setInputFormat

Fobs Java2DRenderer: setInputFormat

Created player for: c:SharedMoviesheidi.avi

Starting the player…

Fobs Java2DRenderer: start

Initializing BufferToImage…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

Fobs Java2DRenderer: stop

loop the movie

Resetting Thread[Loop thread: com.omnividea.media.parser.video.VideoTrack@a45536,3,system]

Opening Thread[Loop thread: com.omnividea.media.parser.video.VideoTrack@a45536,3,system]

End of audio stream

End of video stream

33.9135First Position: 0, 0 Duration: 33913

Frame Rate: 23.9728

Setting position Thread[JMF thread: SendEventQueue: com.sun.media.content.unknown.Handler,9,system]

New position request: 0

Fobs Java2DRenderer: start

No grabbed frame

Waiting…

No grabbed frame

Waiting…

No grabbed frame

Waiting…

Giving Up



Thanks

If it's not on top it won't work. Period!



This renderer is not meant to display any video in JMF, so that is actually a good sign. It should only work in jME.



If you get no output in JMF (which means it picked my rendere) but still the Java2D renderer in your app, you're probably using 2 different JMF's or configurations files.

i tried differnet things but no sucess i am new to java so forgive any no sense…



would you like to send me your customize render into my email which is m_amjad16@yahoo.co.uk



may be i am missing the right render… i dont know…



One thing more i have two jmf.jar file one in C:Program FilesJavajre1.6.0libext folder and another in C:Program FilesJMF2.1.1elib folder where am having jmf.properties file …



Is tha also problem and also i have fobs4jmf.dll file in C:Program FilesJavajre1.6.0bin folder instead of windowssystem32 folder…

i tried to use native library location but no success.



Thanks

HI the problem is solved now it was setting problem



Can i ask one queston more about rtp

is there any jmf example avaialbe with rtp and jme like AVreceiver2.java so i can include that code into you jmfgrabber and instead it take video from url it get it from rtp session.

thanks

here's some code that initialize the renderer and fobs without the need of jmf.properties or registry editor :


private boolean isFobsInited(Vector rendList){
        String rname = null;
        for (int i = 0; i < rendList.size(); i++) {
            rname = (String) (rendList.elementAt(i));
            if (rname.equals("org.llama.jmf.ByteBufferRenderer")) {
                return true;
            }
        }
        return false;
    }
   
    private void InitFobs(){
        Vector rendererlist=PlugInManager.getPlugInList(null,null,PlugInManager.RENDERER);
        if(isFobsInited(rendererlist))return;
        Format[] ffmpegformat = new VideoFormat[] { new VideoFormat("FFMPEG_VIDEO") };
        Format[] ffmpegdesc = new ContentDescriptor[] {new ContentDescriptor("video.ffmpeg")};
        Format[] ffmpegaudio = new Format[] { new AudioFormat("FFMPEG_AUDIO") };
        Format[] supportedInputFormats = new VideoFormat[] {
           
            new VideoFormat("iv31"), //CODEC_ID_INDEO3
            new VideoFormat("iv32"),
           
            new VideoFormat("msvc"), //CODEC_ID_MSVIDEO1
            new VideoFormat("cram"),
            new VideoFormat("wham"),
           
            new VideoFormat("wmv1"), //CODEC_ID_WMV1
           
            new VideoFormat("wmv2"), //CODEC_ID_WMV2
           
            new VideoFormat("mpeg"), //CODEC_ID_MPEG1VIDEO
            new VideoFormat("mpg1"),
            new VideoFormat("mpg2"),
            new VideoFormat("pim1"),
            new VideoFormat("vcr2"),
           
            new VideoFormat("mjpa"), //CODEC_ID_MJPEG
            new VideoFormat("mjpb"),
            new VideoFormat("mjpg"),
            new VideoFormat("ljpg"),
            new VideoFormat("jpgl"),
            new VideoFormat("avdj"),
           
            new VideoFormat("svq1"), //CODEC_ID_SVQ1
            new VideoFormat("svqi"),
           
            new VideoFormat("svq3"), //CODEC_ID_SVQ3
           
            new VideoFormat("mp4v"), //CODEC_ID_MPEG4
            new VideoFormat("divx"),
            new VideoFormat("dx50"),
            new VideoFormat("xvid"),
            new VideoFormat("mp4s"),
            new VideoFormat("m4s2"),
            new VideoFormat("div1"),
            new VideoFormat("blz0"),
            new VideoFormat("ump4"),
           
           
            new VideoFormat("h264"), //CODEC_ID_H264
           
            new VideoFormat("h263"), //CODEC_ID_H263
           
            new VideoFormat("u263"), //CODEC_ID_H263P
            new VideoFormat("viv1"),
           
            new VideoFormat("i263"), //CODEC_ID_i263
           
            new VideoFormat("dvc"), //CODEC_ID_DVVIDEO
            new VideoFormat("dvcp"),
            new VideoFormat("dvsd"),
            new VideoFormat("dvhs"),
            new VideoFormat("dvs1"),
            new VideoFormat("dv25"),
           
           
            new VideoFormat("vp31"), //CODEC_ID_VP3
           
            new VideoFormat("rpza"), //CODEC_ID_RPZA
           
            new VideoFormat("cvid"), //CODEC_ID_CINEPAK
           
            new VideoFormat("smc"), //CODEC_ID_SMC
           
           
            new VideoFormat("mp42"), // CODEC_ID_MSMPEG4V2
            new VideoFormat("div2"),
           
            new VideoFormat("mpg4"), // CODEC_ID_MSMPEG4V1
           
            new VideoFormat("div3"), // CODEC_ID_MSMPEG4V3
            new VideoFormat("mp43"),
            new VideoFormat("mpg3"),
            new VideoFormat("div5"),
            new VideoFormat("div6"),
            new VideoFormat("div4"),
            new VideoFormat("ap41"),
            new VideoFormat("col1"),
            new VideoFormat("col0")
           
        };
        Format[] frgb = new VideoFormat[] {new RGBFormat()};
        Format[] alinear=new AudioFormat[]{new AudioFormat("LINEAR")};
        //registre le renderer
        PlugInManager.addPlugIn("org.llama.jmf.ByteBufferRenderer",frgb,null,PlugInManager.RENDERER);
        Vector plist=PlugInManager.getPlugInList(null,null,PlugInManager.RENDERER);
        //move the plugin to the top of the list
        Object last=plist.lastElement();
        plist.insertElementAt(last,0);
        plist.remove(plist.lastIndexOf(last));
        PlugInManager.setPlugInList(plist,PlugInManager.RENDERER);
        // try{PlugInManager.commit();}catch(Exception e){e.printStackTrace();};
        System.out.println("RENDERERn"+plist.toString());
        //registre le demultiplexer
       
        /*PlugInManager.addPlugIn("com.omnividea.media.parser.video.Parser",
                ffmpegformat,
                null,
                PlugInManager.DEMULTIPLEXER);   */
       
        Format[] In;
        Format[] Out;
        In=ffmpegdesc;
        Out=null;
        PlugInManager.addPlugIn("com.omnividea.media.parser.video.Parser",
                In,
                Out,
                PlugInManager.DEMULTIPLEXER);
        plist=PlugInManager.getPlugInList(null,null,PlugInManager.DEMULTIPLEXER);
        System.out.println("DEMULTIPLEXERn"+plist.toString());
       
        //registre les codecs
       
       
        In=ffmpegformat;
        Out=frgb;
        PlugInManager.addPlugIn("com.omnividea.media.codec.video.NativeDecoder",
                In,
                Out,
                PlugInManager.CODEC);
       
        In=ffmpegaudio;
        Out=alinear;
       
        PlugInManager.addPlugIn("com.omnividea.media.codec.audio.NativeDecoder",
                In,
                Out,
                PlugInManager.CODEC);
       
        //PlugInManager.addPlugIn("com.omnividea.media.codec.video.JavaDecoder",supportedInputFormats,defaultOutputFormats,PlugInManager.CODEC);
        In=supportedInputFormats;
        Out=frgb;
        PlugInManager.addPlugIn("com.omnividea.media.codec.video.JavaDecoder",
                In,
                Out,
                PlugInManager.CODEC);
        plist=PlugInManager.getPlugInList(null,null,PlugInManager.CODEC);
        System.out.println("CODECSn"+plist.toString());
       
        //registre le package
        Vector  packagePrefix = PackageManager.getProtocolPrefixList();
        String myPackagePrefix = new String("com.omnividea");
        packagePrefix.add(0,myPackagePrefix);
        PackageManager.setProtocolPrefixList(packagePrefix);
       
        System.out.println(PackageManager.getProtocolPrefixList().toString());
       
        return;
    }

How can i read frame from RTP session using jmfgrabber? thanks

unixseb, that is awesome. Thanks!

Did anyone run a Linux/MacOSX test for the whole thing? Sounds great…  :smiley: