Page 1 of 1

Lag with seamless loops

Posted: Thu Jul 11, 2019 2:35 am
by W3rD
Hi there,

I'm having issues getting my videos to loop seamlessly in Magic. I've had success looping videos in the past so initially I thought it was a problem with the source content, however, I now believe the issue is the "videofile" input node.

This is a loop rendered in Magic, notice the stutter at :04 and :09

[media]https://www.youtube.com/watch?v=hXNm8cYQ1dE[/media]

and this loop was rendered in Premiere which is what I'd like to achieve in Magic

[media]https://www.youtube.com/watch?v=PwduPbEH_w4[/media]

Any insight into how to solve this would be greatly appreciated!

Side note: I love playing with Magic ;D

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 2:38 am
by W3rD
Also to note I haven't done anything with the scene it's simply a default videofile input node linked to the output and rendered.

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 3:05 am
by Magic
This could be due to any number of issues. The only way to know for sure would be for you to post a link so I can download your loop and test it.

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 4:25 pm
by W3rD
Thanks for the quick reply Eric. Here's a google drive folder with a loop, magic scene, and Premiere render:

https://drive.google.com/drive/folders/ ... sp=sharing

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 5:02 pm
by W3rD
Eric,

I've discovered that adding in duplicate frames to the beginning or end of the loop (about 4 duplicates) results in a perfect loop. I've updated the folder with an example.

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 7:35 pm
by Magic
Ok, I took a look and the last couple frames of that video aren't properly encoded. I always check with VLC and it has the same problem. Did you make the loops yourself? What encoder did you use? I would suggest trying a format besides mp4 and see if it works any better... mp4 is generally not a great format for seamless looping anyway, I think some VJ apps don’t even support it.

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 8:45 pm
by W3rD
I am making the loops in Blender. I just tried rendering in mov and mkv containers using H.264 codec and its the same deal. I also see what you mean with it being the same in VLC. Does Magic's VideoFile node work off of VLC's code?

I dug around on some VLC forums and it's been a known issue in VLC for over a decade!
https://superuser.com/questions/771806/ ... stuttering

A fix in VLC seems to be coming in 4.0 tho:
https://forum.videolan.org/viewtopic.php?t=149226

I'm content just adding in additional frames to my animations to get them to work, just happy there is some solution!

Thanks again for taking the time to check it out.

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 9:00 pm
by W3rD
YES! Tried your suggestion again just starting going through every codec I could and it likes .flv and .f4v - balance is restored <3

Re: Lag with seamless loops

Posted: Thu Jul 11, 2019 9:15 pm
by Magic
Hmm ok that makes sense. Yes Magic uses ffmpeg which is a branch of the code VLC uses. I'll have to keep an eye out for their fix.

Anyway, the absolute best formats for looping are Hap (which Magic can play but not export...yet), Motion JPEG and Apple ProRes (which Magic can both play and export), or equally good is a sequence of .jpg images with Magic's JpegFolder module.

Generally speaking for looping and for jumping to specific frames you need a format where every frame is stored fully in the file, as opposed to mp4 which only saves the changes from the previous frame.