View Full Version : Help with Java wrapper for XviD core
spyder
16th June 2002, 00:43
To any XviD developer:
I am currently a member of the MCF team writing a library for reading/writing MCF files in Java. I am working on a wrapper for the XviD core so that it may be used directly by Java code through Java-Native Interface. I need to know how the actual pixel data is structured in an IMAGE. I have never worked with pixel data so any link to a resource explaining the format(YV12, RGB byte order) would be appreciated.
trbarry did a nice link to a post in the general discussion for only a little while ago which pointed to a fourcc explanation site that explained YUV quite well.
dividee also did a post that was quite intersting a little while bak. Unfortunatly your best bet is to search the forum & search google. Im sure youll find what you want :)
Good luck...oh & BTW java is evil, evil I tell you :)
Cheers,
-Nic
trbarry
16th June 2002, 09:43
Maybe the FourCC page (http://www.webartz.com/fourcc/fccyuv.htm), paying special attention to YUY2 and YV12.
- Tom
spyder
17th June 2002, 07:23
Thank you both, the FourCC page is exactly what I was looking for. I know everyone thinks Java is dumb(or evil) but it has a lot of potential. I am trying to make XviD available(with MCF) on any Java VM possible. Then a single player can be written for multiple platforms but have nearly the same speed as the native code. Also, I would like to make XviD available in MCF on Linux very quickly(I know mplayer will support it). This could be very useful sense the IBM MPEG-4 codec is locked up ATM.
Good luck to you :) Java isnt dumb, sometimes a bit over ambitious, and all the static, non-static issues & not being able to design a GUI in it easily (i.e. you tell it to do a standard layout rather than where to put the buttons,etc ), drove me mad when I use to code in it :)
Hope it goes well,
-Nic
spyder
18th June 2002, 05:26
There is a problem in the latest XviD CVS(6-17-02) that causes it to crash upon initialization from my JNI wrapper. It works fine with an older version.
Emp3r0r
21st June 2002, 05:18
well if i can see the java code, i'd love to port that over to C#, i think C# is the language of the future, it is a great language IMHO. Just give it another couple years to mature, especially the CLR. I have a feeling they are going to get JIT working really fast. People are already porting it to linux, only a matter of time until it becomes standard use. I'll go as far as to say processors will have optimizations just for CLR.
Milkman Dan
22nd June 2002, 02:19
Originally posted by Emp3r0r
well if i can see the java code, i'd love to port that over to C#, i think C# is the language of the future, it is a great language IMHO. Just give it another couple years to mature, especially the CLR. I have a feeling they are going to get JIT working really fast. People are already porting it to linux, only a matter of time until it becomes standard use. I'll go as far as to say processors will have optimizations just for CLR.
I think I'm leary of a language that doesn't have its own native libraries. It depends on the ones in the .Net framework download.
Gives me the creeps.
Nic, what were you using to make the GUI? Swing/TextPad has been super easy for me to use, and I've not had problems putting things where I want them.
Now breezyGUI...that's another story.
Emp3r0r
22nd June 2002, 21:07
the .net framework is pretty much open to implementation. It will be the library that everyone uses in the future. It is already making it's way into the linux world.
When Microsoft launched its .NET strategy, one of the objectives was to allow software to be written for a variety of different platforms. It submitted .NET to ECMA for standardization and many people now consider it to be more "open" and accessible than the Java platform.
Miguel de Icaza, the founder of Ximian is working on Mono - an open source implementation of the .NET framework which runs under Linux.
www.go-mono.com
spyder
24th June 2002, 18:54
I would like to learn more C#, especially since it resembles Java and C++ both. I feel it will take a while before C# catches on big time but I believe it will. Java has nowhere near run it's course and you should expect to see great improvements from Sun. I am positive that they too will make a CLR compiler.
@Dan: I was using Swing I think, little while back now. I hate coding on Linux (which was the platform I was using at the time). I did like certain aspects of Java...although I missed header (.h) files :)
Cheers,
-Nic
Milkman Dan
25th June 2002, 05:20
Originally posted by Nic
@Dan: I was using Swing I think, little while back now. I hate coding on Linux (which was the platform I was using at the time). I did like certain aspects of Java...although I missed header (.h) files :)
Cheers,
-Nic
Heh. Yeah, I like Swing a great deal. I can understand it from Notepad. ; )
BreezyGUI (in case anyone is wondering) is a visual builder for AWT. And it's horrific. Stay Away.
spyder
25th June 2002, 18:17
MilkmanDan have you tried the NetBeans IDE? It's great(and free) for Java editing. I have never used the GUI builder but I imagine it is pretty intuitive. I reallly like the code completion and integration with Ant.
spyder
28th June 2002, 18:20
Have any of you XviD developers ever encountered a problem with the XviD Decore returning XVID_ERR_FAIL when trying to decode any frame? My current wrapper appears to work fine for encoding but then it won't decode the encoded frame. It gives the error I stated. When looking at the XviD source I see that one reason for this is not being able to identify the frame type(I in this instance). What other reasons are there or how do I fix this?
The encoding part seems to be fine, if i change my RGB24 array up it gives me different results so it is working(somewhat?). I will wait until I integrate with JMF to work on YUV support. I am also having problems with using a resolution of 320x240, not sure why.
How can I get to see the debug output of the XviD core, I have DebugView but it doesn't show anything. The debug build of the core crashes everything, I think it has something to do with B-Frames code(JavaVM gives error at encoder.c line 387, in the core sources not mine).
ChristianHJW
1st July 2002, 18:15
none of the XviD dev people care to help Spyder on this issue ?
Nice thought to have XviD for JMF, and it seems encoding is working already, only decoding is causing probs ....
spyder
3rd July 2002, 21:35
Well, apparently the problem I was getting was caused by using the encoder and decoder at the same time. It appears to be fixed now.
ChristianHJW
4th July 2002, 08:01
Great news ! So when can we start alpha testing ? Latest JRE ( Java Runtime ) is installed, waiting in 'alpha test mode' now :D !
Link to JRE can be found here in this thread : http://forum.doom9.org/showthread.php?s=&threadid=26439
spyder
4th July 2002, 17:47
Hold on Christian, I still have to make the JMF codec. Then I will need to find an appropriate container to encode XviD into while I work on the MCF muxer/demuxer for JMF.
Milkman Dan
6th July 2002, 07:16
Just remember to keep a basic libmcf in java for me!!!
:D
Milkman Dan
7th July 2002, 02:47
Spyder has his wrapper decoding Xvid AVI to RGB32! Yay!
spyder
7th July 2002, 21:22
The decoder is currently "working". I say "working" because it does decode the video with a few problems:
1)Assembler optimiztions must be disabled
2)A few artifacts occur in files that would also fail to decode if ASM optimiztions were on(DIVIDE_ZERO exception in predict_acdc())
3)YUV output fails always(my problem not XviD core)
ChristianHJW
10th July 2002, 23:04
@Spyder :
care to post the JMF link again here ? Maybe some guys want to join us with betatesting, so the link for JMF and JRE would be necessary ...
spyder
11th July 2002, 04:46
Windows, Solaris, and Java only versions of JMF are here:
http://java.sun.com/products/java-media/jmf/2.1.1/download.html
Linux version can be gotten from Blackdown at:
http://www.blackdown.org/java-linux/jdk1.2-status/jmf-status.html
Source code and other info are available from:
http://java.sun.com/products/java-media/jmf/
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.