News:

--

Main Menu

swsResize problem

Started by Dooky, February 05, 2014, 01:48:49 AM

Previous topic - Next topic

Dooky

I am using Avidemux for some time, and cannot solve one thing.
Filter swsResize does not allow me to use custom output resoluton i.e. custom aspect ratio. I cannot unlock aspect ratio, once I uncheck the box and set the desired resolution, it changes to those prefixed values (4:3, 16:9...) and rechecks Lock Aspect ratio again?
Does anyone have the same problem?  Everything else works normally more or less.

AQUAR

#1
Its meant to be like that.

If you lock the aspect, then the resize dimensions are adjusted automatically in sympathy with the source dimensions.
That is, change one and the other is adjusted automatically.
When locked, if the input and output ratios are the same then the resize will have the same aspect as the source.
When locked, if the input and output ratios are not the same then the pixel ratio is also altered in the output.
If unlocked then the resize dimensions are free to be set independently to whatever you want and the pixel ratio is set to 1:1 (I think!).

The recode will simply follow the resize dimensions.

FeRD_NYC

I think I see what Dooky is asking.

If you add swsResize, uncheck Lock Aspect Ratio and adjust your dimensions, then press OK, it'll set up the filter with those dimensions.

If you later go back to those settings by hitting Configure on an existing swsRescale instance, the dialog will come up with Lock Aspect Ratio re-enabled and the dimensions re-adjusted to locked values, effectively "losing" the settings. It's not properly stateful as to the value of Locked Aspect Ratio, so it won't recreate the existing settings exactly. (Compare that to the Asharp filter, which despite having a checkbox labeled "Unknown flag"(!) will still retain the state of that checkbox on successive uses of Configure.)

Dooky, you can just ignore that ââ,¬â€ after you hit "OK", you can see in the Active Filters list that swsRescale is correctly configured with the dimensions you selected. (They're shown in the line under the filter name.) They won't get "lost" unless you go in to reconfigure the filter; you'll have to uncheck Lock Aspect Ratio and readjust the dimensions each time you do.

Dooky

Thank's a lot for the answers. Ferd recognised my problem correctly, I hope the solution is simple as that, just to avoid going back to the resize settings, and custom ratio will be applied. In fact, preview was correct, it did apply the same aspect ratio I entered, but somehow those settings resseted, to those with locked aspect ratio as I entered the same settings again.

AQUAR

#4
@ FeRD_NYC
That's kind of a No and Yes.

When you come back to make adjustments to your saved resize filter settings, you start locked to your newly defined settings for the aspect ratio. Thats intended (I presume) and IMHO is how it should be.  Then if you again want to change your aspect ratio you need to unlock for that freedom.

The first time you use the swsResize filter it enters the stored dimensions of the source.
You need to know at least one of the other 2 aspect ratios (pixel or display) that define the video in order to properly use swsResize.
Without that you are going in blind when setting new stored dimensions whilst maintaining correct display aspect ratio for the resampled video.

The aspect ratios in the "locked box" cause convenient scaling to cater for things like the virtual pixel sizes of analog display systems.
In that regard you should be a litlle careful in initially selecting those settings if the source has a stored aspect that does not equal display aspect.

Example: source setting to 1:1 and destination setting 16:9 means:
Multiply (scale) width in the "dimensions box"  by a factor of 0.7
OR  (for same result)
Multiply (scale) the height  in the "dimensions box" by 1/0.7 = 1.43  (as adopted by swsResize)
FOR
Making allowances when dealing with virtual pixel sizes of widescreen PAL video.

Most times people resize videos whose stored aspect ratio is the same as the display aspect ratio (ie pixel aspect ratio of 1:1).
Consequently the filter works as expected as long as aspect ratios in the "locked box" are the same (one reciprocates the other).
And so most users stay blisfully unaware because they get away with it.

Its always been a confusing topic!

@ Dooky
If the resized/recoded video matches your expectation then everything has worked out fine.
Otherwise we will help out with the technicalities to get the wanted results.

   

Dooky

Thank you all,
it works normally, I am getting desired custom aspect ratio and resolution. It is enough to not to go back to the swsResize settings, as it will change entered values.

AQUAR

@ Dooky
On my system, when going back to the swsResize configuration dialog, all settings and dimensions remain as previously saved.

Except for:
The lock ratio flag is always ticked on return, as that is generally the preferred baseline for resizing.
The round to nearest multiple of 16 is always unticked on return, as that is optionally dictated by container choice.

Are you ticking the "round to nearest multiple of 16"?
If so your settings are retained, just not rounded to the nearest multiple of 16 on return.
Hence maybe why you think your input is being changed.

Which version of Avidemux and OS are you using?

FeRD_NYC

Quote from: AQUAR on February 07, 2014, 10:20:11 AM
On my system, when going back to the swsResize configuration dialog, all settings and dimensions remain as previously saved.

Except for:
The lock ratio flag is always ticked on return, as that is generally the preferred baseline for resizing.
The round to nearest multiple of 16 is always unticked on return, as that is optionally dictated by container choice.

That's not what I'm seeing, in avidemux 2.6.4 under Fedora Linux x86_64 (rpmfusion packages). The problem comes in when the filter is saved with settings in an aspect ratio that's different from the input video. Because the "lock ratio" box is always enabled on (re)open, reentering the settings dialog causes the stored dimensions to be modified so that they conform to the input aspect ratio.

Here, I'll illustrate with screenshots.

This is the initial state of the dialog, when adding the filter to a loaded video:



I configure it as follows, then hit OK:



The Filter list entry confirms that swResize is configured to transform 854x480 => 640x354. But if I press [Configure] to reopen the settings dialog, this is how it comes up:


AQUAR

#8
Yes, that happens on the windows version also.
Didn't notice that, as it stayed the same when I tried.
I thought maybe because I make sure the SAR is mod4, or mod16 but it seems not.

As you said, it looks like it is re-scaling the height of the new settings to conform to the state of the relationship defined by "Source" and "Destination" aspect ratio and the SAR of the input video. Still a fair baseline!
Set input 4:3 and output to 16:9, make a big change to the height, and get a dramatic regression on return.
Interesting!

As I said in another thread, things to do with aspect ratios can be confusing.

FeRD_NYC

I just wanted to note that this (swresize UI) bug is still present in 2.6.12 (the latest version in Fedora rpmfusion), and I assume in the latest code as well because looking at github it doesn't appear the filter code has been touched in years.

This is meant purely as a "bump" to make sure the bug isn't lost track of, not to in any way demand or pressure anyone for a fix. Apologies if that's inappropriate, if so please let me know and it won't happen again.