Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th February 2024, 17:55   #1601  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by StvG View Post
You can use ImageWriter to save 16-bit png. You need a 16-bit planar RGB before ImageWriter and DevIL.dll (usually is shipped with the avs+ installation). Example script:
Code:
source
some filtering
MapNLQ # output is 12-bit
z_convertformat(pixel_type="rgbp16")
ImageWriter(...)
But the saved png seems to have only 8bit per channel (RGB24). Or have I overlooked something?
Does it have to be saved as 'ebmp'? but then only Avisynth can read it?


Edit:
My mistake, had opened the png with VDub2 which apparently always opens png in RGB24 format. With FFImageSource the color format is then displayed correctly
__________________
Live and let live

Last edited by gispos; 20th February 2024 at 19:54.
gispos is offline   Reply With Quote
Old 20th February 2024, 18:04   #1602  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by PoeBear View Post
I'm curious, since this post is a few years old, is this limitation still the case for current Python? I was trying to save some of AviSynthPlus-MapNLQ's 12-bit outputs and noticed the same thing FranceBB mentioned
Under Macros > Extras there is the macro 'Save as Tiff_rgb48'
It uses ffmpeg to save the current frame as a 48bit tiff.

Change the path in the macro to ffmpeg.exe
__________________
Live and let live
gispos is offline   Reply With Quote
Old 20th February 2024, 20:00   #1603  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 447
Quote:
Originally Posted by gispos View Post
But the saved png seems to have only 8bit per channel (RGB24). Or have I overlooked something?
Does it have to be saved as 'ebmp'? but then only Avisynth can read it?


Edit:
My mistake, had opened the png with VDub2 which apparently always opens png in RGB24 format. With FFImageSource the color format is then displayed correctly
It is saved with bit depth 16 - https://ibb.co/fvvb5RR
Same image saved with 8-bit depth - https://ibb.co/RvWGNvs

The 16-bit can be read with ffimagesource and it's read as rgbp16.

Edit: you edited when I was writing the reply.
StvG is offline   Reply With Quote
Old 2nd March 2024, 12:44   #1604  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
AvsPmod 2.7.7.0
Code:
* Audio downmix is now mixed to stereo using its own mixer (with Avisynth mixer there were problems with prefetch and multichannel).
- the audio volume values have changed, now 0.25 to 2.0, the value 1 corresponds to 100%, 
- the value 2.0 is slightly less than twice the volume, approx. 7 decibels (setting per script).
* The values of the audio buffer have also changed, now 1 to 6 seconds. 3 seconds as default.
* The mix portion of the center channel can be done under Playback button context menu > 'Audio settings'. Default 0.7 (global for all scripts).
* The menu Play > 'Downmix audio' has been removed, it is now located under Audio settings.
* Audio playback is now also possible with the preview filter switched on.
* The macro 'Save as Tiff_rgb48' has been replaced by 'Save Image_rgb48'. It can now be saved as tiff or png (requires ffmpeg.exe).
* Some minor corrections and cleanups (e.g. option 'Playback in threads' removed).
__________________
Live and let live
gispos is offline   Reply With Quote
Old 2nd March 2024, 14:56   #1605  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Thank you, as always, Gispos for keeping the project alive.
FranceBB is offline   Reply With Quote
Old 10th March 2024, 11:35   #1606  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by gispos View Post
AvsPmod 2.7.7.0
Please, have a look here.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 10th March 2024, 15:09   #1607  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by tormento View Post
Please, have a look here.
I have revised the macro again, test it and let me know what should be changed.
I don't know whether the metadata is also saved, but FFImageSource at least displays the properties correctly.
https://drive.google.com/drive/folde...usp=drive_link
__________________
Live and let live
gispos is offline   Reply With Quote
Old 13th March 2024, 04:18   #1608  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Some video preview questions, referring to the preview displaying in the same window as AvsPmod rather than a separate one, but they might apply to both.

Is there a way to prevent AvsPmod changing the size of the video window and resetting the zoom when displaying an Avisynth error message? It can become quite frustrating when doing something like editing a function and previewing the result, at least if you're stupid like me and there's a fair chance an edit will result in an error message. To duplicate....

Open an Avisynth script that outputs video.
Uncheck "Video/Additional/Resize video window".
Set the video zoom to "fit inside window".
Add something to the script that'll result in an Avisynth error message.
The video window will resize to display the error message, although the "resize video window" option remains unchecked.
The video zoom will reset to 100%.
Removing the cause of the error message displays the video at 100% and the video window is resized accordingly.

Should double left clicking on the video to view it full size behave differently compared to using the Video/Fullsize menu? Double clicking on the video to enter full size mode and then again to leave it returns the preview to it's original state, whereas using the Video/Fullsize menu instead resets the size of the video preview when exiting full size mode.

Is there a way to configure the preview so a single left click on the video starts/pauses playback? I ask, as the many years I've spent using software players such as MPC-HC has trained my brain to start/pause playback that way and it's ignoring my requests to think differently for AvsPmod.

Some auto-cropping questions...

I noticed an oddity with AvsPmod's auto cropping after opening an incredibly average 720p video and adding Subtitle() to the script. The short version of the story...
Adding subtitle("0") caused AvsPmod's auto-cropping to decide 8 pixels should to be cropped from the left (the "0" would have been overlaid starting from pixel 9 on the left). Without subtitle("0") it decided no cropping was required, which was correct.

The minimum number of frames that can be specified for auto-cropping to check is one. Would a value of zero, telling auto-crop to check only the current frame be useful? If the amount of black varies, then according to how you prefer to crop, it'd be easy to pick a frame requiring the least amount of cropping, or one requiring the most, and auto crop the whole video accordingly.

Would the crop editor window be more fun to use if it had a button for resetting the cropping to zero? I know changing the mod setting, or the number of frames to check, resets the auto cropping, but a reset button might still be useful.

Thanks for all the hard work keeping AvsPmod up to date!

Last edited by hello_hello; 13th March 2024 at 06:49.
hello_hello is offline   Reply With Quote
Old 13th March 2024, 18:52   #1609  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by hello_hello View Post

Is there a way to prevent AvsPmod changing the size of the video window and resetting the zoom when displaying an Avisynth error message? It can become quite frustrating when doing something like editing a function and previewing the result, at least if you're stupid like me and there's a fair chance an edit will result in an error message. To duplicate....
I did this because otherwise you can't read the error message depending on the zoom used.
And the easiest thing to do is to reset the zoom to 100%. Everything else requires an effort that I have to think about and I have a look at the possibilities.
Zoom must be saved beforehand (there are 2 types of zoom), and must be restored, so it must also be saved whether an error message was present during the previous initialization, and...
I understand you, but as I said, the effort has to be manageable. Let's see...

Quote:
Originally Posted by hello_hello View Post
Should double left clicking on the video to view it full size behave differently compared to using the Video/Fullsize menu? Double clicking on the video to enter full size mode and then again to leave it returns the preview to it's original state, whereas using the Video/Fullsize menu instead resets the size of the video preview when exiting full size mode.
That's how it's meant to be. Left double click activates the resize filter (like fullscreen), and is reset to the previously set zoom and position.
The shortcut (menu entry) only enlarges the window and does not change the zoom (I want to use both options).

Quote:
Originally Posted by hello_hello View Post
Is there a way to configure the preview so a single left click on the video starts/pauses playback? I ask, as the many years I've spent using software players such as MPC-HC has trained my brain to start/pause playback that way and it's ignoring my requests to think differently for AvsPmod.
I'm used to it that way, but from video players. But in AvsPmod playback is not the main function. You move the window with the mouse.
I don't know if it makes sense to add another mouse click function to the other click functions like Fullsize, Fullscreen, Resize Filter. I think no (for now).

Quote:
Originally Posted by hello_hello View Post
Some auto-cropping questions...
I don't want to say anything about auto crop at the moment, I'll have to take a closer look at your question and the code.
Just to start with: I wouldn't have integrated an auto crop function myself, I don't know of any that work really well (it always depends on the video).
I don't use auto crop, I always know what I want to cut off.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 14th March 2024, 05:42   #1610  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Thanks for the reply.

Quote:
Originally Posted by gispos View Post
I did this because otherwise you can't read the error message depending on the zoom used.
And the easiest thing to do is to reset the zoom to 100%. Everything else requires an effort that I have to think about and I have a look at the possibilities.
Zoom must be saved beforehand (there are 2 types of zoom), and must be restored, so it must also be saved whether an error message was present during the previous initialization, and...
I understand you, but as I said, the effort has to be manageable. Let's see...
Personally I think it'd be better to keep the existing preview size for the error message. That's the biggest annoyance for me as it invariably results in the preview area becoming much smaller when displaying the error message, and then large enough to hide the text in the script when returning to previewing the video. If just the zoom was reset for the error message the worst that would happen is you'd need to scroll around a bit to read it all, and the zoom being reset is less of an issue because I realize, now that I've checked, it's possible to create a keyboard shortcut to set it back to "fit inside window", or whatever you're preferred zoom level may be.

Quote:
Originally Posted by gispos View Post
I'm used to it that way, but from video players. But in AvsPmod playback is not the main function. You move the window with the mouse.
I don't know if it makes sense to add another mouse click function to the other click functions like Fullsize, Fullscreen, Resize Filter. I think no (for now).
Fair enough. For MPC-HC I always change the fullscreen mouse action to a middle click instead of a double left click, as even though it defaults to a left click for play/pause you can't start and pause playback quickly without it being interpreted as a double click. I think I also changed the default from "left click down" to "left click up" for play/pause so the player wouldn't have to decide if I'd left clicked to move the video around the screen or to start/pause playback, or something like that. So yes... I appreciate making it work reliably mightn't be easy.

Quote:
Originally Posted by gispos View Post
I don't want to say anything about auto crop at the moment, I'll have to take a closer look at your question and the code.
Just to start with: I wouldn't have integrated an auto crop function myself, I don't know of any that work really well (it always depends on the video).
I don't use auto crop, I always know what I want to cut off.
I don't trust auto cropping either so I haven't used it much myself, but rather than enabling an auto crop plugin and hoping for the best, AvsPmod's auto cropping is more of a starting point for manual cropping, if that makes sense. It's no big deal, but I thought I'd at least report the cropping oddity I discovered.

Cheers.
hello_hello is offline   Reply With Quote
Old 14th March 2024, 06:18   #1611  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by hello_hello View Post
...because I realize, now that I've checked, it's possible to create a keyboard shortcut to set it back to "fit inside window", or whatever you're preferred zoom level may be.
Except it appears not to work.
I've created a keyboard shortcut, and when I look at the Video/Zoom menu it shows the zoom has changed to "fit inside window" but the video zoom itself doesn't change. I'm running AvsPmod in Wine on Linux but I don't think that's the cause as the preset shortcut "NumberPad /" for resetting the zoom to 100% is working.

Last edited by hello_hello; 14th March 2024 at 06:23.
hello_hello is offline   Reply With Quote
Old 14th March 2024, 17:46   #1612  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by hello_hello View Post
Thanks for the reply.
Personally I think it'd be better to keep the existing preview size for the error message. That's the biggest annoyance for me as it invariably results in the preview area becoming much smaller when displaying the error message, and then large enough to hide the text in the script when returning to previewing the video....
With normal zoom it may still work, but zoom with Resize Filter will then be greatly enlarged.
It bothers you that the zoom is reset, others (including me) are bothered by the fact that I can't read the error messages and have to fiddle around.
That's just how it is, It is difficult to satisfy everyone.

Please test it.
https://drive.google.com/drive/folde...usp=drive_link
Code:
* After an error message (error clip), the previously used zoom is restored (factor, fit, fill, position).
- however, the 'Resize filter' is not restored.
* When 'Resize video window' is disabled, the size of the video window is now more stable and will not reset on an error clip.
A note:
If the video window is too large for you, you can also set the minimum visible text lines higher under Program Options > Text > 'Min text lines', e.g. to 20
__________________
Live and let live

Last edited by gispos; 14th March 2024 at 21:41. Reason: Edit
gispos is offline   Reply With Quote
Old 15th March 2024, 11:48   #1613  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by gispos View Post
With normal zoom it may still work, but zoom with Resize Filter will then be greatly enlarged.
It bothers you that the zoom is reset, others (including me) are bothered by the fact that I can't read the error messages and have to fiddle around.
That's just how it is, It is difficult to satisfy everyone.
I guess it depends on the type of zoom you normally use. For a "fit inside window" zoom, or any zoom above 100%, the error message could only get bigger if the zoom was retained.
I'm struggling to think of a reason for using a fixed zoom less than 100% when you can fit the video to the preview window, prevent the preview size from changing automatically, and changing the window size manually changes the video size to match. Each to their own though....

Quote:
Originally Posted by gispos View Post
Please test it.
https://drive.google.com/drive/folde...usp=drive_link
Code:
* After an error message (error clip), the previously used zoom is restored (factor, fit, fill, position).
- however, the 'Resize filter' is not restored.
* When 'Resize video window' is disabled, the size of the video window is now more stable and will not reset on an error clip.
That seems to be working as advertised, but I'd be happy for the "fit inside window" zoom not to be reset for the error message, because as I said it'll only make it larger. It's fine as it is though.

For some reason I can't create a working keyboard shortcut for changing the video zoom unless I use the numeric keypad keys. Am I missing something? Not that it matters too much as I've found a way to create a shortcut that works.

Some little nitpicks....
When I created a non-working shortcut for changing the video zoom to "fit inside window", even though the zoom didn't change, the View/Zoom menu showed that it had.
Now that I have working shortcuts for changing it to "fit inside window" and "resample fit", the change is not reflected when opening the View/Zoom menu.

When the video from a script is displaying, using shortcut keys to change the zoom never causes the preview area to lose focus, so you can zoom in and out etc without an issue.
When an error message is displayed, after changing the zoom level the preview area loses focus and if you attempt to change the zoom again before clicking on the video area, the line of text where the cursor has focus is replaced. Changing the zoom level for an error message isn't something that's likely to happen too often, but I just thought I'd mention it.

Thanks again!

Last edited by hello_hello; 15th March 2024 at 12:00.
hello_hello is offline   Reply With Quote
Old 15th March 2024, 19:41   #1614  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by hello_hello View Post
...
I'm struggling to think of a reason for using a fixed zoom less than 100%...
You only think about yourself.

Quote:
Originally Posted by hello_hello View Post
For some reason I can't create a working keyboard shortcut for changing the video zoom unless I use the numeric keypad keys. Am I missing something? Not that it matters too much as I've found a way to create a shortcut that works.
I'm very surprised. Is that really the case? If the menu indicates that fit or fill is set, then that must be the case.
And when you select the menu with the mouse, does it work? Show me your shortcuts for this.

Quote:
Originally Posted by hello_hello View Post
Some little nitpicks....
Now that I have working shortcuts for changing it to "fit inside window" and "resample fit", the change is not reflected when opening the View/Zoom menu.
Look at the old AvsPmod version, almost nothing is confirmed in the menus.
The whole menu system in Python is more tedious and time-consuming for the writer than in some other languages, and it doesn't always make sense to confirm something.
Use the zoom, if you change the zoom with the mouse, the menu entry is not changed and is still at 100%. When the menu is opened, you have to check which entry corresponds to the current zoom.
Usually none, so what should be displayed in the menu? Nothing (there is/was no such thing), and it also has to be checked when the menu is opened and for some things the check for an entry is too time-consuming or not possible at all or the programmer sees no need for a confirmation.

Quote:
Originally Posted by hello_hello View Post
When an error message is displayed, after changing the zoom level the preview area loses focus and if you attempt to change the zoom again before clicking on the video area, the line of text where the cursor has focus is replaced...
A little fun is a must:
Why do you want to zoom with the keyboard when an error clip is displayed?
This is one of the other reasons that 100% zoom is set, because with an error clip the line containing the error is marked in the script and the script gets the focus.
You should (want) eliminate the error. And that's why the video window is minimized so that you can see the script and the error location better.

Sometimes the programmer has even thought of something, but there are also users who swim against the tide.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 15th March 2024, 19:42   #1615  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
Quote:
Originally Posted by takla View Post
@gispos
Zoom > Fit Window only works if the video is above a certain size
Could you make it so it always scales to the optimal size with "Fit Window" selected?

See this video for what I mean

Basically, Fit Window only works if the video resolution is higher then the window size.
You'll have to explain that to me in more detail, I think it works as it should. The only thing I have changed is that I don't consider portrait format with 'Fill'.

What do you mean by 'optimal'? What should be set if the video is smaller than the window?
With 'Fit' it is adjusted to the window in height and width (so that it is fully visible) and with Fill the height is adjusted and the width is not, the image can then be wider than the window.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 16th March 2024, 03:15   #1616  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by gispos View Post
I'm very surprised. Is that really the case? If the menu indicates that fit or fill is set, then that must be the case.
And when you select the menu with the mouse, does it work? Show me your shortcuts for this.
The menu appears to be changing correctly for a working keyboard shortcut. It was after an error message had displayed that the zoom menu was staying at 100%. I must have been confused there.

Please ignore the script. It's a mess because I've been updating a function and doing some testing.

Video running at 100%.



After using the "Numberpad 9" shortcut I created to change the zoom to "fit inside window".



From 100% zoom and then using a non-working shortcut (Shift + Q):
The menu changes and still works, but because it's already selected you need to select another zoom mode first, then go back to the original selection.



Not all non-working shortcuts seem to change the menu. For example "Shift + Numberpad 9" doesn't work or change the menu.
Maybe it's a Wine related oddity as I'm running AvsPmod in Wine on Linux. I'll test it again on Windows later if you don't have the same problem, although even then it'll be running in VirtualBox.

Quote:
Originally Posted by gispos View Post
Use the zoom, if you change the zoom with the mouse, the menu entry is not changed and is still at 100%. When the menu is opened, you have to check which entry corresponds to the current zoom.
Usually none, so what should be displayed in the menu?
Zoom/Custom? That appears to be what it changes to.

Quote:
Originally Posted by gispos View Post
Why do you want to zoom with the keyboard when an error clip is displayed?
I don't. It was just an inconstancy relating to behavior I thought I'd mention.

Cheers.

Last edited by hello_hello; 16th March 2024 at 03:58.
hello_hello is offline   Reply With Quote
Old 16th March 2024, 13:32   #1617  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 996
AvsPmod 2.7.7.1
Code:
* After an error message (error clip), the previously used zoom is restored (factor, fit, fill, position).
- however, the 'Resize filter' is not restored.
* When 'Resize video window' is disabled, the size of the video window is now more stable and will not reset on an error clip.
* When 'Resize video window' is enabled and no 'Resize filter', zooming with the mouse wheel now also changes the size of the video window.
* You can now set the script's minimum visible text lines on the fly (Program options > Text > 'Min text lines')
- with the script context menu Miscellaneous > 'Set min text lines (Ctrl + splitter move)'
- or press Ctrl and move the video/script splitter (first press Ctrl to unlock then move the splitter and release Ctrl).
* Bugfix: if 'Resize video window' is disabled and switching between fullsize and normal view, the normal view was set the wrong splitter position.

Quote:
Originally Posted by takla View Post
The Fill Window setting only works when the video size is first increased. When the video size is too small it does nothing

What I expect to it to do, is to always increase or reduce the video size.
You have a mistake in your thinking.
The limitation and basis is the script/video splitter, If the video window has the same size as the video, as in your case (zoom to 400%, the splitter now adapts to the video if 'Resize video window' is set).
If you now use Fill or Fit nothing happens. Things only change when the splitter is moved or you double click on the video window.
This is fill or fit, adapt to the window, but the window limit upwards is the splitter.
100% zoom shows your final result and not fill or fit.

Try it differently:
Set 100% zoom, now move the splitter up, the video image is still the same size. Now use Fit or Fill, what happens?
__________________
Live and let live
gispos is offline   Reply With Quote
Old 17th March 2024, 01:08   #1618  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Quote:
Originally Posted by gispos View Post
I don't have the words, but a video.


Lol. Danke.

Last edited by takla; 22nd March 2024 at 13:03.
takla is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:27.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.