It’s been years bug I have finally figured out how to solve my Java Media Framework issues on Linux/Ubuntu.
Basically it requires an X11 environment/framebuffer to work. To get things to work I installed the following:
sudo apt-get install xvfb
Xvfb :1 -screen 0 800x600x24&
run your java program.
So if you want to run this headless, you need to do this, then you should have no problems capturing frames, etc.