We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Can anyone recommend preferred file formats for the Processing 3 Video library? I am running some tests in H264 and playback is choppy. I know that format makes a huge difference. Does anyone have experience or knowledge in this area? Which formats play smoothly?
I'm just messing with this very simple code from one of the examples right now:
import processing.video.*;
Movie myMovie;
void setup() {
size(1920, 1080);
background(0);
myMovie = new Movie(this, "temporaldraft.mp4");
myMovie.loop();
}
void draw() {
image(myMovie, 0, 0, 1920, 1080);
}
// Called every time a new frame is available to read
void movieEvent(Movie m) {
m.read();
}
Thanks!!
Answers
https://forum.Processing.org/two/discussion/15473/readme-how-to-format-code-and-text
https://forum.Processing.org/two/discussion/18536/opencv-problem-with-bootcamp#Item_1
Let me clarify:
I am not having trouble getting the video to load, but at about 2 minutes in, playback becomes choppy. I am wondering if someone has tested the video player with different file formats and documented results.
try it without the resize on line 12. is it any better?
@LizzyB -- no direct experience -- and the fact that it gets choppy after about 2 minutes sounds like a buffer / cache issue, unless the encoded images are much more information-dense in your video at two minutes in for some reason....
Other than koogs suggestion to try
image(myMovie, 0, 0);
-- this may not help, but have you tried experimenting with Movie.frameRate()?There are some comments in the Processing Movie.speed source code that might be relevant, although this is a shot in the dark: