Size, position and rotation performance

Hi, thanks for this amazing open source software.

I don’t know what category this post should be put into.

I often use size, position and rotation filter to zoom my videos at certain points.
I’ve noticed that it hugely increases export times and I was wondering why.
I have recently discovered Avidemux and it is way faster at it, but it seems that it does the job differently.

From an user point of view it seems that Shotcut zooms the whole video and crops at the requested resolution and position, meanwhile Avidemux crops the part of the video and zooms it to the requested resolution, it can be the reason of the performance difference? I don’t really know how these two programs works so it is just a guess.

I have made some comparisons zooming a 5 minutes video of StarCraft 2 gameplay I had.
With Shotcut I put 200% zoom and export takes 20 minutes with or without hardware acceleration.
With Avidemux zooming from a 960x540 window on the same spot takes 3-4 minutes using the CPU (x264) and just 1 minute using the GPU (Nvidia H264).

I’ve noticed that exporting in Shotcut with no filter at all has similar performance as Avidemux: 3 minutes with the CPU and 1 minute with GPU acceleration while Avidemux seems pretty much to take no performance penalty when zooming or not.

I guess that I will just zoom with Avidemux and import in Shotcut but can someone explain to me why there is this huge difference?

Thank you!

Question peut-être idiote, mais avez-vous essayé avec votre vidéo test d’appliquer d’abord un filtre de recadrage (Crop: Rectangle) et ensuite le filtre SPR ?
En théorie SC ne devrait pas perdre de temps pour traiter la partie de la vidéo à l’extérieur du recadrage.

This may be a silly question, but have you tried with your test video to first apply a crop filter (Crop: Rectangle) and then the SPR filter?
In theory SC should not waste time processing the part of the video outside the crop.

Yes, I have tried it, it takes similar time as without the crop.

Is there a visual quality difference? Scaling can be done with different techniques, such as bicubic versus Lanczos versus nearest neighbor. I don’t know which method avidemux is using in your test, but Shotcut would need to be set to the same method for a fair comparison. Bicubic and Lanczos take much longer to process than nearest neighbor or bilinear, but the quality is also much higher. The difference is most visible in terms of pixelated or rolling edges when using the lower-quality techniques.

The method that Shotcut uses for scaling can be set on the Advanced section of the Export panel.

In my case by default Shocut is set to Bilinear, Avidemux to Bicubic.
Setting Avidemux to Bilinear still takes 4 minutes with CPU.

I see some visual difference but really slight.
Shotcut generates a 150 MB file while Avidemux 200MB, there are surely many other different settings.
For example I see Avidemux CRF 20 while Shotcut CRF 23 and other stuff, but I’m not really technical with this stuff.

If requested I can upload the videos on Google Drive and link.

With Shotcut do you set the ExportAdvancedParallel Processing option?

I’m trying it right now and the expected export time is 19 minutes.

PS: from now on I will test only if asked by a developer.
I have reported exactly what you need to do to replicate on Shotcut or Avidemux.
Instead of me testing every possibile setting not enabled by default by both applications, it would be good to see someone try the same test on a different setup and report back.

I’m wondering if it might be related somehow with this bug: Size, Position and Rotate - doesn't release memory when scaling? - #6 by NoName

In the bug I write about video export, but I also noticed that even editing cause memory increase. The higher memory usage the more it might have impact on performance.

I’m wondering when this bug I listed will be released in new version as I would be very curious to check if it improved performance somehow…

I’ll retest it with the new release when it is available.

Meanwhile I have downloaded kdenlive to test it there.
Default settings and same 200% zoom 5 min gameplay takes 4:49 minutes using only CPU.

PS: I’m on Fedora 36 using Shotcut with Flatpak.
To sanity check I have now tested the AppImage and it is the same.
Punch in is a very used technique and with Shotcut it slows down the render too much.
Improving this filter should be top priority in my opinion.
It would also be good that some other tests this.

This morning I have looked again at Kdenlive and found out new stuff.
Kdenlive has three filters that can do the zooming: Transform, Position and Zoom, Crop Scale and Tilt.

Transform is what I used first and takes around 4:23 minutes, good performance.
Position and Zoom, takes 20+ minutes, worse than Shotcut.
Crop Scale and Tilt takes 4:15 minutes, good performance.

Looking at Kdenlive documentation Transform and Crop S.T. are filters from the MLT project.
Link to Transform docs
Link to Crop Scale and Tilt docs

Position and Zoom doesn’t cite a filter but I guess there is one somewhere.
Link to Position and Zoom docs

At this point I suppose Shotcut uses the same Position and Zoom filter for his Size, position and rotation.

Looking for image quality there’s some difference.
Link to my drive with labeled examples.
There are 4 files: Shotcut, Avidemux, Kdenlive with Transform and with Crop S.T.

You are the judge, I can notice the differences but for what concerns me (and probably the majority of people) all the results have acceptable quality.

Would be good to have another filter to do the same job in Shotcut if modifying Size, position and rotation is not possible.

PS: I’m happy that my first guess was probably right, the job is just done differently so not a bug but lets say a performance issue, probably not even Shotcut fault if they just use the filter from somewhere else as is.

This topic was automatically closed after 90 days. New replies are no longer allowed.