GSVideo renders only a quarter of the video frame in Eclipse on Ubuntu
in
Contributed Library Questions
•
3 years ago
I was running GSVideo 0.7 on Lucid Lynx, in Eclipse, having imported the main three Jars from the library folder along with Processing's core.jar as an import.
In this configuration, MP4 videos downloaded from Archive.org which played perfectly well in a player and an ordinary processing sketch (in the Processing IDE), show only the top left hand quarter of their pixels when rendered with the code below, derived from the example Movie loop() example.
I answered my own problem, but wanted to share it. Somehow, with OpenJDK, the rendering is busted and only visits a quarter of pixels in the blit.
I found that the secret magic step was to make sure that the sun java environment was installed...
apt-get install sun-java6-jdk sun-java6-jre
...and in Eclipse go to Window->Preferences=>Java => Installed JREs => Add
...and navigate to /usr/lib/jvm/java-6-sun
After it has processed this (takes a while and nothing seems to be happening) the new environment appears. Click the checkbox against it if you want to select it as the default JRE for all your projects, or select it within your Project.
Of course, using the Processing IDE you don't have this problem, but I find autocompletion and code refactoring so valuable, hence my Eclipse addiction.
- package com.cefn.timeshift;
- import processing.core.PApplet;
- import codeanticode.gsvideo.*;
- public class TV extends PApplet{
- GSMovie myMovie;
- public void setup() {
- size(640, 480, P3D);
- background(0);
- // Load and play the video in a loop
- myMovie = new GSMovie(this, "/home/cefn/Documents/curiosity/timeshift_tv/1960_exodus_512kb.mp4");
- myMovie.loop();
- }
- public void movieEvent(GSMovie myMovie) {
- myMovie.read();
- }
- public void draw() {
- image(myMovie, 0, 0, 640, 480);
- }
- }
1