Display Frame number and Quick "Delete current frame"

Started by Tlen, April 26, 2020, 03:34:36 PM

Previous topic - Next topic

Tlen

Hi guys,

i've just discover this program that seems to me having a huge potential.

Generally i work at frame step with videos, cutting and inserting single or bunch of frames.

Actually i do this manually in avysinth with custom functions written by me without a graphical UI.

I do the modification in the script, reload in VirtualDub and so on.

This program opens an entire new world of quick editing.

So at the moment i miss:

The actual frame number of the video (or the image sequence).

A key shortcut to delete the current frame (instead of doing an AB marker quite lenghty).

Am i missing something?

Can i add the function (delete current frame) i need in some way?

Have i to do a feature request?

Thank you very much for the support!

eumagga0x2a

Quote from: Tlen on April 26, 2020, 03:34:36 PM
So at the moment i miss:

The actual frame number of the video (or the image sequence).

Do you mean the picture number in display order? This is not possible other than by decoding from the start of the timeline and incrementing a counter (which is more or less possible with a very recent nightly build using internal python scripting), at least not universally possible.

QuoteA key shortcut to delete the current frame (instead of doing an AB marker quite lenghty).

I don't think deleting a single frame is a scenario worth of a costly keyboard shortcut. With alternative keyboard shortcuts enabled, you achieve the goal with a sequence of "I", "→", "O", "Del". More than one keypress, sure. But not a big hassle IMVHO (and creating a segment layout with dozens or hundreds of segments is sort of pushing Avidemux to unknown limits).

QuoteCan i add the function (delete current frame) i need in some way?

Sure, you add the action name to avidemux/common/gui_action.names, then handle it in the switch in void HandleAction (Action action) in avidemux/common/gui_main.cpp by looking how ACT_MarkA, ACT_MarkB, ACT_Delete as well as GUI_NextFrame() from avidemux/common/gui_navigate.cpp are implemented.

The easiest way to add a shortcut would be to hack _myMenuGo from avidemux/common/ADM_commonUI/myOwnMenu.h by replacing black frame seeking actions (not by appending new action to the array as some menu entries enabling/disabling code in avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp may operate with hardcoded lengths).

QuoteHave i to do a feature request?

I fear, I'm not convinced that this functionality would be beneficial enough to be included into regular Avidemux. Supporting you in implementing it for your own use is a complete different story.

signy13

If you need a single shortcut as a replacement of a chain of other shortcuts (you can even call a function without any shortcut just by using Avidemux main menu) you do not have to hack and compile Avidemux - you can use external program handling shotcuts. This solution is dependent on your operating system.
I use AutoHotKey on Windows and AutoKey on Linux for the same purpose - these programs can simulate number of keystrokes. For example in your case an AutokeyScript would be pretty short:
keyboard.send_keys("ii<right>o<delete>") # Select one frame and delete it
Please note there are two keys "I" necessary. I tested one "I" but it did not worked if there was markerA behind current position. I tested this script with this Window Filter:
.* - Avidemux$
and it looks OK.

As another example I use shortcuts for "Run project script" as two AutoKey scripts, which are active only in Avidemux. One for Avidemux with loaded video file:
keyboard.send_keys("<alt>+f")           # Open menu File
keyboard.send_key("<down>",repeat=1)    # Down 6-times
keyboard.send_keys("<enter>r")          # Open submenu - Run

another for Avidemux without loaded video file:
keyboard.send_keys("<alt>+f")           # Open menu File
keyboard.send_key("<down>",repeat=6)    # Down 6-times
keyboard.send_keys("<enter>r")          # Open submenu - Run

eumagga0x2a

Quote from: signy13 on May 01, 2020, 07:25:42 AM
I use AutoHotKey on Windows and AutoKey on Linux for the same purpose - these programs can simulate number of keystrokes. For example in your case an AutokeyScript would be pretty short:
keyboard.send_keys("ii<right>o<delete>") # Select one frame and delete it
Please note there are two keys "I" necessary. I tested one "I" but it did not worked if there was markerA behind current position.

Replace the first "I" with "R" (reset markers).

signy13

Quote from: eumagga0x2a on May 01, 2020, 09:29:33 AM
Quote from: signy13 on May 01, 2020, 07:25:42 AM
Please note there are two keys "I" necessary. I tested one "I" but it did not worked if there was markerA behind current position.

Replace the first "I" with "R" (reset markers).

Thank you, this is probably better solution, although double "I" works too because of the way how Avidemux handles with markers setting.