Small usability tweaks for A/B markers that should be easy to implement

Started by Who, January 02, 2021, 09:21:49 PM

Previous topic - Next topic

Who

Some changes I'd like to see in Avidemux related to the A/B markers and the buttons that control them, if you'd please consider them:

Instead of a single save button, please consider having one that saves the entire video and a second one that only saves the selected portion (the part between the A and B markers).  Too often I have edited a video and saved it only to discover that only a partial video was saved because I forgot to remove the A/B markers.

Also on that subject, how about a button next to the two buttons that set the A/B markers that will remove the current A/B markers.  I do that a lot and hate having to go up to the top menu and use the dropdown to reset the markers.

And speaking of the A/B buttons can we please have them set the selected marker, and ONLY the selected marker, to the current position no matter what?  There have been too many times I have for example set the A marker by clicking the A button only to find that it's the B marker that actually gets changed, and vise versa.  I suspect this happens when an impossible situation would be created, for example the A marker would be behind the B marker.  But instead of setting the wrong marker I would much prefer that it set the marker corresponding to the button I clicked on and reset the other one (set it to the start or end of the file so as not to create the impossible situation).  Really, if I click the A button, I REALLY want the A marker set to the current position, regardless of where the B marker is, and vise versa.  I have had to go back and redo filters and edits many times because of this and it's really annoying.

And finally, if you create a filter and it is one of the ones that can be made partial, when making it partial Avidemux usually takes the start and end positions from the A/B markers (although, annoyingly, sometimes it gets those wrong if you have cut out sections or otherwise changed the length of the video - it's like it's not reading the correct values for the A/B markers in some cases, but instead it reads where the A/B markers would have been if you had not cut a piece or pieces out of the file).  But the other problem is you can't change the position of the A/B markers and then go back in and click "make partial" again and have it reset the start and end values to the current marker positions - once the make partial values have been set, they can only be changed manually, or by deleting the entire filter and starting over.  It would be great if there were a button on the "make partial" config screens to explicitly set the start time to the current A marker position, and the end time to the current B marker position, so that if you (or the program) gets those values wrong on the first go you can reset them just by clicking the button.

Honestly the more I use Avidemux the more I find that the A/B markers are the things that give me the most issues, and it would be really great if some of these things could be made to work better. Thank you for your consideration.

butterw

Quote from: Who on January 02, 2021, 09:21:49 PMInstead of a single save button, please consider having one that saves the entire video and a second one that only saves the selected portion (the part between the A and B markers). Too often I have edited a video and saved it only to discover that only a partial video was saved because I forgot to remove the A/B markers.
Can't say this often happens to me, I know saving always means "Save selection", still in some cases the user may want to "save Full" without having to reset markers. Maybe a Ctrl+Alt+S hotkey would make sense ?
The more commands in an interface the less easy it is to learn, use and maintain. Avidemux does a decent job at keeping it simple IMO.

Quote from: WhoAlso on that subject, how about a button next to the two buttons that set the A/B markers that will remove the current A/B markers.  I do that a lot and hate having to go up to the top menu and use the dropdown to reset the markers.
Another option is to use the reset markers hotkey.

Quote from: WhoAnd speaking of the A/B buttons can we please have them set the selected marker, and ONLY the selected marker, to the current position no matter what?  There have been too many times I have for example set the A marker by clicking the A button only to find that it's the B marker that actually gets changed, and vise versa.  I suspect this happens when an impossible situation would be created, for example the A marker would be behind the B marker.  But instead of setting the wrong marker I would much prefer that it set the marker corresponding to the button I clicked on and reset the other one (set it to the start or end of the file so as not to create the impossible situation).  Really, if I click the A button, I REALLY want the A marker set to the current position, regardless of where the B marker is, and vise versa.  I have had to go back and redo filters and edits many times because of this and it's really annoying.
You may have a valid point here, this can be frustrating.

eumagga0x2a

Quote from: Who on January 02, 2021, 09:21:49 PMhow about a button next to the two buttons that set the A/B markers that will remove the current A/B markers.  I do that a lot and hate having to go up to the top menu and use the dropdown to reset the markers.

I would recommend going to Preferences in Avidemux and enabling alternative keyboard shortcuts. This allows to reset markers just by pressing the key "R" (it can't get any simpler without clutting the GUI, IMHO).

Technically markers are never removed. Just the blue rectangle over the navigation bar is hidden if the entire duration of video is selected (which is the default).

Quote from: Who on January 02, 2021, 09:21:49 PMAnd speaking of the A/B buttons can we please have them set the selected marker, and ONLY the selected marker, to the current position no matter what?  There have been too many times I have for example set the A marker by clicking the A button only to find that it's the B marker that actually gets changed, and vise versa.  I suspect this happens when an impossible situation would be created, for example the A marker would be behind the B marker.  But instead of setting the wrong marker I would much prefer that it set the marker corresponding to the button I clicked on and reset the other one

Done: [gui_main,DIA_prefs] Add toggle to reset the other marker instead of auto-swapping when setting marker A to a position past B or marker B before A.

However, this change may be quickly reverted if found to cause regressions as we are very close to 2.7.7.

butterw

- Given that Save always opens a dialog, shouldn't the option be called "Save..."
- To save the full video when a selection is present what you are suggesting is: Reset Markers > Save > Undo
, which arguably is a bit clunky.
A "Save Full" tick option in the save dialog or a hotkey would be preferable IMO.




Who

Quote from: eumagga0x2a on January 03, 2021, 12:40:55 AM
Quote from: Who on January 02, 2021, 09:21:49 PMhow about a button next to the two buttons that set the A/B markers that will remove the current A/B markers.  I do that a lot and hate having to go up to the top menu and use the dropdown to reset the markers.

I would recommend going to Preferences in Avidemux and enabling alternative keyboard shortcuts. This allows to reset markers just by pressing the key "R" (it can't get any simpler without clutting the GUI, IMHO).

I have nothing against "cluttering" the GUI to make the program more usable.  In an ideal world the user would be able to modify the button area to change the order of the buttons and to move, add or remove buttons that make the most sense for that particular user's workflow.  But I have no idea how difficult something like that would be to program.  Anything that requires me to take my hand off the mouse and find a key to press breaks my concentration, however briefly.  Plus keyboard shortcuts are only a solution for people with good memories (this is something I think a lot of programmers don't get - you pretty much have to have an excellent memory to be a good programmer, but not all users have excellent memories; that is one of the big reasons GUI-based applications are so desirable in the first place.  Anytime I hear someone say "I'd rather do something from the command line than use a GUI", I can pretty much be assured that's a person with a good memory, which is something I wish I had).  It's not that "R" is that hard to remember, nor that it is harder to press "R" than to reset the markers using the dropdown menu, but I would kind of hate to see that become a trend where most of the useful features are hidden behind keystrokes.  One keystroke command I can remember, maybe two, but beyond that it's back to the dropdowns for me.

Quote from: eumagga0x2a on January 03, 2021, 12:40:55 AMTechnically markers are never removed. Just the blue rectangle over the navigation bar is hidden if the entire duration of video is selected (which is the default).

I had kind of deduced that from looking at a project script file.

Quote from: eumagga0x2a on January 03, 2021, 12:40:55 AM
Quote from: Who on January 02, 2021, 09:21:49 PMAnd speaking of the A/B buttons can we please have them set the selected marker, and ONLY the selected marker, to the current position no matter what?  There have been too many times I have for example set the A marker by clicking the A button only to find that it's the B marker that actually gets changed, and vise versa.  I suspect this happens when an impossible situation would be created, for example the A marker would be behind the B marker.  But instead of setting the wrong marker I would much prefer that it set the marker corresponding to the button I clicked on and reset the other one

Done: [gui_main,DIA_prefs] Add toggle to reset the other marker instead of auto-swapping when setting marker A to a position past B or marker B before A.

However, this change may be quickly reverted if found to cause regressions as we are very close to 2.7.7.

Thanks much, I'd love to give that a try, any idea when that will be in the MacOS Catalina nightly?  As I write this the version currently available at http://www.avidemux.org/nightly/ is from November 15, which is the one I am running.  However if the 2.7.7 release version is very close as you say, I'm happy to wait for that, only thing I ask is that you please do update the Catalina version of that release.  Thanks again!

eumagga0x2a

Quote from: Who on January 04, 2021, 12:28:55 PMany idea when that will be in the MacOS Catalina nightly?

Not really, albeit I hope that it will happen soon. The important bit of info is that macOS nightlies (Catalina- and hopefully Big Sur-compatible, of course) will be most likely built on Mojave and therefore appear in https://avidemux.org/nightly/osx_mojave/ where the latest one is from Dec 27. For now, it lacks some features (AV1 decoder, VP9 encoder are missing due to aom and libvpx not present in Homebrew in the build node), but apart from that fully functional. The reason for going back to Mojave is that else there is no simple way to offer a Mojave-compatible build.

butterw

The behavior with Selection Copy/Cut/Delete doesn't seem consistent when you Delete to the End:
https://forum.videohelp.com/threads/400142-any-software-that-would-split-the-video-in-equal-minutes-and-keep-it-as-one/page2#post2607179

A is copied as expected, but not deleted. The end frame is correctly deleted:
......................[A...............End

After Cut/Delete: ......................A

Is there a reason for A not being deleted here ?
It's not intuitive, I often forget about this when trying to delete the last scene of a clip, and it can cause issues with subsequent appends.

butterw

- In Copy Mode, when marker B i set on a Keyframe, this Keyframe is included in the save (which isn't required ?).
- When split on a keyframe marker is applied, this will cause 1 extra frame added except for the last segment), causing a duplicate frame when recombining the files.

To not include the marker B Keyframe (which could often be an undesirable scene change) when saving a selection you currently need to set B, 1 frame before the keyframe.

Would it make sense to have a preference to discard frame B in saves when it is a keyframe ?
0-----[A...[B-------end

eumagga0x2a

Quote from: butterw on January 25, 2021, 08:47:53 PM- In Copy Mode, when marker B i set on a Keyframe, this Keyframe is included in the save (which isn't required ?).

Yes, the selection endpoint is always included on video export. This makes sense in two use cases:

1. Cutting open-GOP type of video streams like those used in (nearly) all digital TV broadcasts. Excluding the end point (i.e. dropping the keyframe) would result in early B-frames which follow the keyframe in stream order but precede it in display order to be dropped as well. The number of such early B-frames varies a lot, may be quite significant (I encountered as many as 9 in real-world MPEG-TS files).

2. Seeking to the end of video, setting the B marker there and re-encoding the selection would result in the last frame not included. Judging from my struggles in early days, realising that it is necessary to reset markers to get B past the last frame may be non-trivial at least for some users  :-[

Quote from: butterw on January 25, 2021, 08:47:53 PM- When split on a keyframe marker is applied, this will cause 1 extra frame added except for the last segment), causing a duplicate frame when recombining the files.

This is valid, but in most cases it is necessary to cut away the gap created by B-frame delay anyway, so this overlap can be even useful.

Quote from: butterw on January 25, 2021, 08:47:53 PMWould it make sense to have a preference to discard frame B in saves when it is a keyframe ?

No, I don't think it would.

butterw

Quote from: eumagga0x2a on January 26, 2021, 12:15:52 AM1. Cutting open-GOP type of video streams like those used in (nearly) all digital TV broadcasts. Excluding the end point (i.e. dropping the keyframe) would result in early B-frames which follow the keyframe in stream order but precede it in display order to be dropped as well. The number of such early B-frames varies a lot, may be quite significant (I encountered as many as 9 in real-world MPEG-TS files).

Is it possible for Avidemux to know whether the file/section to be saved is Open-GOP ?

Quote from: eumagga0x2a on January 26, 2021, 12:15:52 AM2. Seeking to the end of video, setting the B marker there and re-encoding the selection would result in the last frame not included. Judging from my struggles in early days, realising that it is necessary to reset markers to get B past the last frame may be non-trivial at least for some users  :-[

I was wondering about this: why doesn't setting markers on the first/last frame set them to 0 and end, like Reset Markers does ?

Reset Markers should probably be featured in the navigation toolbar to give it more visibility. Using the menu it can  also easily be confused with Reset Edit... 

Quote from: eumagga0x2a on January 26, 2021, 12:15:52 AM
Quote from: butterw on January 25, 2021, 08:47:53 PM- When split on a keyframe marker is applied, this will cause 1 extra frame added except for the last segment), causing a duplicate frame when recombining the files.

This is valid, but in most cases it is necessary to cut away the gap created by B-frame delay anyway, so this overlap can be even useful.
OK. The recombined file did still play fine despite the added frames.


butterw

I've just noticed there are no icons displayed in the Edit Menu.

A change that could be made easily to current version, would be to add an icon for Reset Markers in the Edit Menu:
ADM_commonUI/myOwnMenu.h
            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Save"),               NULL,ACT_SAVE_VIDEO,    MKICON(filesaveas),"Ctrl+S",0},
            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Reset Markers"),      NULL,ACT_ResetMarkers, NULL,"Ctrl+Home",0},
the path for filesaveas.png would be defined in avidemux.qrc ressource files. 

icons are png typ. 22x22, 32bit
https://github.com/mean00/avidemux2/tree/master/avidemux/qt4/ADM_userInterfaces/ADM_gui/pics

here's my attempt (it will display smaller in the GUI than here):


This what it would look like if used in the navigation toolbar:


butterw

Quote from: Who on January 02, 2021, 09:21:49 PMInstead of a single save button, please consider having one that saves the entire video and a second one that only saves the selected portion (the part between the A and B markers).  Too often I have edited a video and saved it only to discover that only a partial video was saved because I forgot to remove the A/B markers.

It's easy to add a Save Full command with a TinyPy script (which can be added to the Custom or Auto Menu).

EDIT: saveFull.py plugin available here:
https://github.com/butterw/bShaders/tree/master/test_LimitedRange/Avidemux/Settings/Custom

Who

Quote from: butterw on February 17, 2021, 02:12:10 PMIt's easy to add a Save Full command with a TinyPy script (which can be added to the Custom or Auto Menu).

EDIT: saveFull.py plugin available here:
https://github.com/butterw/bShaders/tree/master/test_LimitedRange/Avidemux/Settings/Custom

First of all thanks for your scripts, they are quire useful.  But regarding this one specifically, would it be possible to modify it so that prior to starting to encode, it would first save a project file, using the same path and root filename as the video currently loaded (same thing it would use by default if you manually saved a project file)?  It would also be okay to hardcode the path (might actually be a better idea), I would just need to know where to change it. But the filename should be the same as the currently-loaded video (just with the .py extension instead of whatever the video extension is) or alternately any unique filename (such as one based on date and time) would work.  For the rationale behind this, please see my post at https://avidemux.org/smif/index.php/topic,19491.0.html

If that is possible it would be a big help!  Thanks again.

butterw

It's not currently possible to save the project via scripting: the command saveProject(filepath) has not yet been added to the TinyPy bindings.

butterw

I just noticed it's possible to set markerA==markerB. Saving is also possible and saves a single-frame video !
As this will typically be the result of a mistake, confirmation should be required IMO before saving in this special case.