Previous topicNext topic

VideoFile look ahead caching question

Questions, comments, feedback, etc.
Post Reply
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

VideoFile look ahead caching question

Post by pinmode »

I'm noticing some blocking/hesitation when switching to large files with VideoFile --> InputSelector. Tried all the "keep in memory" options. What's the logic here - does Magic look ahead and keep a portion of the video in memory? What are the boundaries and limitations? Could this be made configurable? I've got plenty of video (6GB) and system memory (64GB).
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: VideoFile look ahead caching question

Post by Magic »

Video playback performance is highly dependent on which format/codec the file uses. For example, mp4's are notoriously bad at rewinding quickly, because they are not designed to do that.

To quickly change frames in a video file, you want a format/codec which has every frame as a keyframe, such as Motion-JPEG. Or, I am not sure if you are familiar with Hap (http://vdmx.vidvox.net/blog/hap), but it is specifically designed for VJing, because it is decoded on the GPU. Decoding on the CPU is always much slower.

Many VJ apps force you to use certain formats/codecs precisely because of these issues. I didn't want to force anything for Magic, but it does mean you have to be more aware of what kind of video file it is.

Also, your hard drive speed is going to be very important. I wouldn't recommend working with video files unless you have a fast hard drive such as an SSD.

"Keep in memory" doesn't really have anything to do with it. But it is worth noting that there is a known VideoFile bug with the Scene Start parameter in v1.65 which will be fixed in v2.0.
pinmode
Posts: 44
Joined: Sun May 29, 2016 7:39 pm

Re: VideoFile look ahead caching question

Post by pinmode »

Eric - thanks for the response. I have SSD. I might have narrowed down the issue to image scaling. This applies to JpegFolder as well: any time I'm asking Magic to scale down an image/video from a larger resolution, the stuttering appears. But it's way less likely to stutter when the Magic window is, say, 1920x1080 and all the input files are downsized to this resolution. Whatever scale step happens really seems to affect performance a lot, and I assume that matching the input resolutions allows the system to bypass that step.

The confusing part is that it would stutter on input files that were already matched to the Magic window res, and one of them being 4k caused the stuttering across the board.

I've casually tried HAP but it doesn't make a big difference. Matching resolutions does, though.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: VideoFile look ahead caching question

Post by Magic »

I'm not sure the scaling is what's causing the slowdown. Anytime you are playing several high-resolution videos, the speed will be affected. The higher the resolution, the slower the speed. Keep in mind that playing one 4K video is like playing 4 1080p videos. And for even the fastest computers, playing 8 1080p videos or 2 4K videos at the same time can be a demanding task.

If your overall Magic resolution is set to 1080p, there's probably not much of a need to use 4K videos, as long as you are able to re-encode them to 1080p. So, yes, in this sense, matching the resolution is helpful :).
Post Reply