Feature request: Added functionality to partial filter

Started by msundman, April 23, 2023, 07:08:02 PM

Previous topic - Next topic

msundman

Add possibility to partialize filters that change the resolution. The partial filter could add settings for how to turn the changed resolution back to the old dimensions:
  • Resize method: Bilinear / Bicubic / Lanczos-3 / Spline
  • Crop: None (stretch) / 1:1 / Zoom in / Zoom out
The "none" crop would simply stretch the picture to the old dimenstions, changing the picture's aspect ratio.
The "1:1" crop would simply cut off the parts outside the old dimensions, and fill missing pixels with black.
The "zoom in" crop would resize the picture to fill the frame (maintaining its aspect ratio), and cropping off the parts outside the old dimensions.
The "zoom out" crop would resize the picture to fit inside the frame, and fill missing pixels with black.

You cannot view this attachment.
You cannot view this attachment.

sark

Just curious. Why would you rotate the camera while filming a scene, only to want to rotate it back in post. If you're not doing this, and the whole scene is shot in portrait mode, no partial rotate would be required.
Maybe I'm missing something, just seems odd that a single scene would be shot in both portrait and landscape mode.

msundman

Quote from: sark on April 24, 2023, 10:06:00 AMMaybe I'm missing something, just seems odd that a single scene would be shot in both portrait and landscape mode.
There are so many situations. E.g., maybe the person who shot it decided to rotate their phone midway. Or maybe it's a video with multiple scenes of which one happens to be the wrong way, perhaps because the file was created by losslessly appending clips together. Or maybe you want to rotate just a couple degrees to correct a tilted horizon in one shot, but that will still alter the resolution and thus prevent the filter from being partialized. Or maybe a part of the video is upside down (perhaps because of a careless videographer), and just needs to be rotated 180 degrees, which keeps the resolution the same but still prevents the filter from being partialized. Etc. etc.

sark

Quote from: msundman on April 24, 2023, 01:16:12 PMOr maybe you want to rotate just a couple degrees to correct a tilted horizon in one shot
That makes sense.

I suspect this is a complicated function to implement though. Interesting to hear what eumagga0x2a has to say.


sark

Quote from: msundman on April 24, 2023, 01:16:12 PMOr maybe you want to rotate just a couple degrees to correct a tilted horizon in one shot, but that will still alter the resolution and thus prevent the filter from being partialized. Or maybe a part of the video is upside down (perhaps because of a careless videographer), and just needs to be rotated 180 degrees

I had a play around last night with the Fade Out/In filters. You can achieve both these actions, and most of what your dog examples display using Rotate and Zoom. All can be partialized. If you use the A & B markers you must obviously remove these after filtering or only the selected clip will be saved. Alternatively, instead of A & B markers, use the manual time span in the filter dialogue.

I'd still have a word with those shooting the footage though  ;D  ;D


msundman

Quote from: sark on April 27, 2023, 12:44:41 PMYou can achieve both these actions, and most of what your dog examples display using Rotate and Zoom. All can be partialized.
What do you mean? You can't have 2 filters inside one partial wrapper. And the Rotate filter can NOT be partialized, even if the resolution remains the same (e.g., if you rotate by 180 degrees).

sark

Quote from: msundman on April 29, 2023, 06:49:26 PMWhat do you mean? You can't have 2 filters inside one partial wrapper. And the Rotate filter can NOT be partialized, even if the resolution remains the same (e.g., if you rotate by 180 degrees).

Clearly my mistake. I'm misinterpreting your use of the term partialize. I assumed you were trying to apply a rotate to a section of a clip, ie: between 5th and 10th second of a 15 second clip. I guess you mean something else.

msundman

Quote from: sark on April 30, 2023, 09:49:32 PM
Quote from: msundman on April 29, 2023, 06:49:26 PMWhat do you mean? You can't have 2 filters inside one partial wrapper. And the Rotate filter can NOT be partialized, even if the resolution remains the same (e.g., if you rotate by 180 degrees).

Clearly my mistake. I'm misinterpreting your use of the term partialize. I assumed you were trying to apply a rotate to a section of a clip, ie: between 5th and 10th second of a 15 second clip. I guess you mean something else.
No no, that's exactly what I mean. Add a filter, then right-click on the filter and choose "Make partial". If that filter is Rotate then "Make partial" is grayed out (disabled). And it's grayed out even if you would choose "Angle: None" or "Angle: 180 degrees" in the Rotate filter settings.
You cannot view this attachment.

szlldm

As sark recommended, as a temporary solution, you can use the "Fade In" (or "Fade Out") filter:
-on the Rotate tab enable the rotation, first set Transient duration to zero, then apply desired rotation
-if necessary apply the similar process on the Zoom tab; (zoom can not be less than 1 unfortunately)
-then set the time interval, where the filter will be active (~ partial), via the "Manual time entry" or the "Set from A-B markers" (this is the preferred, if the markers are correctly set)

If you can apply some trigonometrics, then as an alternative, you could use the "Quadrilateral transformation" filter

sark

You just beat me to it Szlldm. ;D
Unfortunately, no Zoom Out. Maybe a request could be posted.

https://youtu.be/m8jvHaypHfs

EDIT:

Was posting from a phone late last night. A few additional points worth making.
When you open the Fade Out dialogue, after selecting Rotate and checking enable, the play cursor should be set to the A marker, and Duration set to zero. This enables a visual display of rotation. Likewise for Zoom. You can reset Duration after if you want a fade.

For me the most useful implimentation of this filter is gradual leveling of the video (horizons etc).

https://youtu.be/PLrCRZYBZ88

eumagga0x2a

Regarding rotation by 180 degrees, this can be achieved by two instances of the "Flip" filter, one flipping horizontally and the next one vertically.

The ability to apply a filter only to a part of a video cannot depend on filter parameters as these can be arbitrary when supplied via a project script.

sark

Quote from: eumagga0x2a on May 01, 2023, 11:07:27 PMRegarding rotation by 180 degrees, this can be achieved by two instances of the "Flip" filter, one flipping horizontally and the next one vertically.

Yes, there are a number of ways you can do different things. Was just showing msundman the possibilities.
The Stretch example is possible with the Zoom crop option in the Video/Partialize filters menu (not sure why you would want to use it though). Only zoom out cannot be achieved.

Edit... Zoom Out effect possible with Quadrilateral Transformation filter.

msundman

All the suggestions, while helpful, are for my very simplistic example, and are ignoring the actual feature request. Yes, I can rotate and scale using the quadrilateral transformation filter, which can be partialized, but that works only for some transformation operations, and it's highly inconvenient to use for such things.

My feature request is to allow all filters to be partialized, as long as they don't change the frame rate. (Although I'd be super happy to see some VFR support, too, i.e., having different parts of the video use a different frame rate, but that's a separate topic.)

sark

Quote from: msundman on June 06, 2023, 04:02:50 PMMy feature request is to allow all filters to be partialized, as long as they don't change the frame rate. (Although I'd be super happy to see some VFR support, too, i.e., having different parts of the video use a different frame rate, but that's a separate topic.)

Would certainly be useful not to have to use workarounds, but I think it is going to be some time before all filters are partialized. Personally there are still a few filters I would like to see added (ie: Levels) before prioritizing Partialize.

eumagga0x2a

Avidemux can handle to some extent VFR videos, albeit it absolutely cannot handle changes in resolution. A partilizable "rotate" filter would need to perform scaling and padding internally. As long as we rotate only by a multiple of 90°, it might be relatively easy to enhance the Zoom filter.