We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey, I'm trying to make a project where a 4K video is played. I'm having some issues with the Movie class. The videos plays for 2 seconds then the sound stops and the video plays at about 2 fps.
Here are my video file settings:
Dimensions: 3840x2160
Codecs: H.264, AAC
Duration: 1m26s
Bitrate: 30mbps
And here is my code (pretty simple for now):
import processing.video.*;
import processing.opengl.*;
Movie movie;
void setup(){
size(1280, 720, P3D);
frameRate(30);
movie = new Movie(this, "movie_30.mp4");
movie.loop();
}
void draw(){
background(0);
image(movie,0,0,1280,720);
}
void movieEvent(Movie m) {
m.read();
}
After messing with bitrates and resolutions it seems that Processing can't read 4K files, is there any way to work around this ?
Thanks !
Answers
Dunno whether those speedier methods gonna make any diff. But it doesn't hurt trying them out, does it? :-@
Thanks for the response, I tried your code but I still get the same 2 seconds of sound + slow video playback.
I had P3D on so I could apply a shader to a plane with the movie as a texture. I simply forgot to remove it for the sake of simplicity.
Just a guess, try running 64bit Processing and increasing the maximum available memory in the Processing preferences settings.
Another shot in the dark. Try video uncompressed or using a codec that is low in processor demanding, like appleProRes. The file is huge, but the performance tends to be better when playing. Heavily compressed codecs need a lot of cpu to play.
I'm running processing on a Mac so it's already 64 bits, I upped the memory to 1024Mb and saw no change, I'll try switching to AppleProRes. I might also test this on a PC to see if OSX is the issue here.
After running it on Windows (without success), with ProRes and MP4 formats, I can almost confirm that 4K is not supported as of right now by Processing.
And by extension to "gstreamer-java" framework either. Which "processing-video" is a wrapper for it: :(|)
I have the same issue, any clue to play 4K video with processing ?