Search code examples
javamacosxuggler

Xuggler issue with MAC OS


I have made Screen Recorder And Player Application using Xuggler 5.4. I have developed with the Windows 8 64 bit environment . I have made it to work as WebStart project and launch (.jnlp) in MAC 10.8 64 bit . When I run it , Recorder Works fine but when I open it in the my Player it throws Exception

Exception in thread "stopThread" java.lang.RuntimeException : Unhandled and unknown native exception
at com.xuggle.xuggler.XugglerJNI.IContainer_open__SWIG_0( Native Method )
at com.xuggle.xuggler.IContainer.open(IContainer.java:597 )

This is not the case as far as Windows concerns... I am very much new for the Xuggler..I dont Know what this exception means..This is the line of code from where I got this exception.

if (container1.open( fileName, IContainer.Type.READ, container1.getContainerFormat()) < 0) {
            throw new IllegalArgumentException("could not open file: " + fileName);
        } 

Thanks in advance.

P.S : I Have used same version of the Java (1.7.0_65) and that of Oracle only.


Solution

  • I got Solution..

    I have changed my method of opening container.

    Previous Method :

    if (container1.open( fileName, IContainer.Type.READ, container1.getContainerFormat()) < 0) {
                throw new IllegalArgumentException("could not open file: " + fileName);
            } 
    

    New Method :

    InputStream inputStream = null ;
            try {
            inputStream = new FileInputStream(new File("fileName"));
            } catch (FileNotFoundException e2) {
                logger.error("File not found ");
            }
    
            IContainerFormat format = IContainerFormat.make();
            format.setInputFormat("flv");
    
    
            container1 = IContainer.make();
    
    
            if (container1.open( inputStream , format) < 0) {
                throw new IllegalArgumentException("could not open file: " + fileName);
            }
    

    And this works for the MAC OS..

    Strange But True