Exported vid "motion jerks" approx once a second

I have a 5 min video created in Shotcut using clips from a single long YT vid. All the clips are subclips so they all have the same codec and frame rate as the source. The source is 24 fps / dav1d codec / 2K 2560x1440.

I’m exporting at 24.000000 fps/Progressive scan/Bicubic interpolation using a variety of codecs including h264_qsv and libx264 all at 2560x1440.

The source 2K vid file plays smooth as silk. I have tried many codec and frame rate combinations. All export settings yield a very small periodic “jerk” visible on slow moving scenery about once a sec, especially noticeable on a 42" screen. Happens with VLC, Win media player, and Any Vid Converter’s viewer. CPU and GPU have plenty of reserve on encode and play. It looks like the jerking has to do with a frame loss jump (or similar). It is unrelated with the codec quality setting.

Ideas?

Thanks,
Chris

Is your source 24.000000 fps exactly?
Click on that clip, then Properties.
Example: 50.000000 fps clip
2022-11-14_21-40-19

Good question. The source main file and the clips were shown as 24.000280 fps. Even when I made that the exact export rate the same jumps happen.
image

Are you manually entering 24fps on the Export > Advanced screen to override some other number? Or does it default to 24?

I am explicitly checking and setting all parameters in the Advanced screen. I just tried the HEVC codec at Qual=65% but the problem seems completely unrelated to the codec.

Also, the same behavior happens when playing on a slower PC and directly on a 4K TV via a USB memory stick. In other words it has nothing to do with the player.

Since that isn’t a standard rate, the source file is probably variable frame rate. Running Convert to Edit-Friendly on it first and then editing the converted version will make the video constant frame rate and probably remove the stutter.

For some reason, my browser didn’t show @Hudson555x’s reply until today. We were asking the same question. :slight_smile:

Good suggestion Austin, that worked and thanks so much for your help.

I have created a preset for batch converting all the selected sub-clips to a fixed frame rate. I hate having to sacrifice any 2K vid quality going thru an intermediate encoding step like this but I realize the tradeoffs.

Thanks again!
–Chris

Well, I thought the rendered 2K video jerkiness was resolved after converting all the source 2k clips to a fixed frame rate but…it was “fixed” only in a short test video. When I rebuilt the vid project using the new clips the “about every second” jerkiness was still there even though the source clips and the test vid played smoothly.

To make a long story short I incrementally added more clips to the test project until the duration was the same: 4:52 (jerky vid was 4:51). Surprisingly the equal duration test video plays smoothly even though both were rendered with exactly the same settings.

The clips used in both projects is similar but not exactly the same. The video project is simple: clips on a single vid track are each separated by a dissolve transition. Audio is a single MP3 on the audio track (same for both vids); audio on the vid track is muted.

Comparison of the 2 videos:

Jerky vid:
No. of clips used - 19
Rendered Duration: 4:51, Export time: 15:25, Size: 1.834 gB

Smooth vid:
No. of clips used - 16
Rendered Duration: 4:52, Export time: 13:36, Size: 2.294 gB

Comments:
No idea why the smooth vid is much bigger in size. Both are exported w/ identical settings. I have attached the export job log for each vid.

One last thing that may be a clue: while building the first (jerky) project I did lots of editing after initially reducing the speed of many clips to fit video transitions. I didn’t like the look of the slowed-down 24fps clips so I decided to restore all to 1x speed, then I re-did most of the transitions. Maybe some parameter is “stuck” in the rendering parameters after all that editing…

Thanks much.
Chris
LOG-jerky video.txt (10.4 KB)
LOG-smooth video.txt (14.1 KB)

Can you share a small exported video with this issue along with the original source? My hunch is your hardware is not optimised for 1440p videos and/or not using properly hardware acceleration for viewing. I have issues playing 4k HEVC videos in VLC but for me MPC-HC (media player classic - home cinema) is using a different decoder and plays back smoothly even 4k60. I do have an older GPU and my cpu doesn’t come with iGPU support so it might just be a different thing.

My suggestion would be to test export at 1080p default preset, default quality and see if that also has the jerky motion, if so, then it’s likely a FPS mismatch when encoding.
I am proposing the default export at 1080p because I see your output has a rather high bitrate (kb/s:54430.77 - kb/s:64036.47) and many regular devices would have trouble playing this back.

Daniel, thanks very much for the reply. If the jerkiness was due to a limitation of my viewing (fast) PC or the viewers (VLC, Any Video Converter’s viewer, Win Media Player) then I would not expect to be able to flawlessly view so many higher bit rate 2k and 4k vids from other sources in all my viewer apps. And that also does not explain how simply re-building a new project with the same clips and export settings now renders smoothly.

I’ve copied a source 2k 24.00 fps clip and a section of the jerky exported vid @ 2k 24.00 fps that includes that clip (HERE). Remember, the “bad” project exported all moving scenery as jerky, not just a few clips. The final smooth 2K YT vid is HERE exported from the rebuilt project with the same clips and export parms.

Thanks again for all your help!

1 Like

Thanks for posting the clips. The stutter is definitely there… the 19th and 20th frames of every second (going by timecode not index) are the same image in the exported file. But every frame is unique in the source file.

I also notice that there is no accumulated drift. If I put the source on a lower track and the stutter version on an upper track and step through the timeline, the two videos stay identical except for the single duplicated frame each second. Had the duplicated frame been due to a rounding error in a speed modifier (like it’s playing the clip at 0.9999x speed), I would have expected the stutter clip to get progressively further behind the source clip. But it doesn’t.

If I create a custom Video Mode that’s 2560x1440 @ 24fps and bring the source clip into it, and export with the default settings, there is no stutter in the exported video. It works as expected.

This makes me question the frame rate of the project’s video mode. Is there a chance the project used a custom video mode that’s 2560x1440 at 23.98fps or even 23fps instead of exactly 24fps? If the video mode is lower than 24fps but then overridden to 24fps on the Advanced page at export time, then Shotcut would have to duplicate a frame to pad the difference. This would explain the duplicated frame without having a time slip in the process.

In the first project I was doing lots of experimentation with different codecs, frame rates, etc before landing on the current export settings. Also, I had reduced the play speed for around half of the clips before restoring them all (except the last clip) back to 1X.

Here’s what I think is going on: somewhere in the project file a rendering parameter is “stuck” after all that editing that is triggering a frame-handling bug. When I rebuilt a similar vid sequence (same length but diff clip order) fresh the stuttering went away.

Maybe a clue: when I open the stuttering project the default video/codec/audio settings come up with a frame rate of 25.000fps while the rebuilt project shows 24.0000. But I always set the same custom preset with 24.0000fps before exporting.

That’s definitely a problem, and likely explains the stutter. In the menu, Settings > Video Mode, which mode is selected? Another way to check is to go to the Timeline panel, click on the “Output” track head (it is above all the V1/2/3 track heads but below the Timeline toolbar), then look at the Properties panel for Output. If the frame rate shows 25fps, then the difference in frame rate between the timeline (25fps) and the overridden export setting (24fps) explains why frames are duplicated or dropped during frame rate conversion.

Video mode default in the stuttering project shows as “HD 1080p 25 fps”. Output properties also show as “25.000000 fps”.

Glad you figured it out, thanks. FYI “UHD 1440p 24 fps” is nowhere in the video mode selections. Now I know to make sure and manually edit the Output properties.

It would be a solid improvement to display a pop-up warning if the export parameters conflict with the output mode.

Anyway, thanks for helping track this down. I really do like the ShotCut UI and its flexibility. For my purposes it’s a perfect video creation solution.

Chris

1 Like

It’s possible to create a custom video mode. Go to Settings > Video Mode > Custom > Add, and create one as 2560x1440 at whatever frame rate you need, give it a name that means something to you, then use it for future projects.

The 1080p 25fps default gets used whenever an image (as opposed to a video) is dropped onto the timeline first. Since images don’t have frame rates, the default of 25fps gets applied. That is likely how the problem started.