PLEASE fix the "Restore Previous Session" feature so that it actually WORKS!

Started by Who, May 28, 2021, 03:00:14 AM

Previous topic - Next topic

Who

There is a major problem with the "Restore Previous Session" menu item in Avidemux - it has failed me 100% of the times I have attempted to use it!  The problem is that the only time I ever want to use it is when the computer or the program has crashed in the middle of encoding a large video. And what has happened, 100% of the time, is that it has restored not the session that was running when the program or system crashed, but the next most recent previously completed session, and that one is useless to me because it finished successfully, so I don't need it anymore!

My feeling is that it is not saving the session information until the encoding has completed, or if you have closed a file or something. When it needs to save it in when you begin the encoding, in other words the moment you click the "save" button or click "Save" from the "File" menu item, just before it actually begins to encode!  Otherwise if it crashes during encoding, which it has done more times than I'd like to remember, you have no saved session to go back to (well unless you save it manually each time, but who remembers to do that?).

butterw

"Restore Previous Session" is rarely helpful, it needs to be improved.

My suggestions:
- Keep the last 3 lastEdit.py files as backup
- Provide a save_project(filepath) Tinypy binding to allow saving the project automatically from script.

eumagga0x2a

Quote from: Who on May 28, 2021, 03:00:14 AMThe problem is that the only time I ever want to use it is when the computer or the program has crashed in the middle of encoding a large video.

This sort of crashes is utterly abnormal, they may be related to some hardware or driver issues, it is doubtful that even the proper crash recovery functionality may be of any use if the computer / operating system suffers from such issues.

The session restore function in designed to recover editing steps (not filter and encoder configurations in absence of editing steps which is somewhat contra-intuitive as it may not necessarily the last session which it would try to restore) from mishaps like accidentally closing the application window. It has nothing to do with crash recovery.

Who

Quote from: eumagga0x2a on May 28, 2021, 04:33:00 PM
Quote from: Who on May 28, 2021, 03:00:14 AMThe problem is that the only time I ever want to use it is when the computer or the program has crashed in the middle of encoding a large video.

This sort of crashes is utterly abnormal, they may be related to some hardware or driver issues, it is doubtful that even the proper crash recovery functionality may be of any use if the computer / operating system suffers from such issues.

If you think "This sort of crashes is utterly abnormal" for this piece of software you are delusional.  I run dozens of different pieces of software on this Mac Mini and not one of them crashes or terminates abnormally as much as Avidemux does.  At least it usually tends to wait until encoding is finished to throw a tantrum, but not always.

Quote from: eumagga0x2a on May 28, 2021, 04:33:00 PMThe session restore function in designed to recover editing steps (not filter and encoder configurations in absence of editing steps which is somewhat contra-intuitive as it may not necessarily the last session which it would try to restore) from mishaps like accidentally closing the application window. It has nothing to do with crash recovery.

Well then if that is the case, can we please have a different function that saves the project every time you start an encoding?  Because I don't know about anyone else, but personally I have absolutely no use whatsoever for a session restore function that only restores a session I have already completed my work on and am done with.  THAT session is of no use to me whatsoever!

I have to say, if they gave awards for software that's both very useful but also absolutely infuriating to use at times, Avidemux would be at or near the top of that list.  There are just so many things about it that do not work the way any normal person would expect, yet when you point one of them out the response is always some variation of "that's the way it's supposed to work!"  And invariably I ask myself, where is it supposed to work like that - in HELL?!?

I have such mixed emotions about this software, on the one hand I am very grateful it exists, but on the other hand I get so frustrated over some really poor "design choices" which I suspect are really bugs that no one wants to acknowledge or fix.

butterw

Short term: adding a save_project(filepath) to the TinyPy bindings would allow saving a backup of the project automatically if the user wants.

Longer term adding a robust user preference configuration system to Avidemux is absolutely needed. The lack of one is currently blocking progress.

eumagga0x2a

I've modified the behaviour of the function to save the state of editing on close to save the current session regardless of the presence of undo steps. The previous approach tied to the availability of undo steps felt really weird.

A function to manually create a snapshot of editing state without closing the video may evolve some day. Alternatively, Avidemux can be made to write the crash file timer-based and delete it on a regular exit contrary to a real crash.

Regarding the crashes at the end of encoding, we have identified in an older topic the OpenGL output (i.e. the graphics driver or the graphics card) as the culprit which can be worked around by switching to the "Qt" one. More benign crashes allow Avidemux to save state of editing, but this must be some driver- or hardware-related nastiness.

butterw

# (Auto)saving Projects

1) The right time to save the project is when you have finished editing, not when you close Avidemux, not when Avidemux  crashes (crash.py), and in the case of the OP before encoding starts.
2) Saving the project makes sense when there are unsaved changes, either when you know you have finished editing (ex: when you close Avidemux), or at a regular user specified time interval.
3)  Saving the project before you save the file could be the preferred approach for some users. This would be possible via scripting, if a save_project script binding was available.
4) Overwriting a single save file (lastEdit.py) is a deeply flawed concept, which doesn't allow for normal user mistakes.
5) If an automatic autoSave feature is turned on by default, the user should have the ability to turn it off if he doesn't want it (ex: Autosave Interval (in seconds) of 0 in preferences).

Who

Quote from: eumagga0x2a on May 29, 2021, 07:40:25 PMRegarding the crashes at the end of encoding, we have identified in an older topic the OpenGL output (i.e. the graphics driver or the graphics card) as the culprit which can be worked around by switching to the "Qt" one.

Ummm, not quite.  Switching to the "Qt" one simply means the program won't unexpectedly close when an encoding finishes, but what happens instead is nearly as bad - the program remains open but its windows disappear and there is no way to open them.  So you are pretty much forced at that point to close the program and re-open it.

But what is even worse is that sometimes, rarely but randomly, Avidemux will freeze up the entire system just at the point where it is saving the completed encoding.  You wind up with an unplayable file, but the system is froze up so tight that it either reboots itself or you have to power cycle it to get it running again.  I can almost guarantee that Avidemux is causing this because it always happens while Avidemux is running, and the file size of the destination encoded file is about what it should be but the file is trash, nothing will play it, meaning I suspect it happens right at the point where the file is being closed or is about to be closed.  It's very random, sometimes you can go for a month and not see this issue, then again I have seen it happen twice in the same week.  And the system never freezes up like that when Avidemux is not running.  It was just such a freeze that prompted me to write my original post above, because after the power cycle restart there was no way to recover my previous session.  And it happened to me again just yesterday!

I think something in a recent Apple update for Catalina might have made this issue worse, but I have no idea what.  I only say that because for a time after switching to "Qt" these problems were far less frequent.  But a couple of months ago or thereabouts I started seeing the problem of the disappearing and unrecoverable windows more frequently, and I think the freezes became more frequent also.  And again, I ONLY see this in Avidemux, and not in ANY other program I run.

Who

Quote from: butterw on May 30, 2021, 05:55:08 AM# (Auto)saving Projects

1) The right time to save the project is when you have finished editing, not when you close Avidemux, not when Avidemux  crashes (crash.py), and in the case of the OP before encoding starts.
2) Saving the project makes sense when there are unsaved changes, either when you know you have finished editing (ex: when you close Avidemux), or at a regular user specified time interval.
3)  Saving the project before you save the file could be the preferred approach for some users. This would be possible via scripting, if a save_project script binding was available.
4) Overwriting a single save file (lastEdit.py) is a deeply flawed concept, which doesn't allow for normal user mistakes.
5) If an automatic autoSave feature is turned on by default, the user should have the ability to turn it off if he doesn't want it (ex: Autosave Interval (in seconds) of 0 in preferences).

I agree with all this.  Too bad it seems like nobody's listening.