I have been encoding and scripting my own videos for many years now, but today I came across something that is hard for me to understand.
I scripted a 20-second animation and looped it to be 3 minutes long. As usual I exported one version with .264 and a lower bitrate for scripting since it seems to work more smoothly in OFS, and one version in HEVC/.265 for viewing with good quality and a smaller file size.
The animation in question is very simple, with one looping motion that is exactly the same number of frames for each movement, so I was able to just copy/paste one up/down stroke, and confirmed it lined up perfectly all the way to the end in OFS. Today, however, when testing the script on the Handy with the .265 version, I noticed the timing seemed off. So, I opened the .265 version in OFS to adjust the timing, and when I went to copy/paste over the old strokes, I noticed that for some reason it wasn’t lining up perfectly anymore, despite each motion being the exact same number of frames. Like if I copy/pasted more than 20 times or so, it would start to be misaligned by about one frame.
Being suspicious that it may have something to do with the encoding, I ran the exact same script but paired with the .264, and it synced up on the Handy perfectly. Then I went in to OFS to edit the exact same script but with .264 version, and when I copy/pasted, everything lined up as expected with no gradual misalignment.
Both videos are the same length, with the same framerate, and the have EXACT same number of frames, so I am absolutely baffled as to how this could be happening with the only difference being .264 vs .265. Could anyone shed some light on this? I could share video if requested if someone thinks that could help.
At a guess, it’s a bandwidth problem. 265 encoding uses more processor, but smaller files. 264 uses less local processor, but bigger files. If your connection runs out of bandwidth, something drifts or lags. That can causd an imbalance between the script and the video.
They were literally exported from the same Premiere Pro project with the only setting changed being the encoding format, but I double-checked and confirmed neither of them are variable framerate.
This is all so weird! I just opened up the .264 again and confirmed I could copy/paste to the very end with zero drift. You didn’t use the very first stroke, did you? That’s the only one that has a few extra frames.
This is a good guess and good to know (I didn’t know that lol). However I don’t think this could cause everything, as bandwidth shouldn’t affect how OFS analyzes the frames of a video, and something about the encoding cause actions to drift when copy/pasting only in the .265 version. Honestly I’m not even sure if that is related to the syncing issue when playing, but it feels noteworthy.
Actually, this was a stupid red herring chase on my part xD
Of course there’d be drift when copy-pasting after loading the funscript since the files save points in milliseconds.
It doesn’t apply when creating the loop points on the frame grid and then copy pasting. Both videos seem fine then.
Ohhhh. That would explain a lot. I was experimenting myself and noticed that while my initial project could copy/paste with no drift. If I made a copy of that script and opened it into a new project, the drift would happen again, even though the script file was an exact copy. So I guess that explains that part. But now to figure out why it isn’t playing on the Handy the same way.
Could be. I ran some more tests, and it seems that the overall up and down motion are synced pretty well with the .265 version, and that it’s something about the midpoints that it’s playing differently. The main difference seems to be that .265 version it goes down too fast for the first half of the stroke. The motion is still very consistent though, it’s not like it slowly becomes less aligned or like the strokes aren’t consistent, it just can’t seem to get that midpoint right. I suppose that could be caused by some kind of bandwidth issue.
Well I finally decided to just do a side by side video analysis of the Handy running the same script with each version of the video, and have narrowed down the problem.
Turns out I was wrong about the midpoint being the issue, as the device moves the exact same way regardless of the version of video. The REAL issue is that, for some reason, the device is consistently 2 frames ahead for the .265 version. Here’s a GIF I made showing how the motion is the same, but you’ll notice the .265 video on the right has to be slightly behind for the device motion to line up.
CW: Furry, Monster. Click to view GIF:
@OriginalGriff So with this evidence, is it still possible that consistent misalignment could have to do with processing effort when decoding for playback?
Could be, or it’s possible that the conversion software that generated the 265 or the 264 version added / lost a couple of frames. Assuming they started with a Studio Master (probably HVEC given that’s what SLR seem to use and provide for downloads) and generated both the 265 and 264 from that, losing or adding frames isn’t unfeasible depending on what software(s) they used.
For example, we don’t know how many FPS it was originally filmed in, or the FPS for either version you are trying, but any conversion from say 59.94 FPS to say 30 FPS is going to require discarding some frames and the software doing the conversion may make different decisions for different outputs, given that the conversion modules are very likely written by different teams!