Avidemux Forum

Avidemux => Windows => Topic started by: Bearbear on October 04, 2019, 12:53:06 AM

Title: A few Queue problems/bugs
Post by: Bearbear on October 04, 2019, 12:53:06 AM
I'm currently running Avidemux 2.7.5 on Windows 10 build 1803, but for a while now I've come across a few queue bugs that I don't believe were present in a fairly older version of Avidemux.

The first is when I queue up a few jobs and then run them, it now spawns extra progress windows that seemingly don't do anything - as in the percentage bar or text never changes on 2 of them (see attachment screenshot). Uninstalling/reinstalling doesn't alleviate this problem. The extra progress windows don't appear to do any harm and close when all jobs are finished, but it's strange that they're even there when they didn't used to be.

The second problem is that when I open an mkv file, do some simple cutting and queue the job to output as another mkv, it always fails. What's more bizarre is that if I load the same .py job into the main program and simply save it from there (not using the Queue), it saves fine.

Here's an example .py job that fails with the Queue:

#PY  <- Needed to identify #
#--automatically built--

adm = Avidemux()
adm.loadVideo("D:/foo.mkv")
adm.clearSegments()
adm.addSegment(0, 0, 1092483332)
adm.markerA = 0
adm.markerB = 1092483332
adm.setPostProc(3, 3, 0)
adm.videoCodec("x265", "useAdvancedConfiguration=True", "general.params=AQ=25", "general.poolThreads=99", "general.frameThreads=0", "general.preset=ultrafast", "general.tuning=none", "general.profile=main", "level=-1", "vui.sar_height=1"
, "vui.sar_width=1", "MaxRefFrames=3", "MinIdr=25", "MaxIdr=250", "i_scenecut_threshold=40", "MaxBFrame=3", "i_bframe_adaptive=1", "i_bframe_bias=0", "i_bframe_pyramid=2", "b_deblocking_filter=True", "interlaced_mode=0"
, "constrained_intra=False", "lookahead=40", "weighted_pred=2", "weighted_bipred=True", "cb_chroma_offset=0", "cr_chroma_offset=0", "me_method=3", "me_range=16", "subpel_refine=5", "trellis=1", "psy_rd=1.000000"
, "fast_pskip=True", "dct_decimate=True", "noise_reduction=0", "noise_reduction_intra=0", "noise_reduction_inter=0", "strong_intra_smoothing=True", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0"
, "ratecontrol.qp_step=4", "ratecontrol.bitrate=0", "ratecontrol.rate_tolerance=1.000000", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=1", "ratecontrol.ip_factor=1.400000"
, "ratecontrol.pb_factor=1.300000", "ratecontrol.aq_mode=2", "ratecontrol.aq_strength=1.000000", "ratecontrol.cu_tree=True", "ratecontrol.strict_cbr=False")
adm.addVideoFilter("swscale", "width=1280", "height=720", "algo=2", "sourceAR=0", "targetAR=0", "lockAR=True", "roundup=False")
adm.audioClearTracks()
adm.setSourceTrackLanguage(0,"und")
adm.audioAddTrack(0)
adm.audioCodec(0, "LavAAC");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0, 0)
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280", "displayAspectRatio=0")


The problem seems to be specifically with mkv files, mp4 files are fine. Is it a problem with adm.loadVideo and mkv files? Unfortunately the command line window closes too fast for me to see what kind of errors it shows.

Whilst I'm here, is there a way to disable only the error message "Cannot go to next keyframe"? I'm aware you can change the overall message level via a dropdown in the options, but it's only the next keyframe error message that I'd like to disable since the other messages are useful.
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 04, 2019, 06:27:23 AM
Do the problems disappear when you let the Jobs GUI launch the Qt version of Avidemux instead of the CLI one?

The example is not simple cutting. It is re-encoding with x265 to HEVC. Does it work when you use x264 instead?

QuoteWhilst I'm here, is there a way to disable only the error message "Cannot go to next keyframe"?

No, there is just a hardcoded timer which prevents a new popup if the previous one was shown less than 5 seconds ago.
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 04, 2019, 06:54:26 AM
Could you please also attach jobslog.txt from %localappdata%\avidemux from a run showing the issues?

I can't reproduce the problems including opening multiple progress dialogs on macOS, where the CLI version seems to work fine.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 04, 2019, 09:38:33 AM
I can't seem to post the reply I originally wrote since the jobslog contains emails, which I therefore edited out, but the forum thinks I'm still spamming since I'm trying to post the same reply. Amazing.

I'll try editing this post:

Quote from: eumagga0x2a on October 04, 2019, 06:27:23 AM
Do the problems disappear when you let the Jobs GUI launch the Qt version of Avidemux instead of the CLI one?
The 3 progress windows still spawn when I tick the "use Qt version" checkbox and run (see attachment). However, the mkv job does work, I presume this is because it's loading the job through the main program. For now I guess I'll use the Qt version option since it was annoying coming back to my PC many hours later after I started my queue and seeing several jobs had failed, all of which were where a mkv was used as the input file.

QuoteDoes it work when you use x264 instead?
Both problems still occur if I change to x264.

Here's my jobslog.txt:

*************************
  Avidemux Jobs v2.7.5
*************************
http://www.avidemux.org
Code      : Mean, JSC, Gruntster
GFX       : Nestor Di ,
Design    : Jakub Misak
FreeBSD   : Anish Mistry,
Audio     : Mihail Zenkov
MacOsX    : Kuisathaverat
Win32     : Gruntster

Build Target: Microsoft Windows (x86-64)
Operating System: Microsoft Windows (6.2.9200; 64-bit)
Initializing WinSock
WinSock ok
[ADMJob::jobInit] 09:01:32-237 Initializing database (C:\Users\me\AppData\Roaming\avidemux\jobs.sql)
[ADM_jobCheckVersion] 09:01:32-238 Db version 3, our version 3
[ADM_jobCheckVersion] 09:01:32-238 Same version, continuing..
[ADMJob::jobInit] 09:01:32-238 Successfully connected to jobs database..
[loadTranslator] 09:01:32-260 Using system language
[loadTranslator] 09:01:32-260 Initializing language en_GB
[loadTranslator] 09:01:32-260 Translation folder is <C:\Program Files\Avidemux\qt5\i18n\>
[loadTranslation] 09:01:32-260 [Locale] Loading language file C:\Program Files\Avidemux\qt5\i18n\qtbase_en_GB [loadTranslation] 09:01:32-260 FAILED
[loadTranslation] 09:01:32-260 [Locale] Loading language file C:\Program Files\Avidemux\qt5\i18n\avidemux_en_GB [loadTranslation] 09:01:32-261 succeeded
[loadTranslator] 09:01:32-261 Updating translations...
[loadTranslator] 09:01:32-261 [Locale] Test: &Edit -> &Edit

[ADM_socket::createBindAndAccept] 09:01:32-471 Binding on 127.0.0.1:0
[ADM_socket::createBindAndAccept] 09:01:32-471 Socket bound to port 9246
[jobWindow::jobWindow] 09:01:32-471 Socket bound to 9246
*
*
[jobWindow::refreshList] 09:01:32-471 Found 2 jobs
[jobProgress::jobProgress] 09:01:43-197 Starting progress dialog
[jobProgress::jobProgress] 09:01:43-232 Starting progress dialog
[jobProgress::jobProgress] 09:01:43-263 Starting progress dialog
*
*
[jobWindow::refreshList] 09:01:43-317 Found 2 jobs
[spawnProcess] 09:01:43-378 Starting <avidemux_cli.exe>
[spawnProcess] 09:01:43-378 0 : --nogui
[spawnProcess] 09:01:43-378 1 : --slave 9246
[spawnProcess] 09:01:43-378 2 : --run "C:\Users\me\AppData\Roaming\avidemux\jobs\\Job 2019-10-04 100024.py"
[spawnProcess] 09:01:43-378 3 : --save "D:/test1.mkv"
[spawnProcess] 09:01:43-378 4 : --quit
[spawnProcess] 09:01:43-378 =>avidemux_cli.exe --nogui  --slave 9246 --run "C:\Users\me\AppData\Roaming\avidemux\jobs\\Job 2019-10-04 100024.py"  --save "D:/test1.mkv"  --quit
[spawnProcess] 09:01:43-378 ==================== Start of spawner process job ================
[spawnProcess] 09:01:43-384 ==================== End of spawner process job ================
[jobWindow::spawnChild] 09:01:44-383 Spawning successfull
[ADM_socket::waitForConnect] 09:01:44-383 Accepting...
[ADM_commandSocket::handshake] 09:01:44-383 Waiting for hello message...
[ADM_commandSocket::handshake] 09:01:44-383 Got hello message, continuing...
[ADM_commandSocket::pollMessage] 09:01:45-383 Timeout on socket
[jobWindow::runOneJob] 09:01:46-385 Got a new message 3
Progress 3 %
[jobWindow::runOneJob] 09:01:47-009 Got a new message 3
Progress 8 %
[ADM_commandSocket::pollMessage] 09:01:48-012 Timeout on socket
[jobWindow::runOneJob] 09:01:49-012 Got a new message 3
Progress 13 %
[jobWindow::runOneJob] 09:01:49-040 Got a new message 3
Progress 18 %
[ADM_commandSocket::pollMessage] 09:01:50-041 Timeout on socket
[jobWindow::runOneJob] 09:01:52-517 Got a new message 3
Progress 23 %
[jobWindow::runOneJob] 09:01:52-518 Got a new message 3
Progress 27 %
[jobWindow::runOneJob] 09:01:52-519 Got a new message 3
Progress 32 %
[jobWindow::runOneJob] 09:01:53-058 Got a new message 3
Progress 36 %
[jobWindow::runOneJob] 09:01:54-058 Got a new message 3
Progress 40 %
[jobWindow::runOneJob] 09:01:55-070 Got a new message 3
Progress 45 %
[jobWindow::runOneJob] 09:01:56-071 Got a new message 3
Progress 50 %
[jobWindow::runOneJob] 09:01:57-072 Got a new message 3
Progress 55 %
[ADM_commandSocket::pollMessage] 09:01:58-075 Timeout on socket
[jobWindow::runOneJob] 09:01:59-075 Got a new message 3
Progress 60 %
[jobWindow::runOneJob] 09:01:59-097 Got a new message 3
Progress 65 %
[jobWindow::runOneJob] 09:02:00-099 Got a new message 3
Progress 70 %
[ADM_commandSocket::pollMessage] 09:02:01-099 Timeout on socket
[jobWindow::runOneJob] 09:02:02-100 Got a new message 3
Progress 75 %
[jobWindow::runOneJob] 09:02:02-105 Got a new message 3
Progress 80 %
[ADM_commandSocket::pollMessage] 09:02:03-106 Timeout on socket
[jobWindow::runOneJob] 09:02:04-107 Got a new message 3
Progress 85 %
[jobWindow::runOneJob] 09:02:04-126 Got a new message 3
Progress 89 %
[ADM_commandSocket::pollMessage] 09:02:05-127 Timeout on socket
[jobWindow::runOneJob] 09:02:06-128 Got a new message 3
Progress 94 %
[jobWindow::runOneJob] 09:02:06-128 Got a new message 2
[jobWindow::runOneJob] 09:02:06-128 Result is 1
*
*
[jobWindow::refreshList] 09:02:06-149 Found 2 jobs
[jobWindow::runOneJob] 09:02:06-150 Running job id = 1
*
*
[jobWindow::refreshList] 09:02:06-163 Found 2 jobs
[spawnProcess] 09:02:06-163 Starting <avidemux_cli.exe>
[spawnProcess] 09:02:06-163 0 : --nogui
[spawnProcess] 09:02:06-163 1 : --slave 9246
[spawnProcess] 09:02:06-163 2 : --run "C:\Users\me\AppData\Roaming\avidemux\jobs\\Job 2019-10-04 100109.py"
[spawnProcess] 09:02:06-163 3 : --save "D:/mkvtest.mkv"
[spawnProcess] 09:02:06-163 4 : --quit
[spawnProcess] 09:02:06-163 =>avidemux_cli.exe --nogui  --slave 9246 --run "C:\Users\me\AppData\Roaming\avidemux\jobs\\Job 2019-10-04 100109.py"  --save "D:/mkvtest.mkv"  --quit
[spawnProcess] 09:02:06-163 ==================== Start of spawner process job ================
[spawnProcess] 09:02:06-164 ==================== End of spawner process job ================
[jobWindow::spawnChild] 09:02:07-167 Spawning successfull
[ADM_socket::waitForConnect] 09:02:07-167 Accepting...
[ADM_commandSocket::handshake] 09:02:07-167 Waiting for hello message...
[ADM_commandSocket::handshake] 09:02:07-167 Got hello message, continuing...
[ADM_commandSocket::getMessage] 09:02:07-277 command error rxing data
[jobWindow::runOneJob] 09:02:08-286 Exiting loop
[jobWindow::runOneJob] 09:02:08-286 ** End of slave process **
[jobWindow::runOneJob] 09:02:08-286 ** End of slave process **
[jobWindow::runOneJob] 09:02:08-286 ** End of slave process **
*
*
[jobWindow::refreshList] 09:02:08-315 Found 2 jobs
[jobWindow::runOneJob] 09:02:08-316 Running job id = 2
[jobProgress::~jobProgress] 09:02:08-316 Deleting progress..
Cleaning up
[ADMJob::jobShutDown] 09:02:08-320 Shutting down jobs database
[onexit] 09:02:08-320
Goodbye...


From what I can see, the error it gives for the mkv file is command error rxing data
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 04, 2019, 10:44:50 AM
Could you please run the command the Jobs GUI tries to run

avidemux_cli.exe --nogui --run "C:\Users\me\AppData\Roaming\avidemux\jobs\\Job 2019-10-04 100109.py" --save "D:/mkvtest2.mkv" --quit

in cmd.exe window, just without the "--slave" option and with a new file name to avoid trying to overwrite an existing output file? Don't forget to cd /d "Path to folder with avidemux_cli.exe" before executing the command (you've edited out this part of jobslog.txt). Alternatively, call avidemux_cli.exe with full path.

The real error would remain readable in the cmd.exe window.

The only difference between the Mp4 and Matroska demuxers I can think of which might be relevant here is that the Matroska demuxer opens a progress dialog  while indexing the file, which can be dismissed, so that loading the file fails. Maybe there is a bug in the silent mode (--nogui) implementation automatically dismissing this dialog, I need to check it.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 04, 2019, 11:36:10 AM
Quote from: eumagga0x2a on October 04, 2019, 10:44:50 AM
Don't forget to cd /d "Path to folder with avidemux_cli.exe" before executing the command (you've edited out this part of jobslog.txt).
The only thing I edited out from that jobslog.txt were the emails which this forum disallows.

I've had to attach the output of cmd.exe (see cmdoutput.txt) since it exceeds 20000 characters, the limit of a post on this forum.

Small side request, would it be possible for the Queue save file name dialog box to mimic the standard Save dialog box?

Currently if you select an Output Format, i.e. Mkv Muxer, when using standard Save, the "Save as type" dropdown correctly uses whatever you selected as the Output Format (see attachment save_extension.png). However, when using the Queue, the "Save as type" dropdown always uses "All files (*.*)" which means the automatically generated file name ends with an asterisk for the file extension (see attachment queue_extension.png).
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 04, 2019, 11:37:25 AM
I think I can reproduce the behavior you describe with multiple progress dialogs and failures by pressing the "Run jobs" button a second time before  all jobs have been completed.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 04, 2019, 11:48:42 AM
Quote from: eumagga0x2a on October 04, 2019, 11:37:25 AM
I think I can reproduce the behavior you describe with multiple progress dialogs and failures by pressing the "Run jobs" button a second time before  all jobs have been completed.
I only ever press the button once though. Is it a case of the "Run jobs" button running the operation twice, once on mouse click down and again on mouse click up?

Edit: I just tested my theory by only pressing down on the run jobs button and not letting go of the mouse and it still spawns multiple progress dialogs :(

Edit2: For me when I keep on pressing the Run jobs button, it forces Avidemux CLI to encode the next job in the queue, so I had multiple CLI windows up of all the jobs Avidemux was concurrently encoding. More progress dialogs do appear too (beyond the "normal" 3), but if I press the Run job button once more above the total number of queued jobs (i.e. 3 queued jobs, I press the run jobs button 4 times), all the progress dialogs close, but the files do still encode.

Here's a short video of it happening: https://streamable.com/qgjgs

3 Progress dialogs always appear after pressing the Run jobs button once, subsequent presses produces 1 Progress dialog and 1 CLI window for every remaining job in the queue. However, pressing the Run job button when there are no jobs remaining closes all the Progress dialogs and also the main Avidemux jobs window as well, leaving only the CLI windows.
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 04, 2019, 12:44:34 PM
On macOS, just clicking on "Run jobs" once results in a normal operation, i.e. no multiple progress dialogs, no failures.

Looking into enabling extension filtering for "Add to queue".
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 04, 2019, 01:08:48 PM
The latter should be fixed by [gui] Enable default extension filtering for file dialog when adding job to queue (https://github.com/mean00/avidemux2/commit/3ce838ec3d58e9c66fe0d3805786593de57a6b02).
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 04, 2019, 01:13:40 PM
Quote from: eumagga0x2a on October 04, 2019, 01:08:48 PM
The latter should be fixed by [gui] Enable default extension filtering for file dialog when adding job to queue (https://github.com/mean00/avidemux2/commit/3ce838ec3d58e9c66fe0d3805786593de57a6b02).
Awesome, thank you! I'm assuming or at least hoping your fix will be added to the master branch of Avidemux since I have no means of compiling the code myself :)
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 04, 2019, 01:16:12 PM
It is in the master branch, the functionality will be available in the next 64 bits nightly (the patch doesn't apply to legacy-compat without additional work, so it won't be in 32 bits builds for now).
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 04, 2019, 05:05:59 PM
I've done a few more tests since as I said in a previous post "I don't believe [these bugs] were present in a fairly older version of Avidemux".

I installed http://www.avidemux.org/nightly/win32_support/avidemux_2.6.20_r170428_win32.exe dated Apr 28 2017 and both problems of 3 progress dialogs and loading a mkv via the queue are not present, in other words, everything works fine and as intended.

I then installed the current latest 32bits (avidemux_2.7.5 r191003_win32.exe dated Oct 3 2019) and only 1 progress dialog appears when pressing "run jobs". I therefore believe the 3 progress dialog bug is 64 bits only.

I cannot determine what causes the mkv bug that I'm experiencing. Sometimes the job will run, but most of the time (99%) it will not with avidemux_2.7.5 r191003_win32.exe. I cannot get the mkv job to run at all with either of the latest 64bit nightlies (avidemux_2.7.5 r191003_win64.exe & avidemux_r191003_win64Qt5_65.zip).
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 05, 2019, 04:51:55 AM
I got to test it briefly with the latest MinGW nightly on Windows 10.

As suspected, auto-dismissing the MKV indexing dialog in the CLI version is the direct culprit of the problem. As a surprise, the dialog gets dismissed independently from the --nogui option, and as a big surprise, the timestamp in the job name, provided by ADM_getTimeDateAsString() is returned as UNKNOWN which means that something is wrong either with ADM_getSecondsSinceEpoch(), with localtime() or with strftime().

Finally, with all spawned avidemux_cli.exe processes exiting immediately, Jobs GUI crashes with access violation while cleaning up the progress dialog (I did not get to see multiple progress dialogs, but can't rule out that they were obscured by big cmd.exe windows as the whole process took only a couple of seconds, too short to react and to switch tasks when unprepared).

This makes a pretty full menu for tonight :D
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 05, 2019, 09:12:29 AM
Should be fixed now by commits [cli/DIA_working] Fix use of uninitialized memory which caused loading Matroska files to fail randomly (https://github.com/mean00/avidemux2/commit/56667cbe035f28561f50cf9dc1eeae75341bbd5a) and [Qt/jobs] Safeguard against concurrent execution of jobWindow::runAllJob() and subsequent crash from NULL pointer dereference (https://github.com/mean00/avidemux2/commit/2ad14a57b708f0b4a286fa9db13b8612bebda3f3), please try a future nightly.

Earlier versions were not affected by the first bug because it was impossible to cancel indexing of MKV files.

No idea ATM why clicking on "Run jobs" triggers multiple click events and thus multiple calls to runAllJob() with a more up-to-date Qt version on your system (the legacy-compat branch used to generate 32 bits builds uses a very old Qt). With the patch, it should not have detrimental effects anymore.

Thank you for your report.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 05, 2019, 09:16:27 AM
Quote from: eumagga0x2athe timestamp in the job name, provided by ADM_getTimeDateAsString() is returned as UNKNOWN which means that something is wrong either with ADM_getSecondsSinceEpoch(), with localtime() or with strftime().
The current download for Avidemux 2.7.5 Final 64 bits (MD5: 56110c8050ec01c8690567830240e290) does not have this problem, so there's some sort of magical code there that works. All other current nightlies (avidemux_2.7.5 r191003_win32, avidemux_2.7.5 r191003_win64.exe, avidemux_r191003_win64Qt5_65) and the 2.7.4 32 bits version on Fosshub however, does have this timestamp bug.

Quote from: eumagga0x2aShould be fixed now by commits
Thanks again for all the hard work, I very much appreciate it!
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 05, 2019, 09:27:55 AM
Just to clarify: I haven't tried to investigate the timestamp issue because I don't have access to the necessary build env at the moment. The issue is limited to MinGW builds, maybe even only to official MinGW builds, the VC++ builds like the official release build use a different code path and are not affected.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 05, 2019, 09:40:56 AM
I see, thanks for the clarification.

Could I also ask if the problem found in this topic (https://avidemux.org/smif/index.php/topic,18675.msg86205.html#msg86205) with Avidemux not appearing in the "Open With" context menu when using the VC++ builds can be fixed or not (other than using MinGW builds which have a NSIS installer) or is it just an inherent problem with the installer?

Apologies for all the requests :-[
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 05, 2019, 09:45:07 AM
A fresh 64 bits MinGW nightly (191005) has been uploaded --> https://avidemux.org/nightly/win64/

Can't help with the "Open With" annoyance, I'm sorry.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 05, 2019, 04:53:13 PM
That's great, thanks ever so much, I really do appreciate it!

From some quick tests, the new nightly build works great and for some reason only 2 progress dialogs appear, so that's something I guess? ;)

Also not to worry about the Open With issue, it's relatively minor and as a workaround I add a shortcut to Avidemux in Windows' SendTo folder (C:\Users\[username]\AppData\Roaming\Microsoft\Windows\SendTo) which gives virtually the same functionality as the Open With menu (see attachment).

May I ask another question, I'm not sure if this is intended functionality or not, but the .py jobs that are created (in \AppData\Roaming\avidemux\jobs) and added to the queue, do they ever get automatically deleted? The "Cleanup" button or right click > Delete on a job in the Avidemux Jobs window doesn't seem to delete the .py files.
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 05, 2019, 07:35:47 PM
Quote from: Bearbear on October 05, 2019, 04:53:13 PM
for some reason only 2 progress dialogs appear, so that's something I guess? ;)

Do you get this only with number of jobs being greater than one?

I'll try to reproduce later, for now just a purely theoretical polishing action with [Qt/jobs] Open progress dialog only once there are jobs to run, check that it has not yet been created when trying to run a job from context menu (https://github.com/mean00/avidemux2/commit/1a53b180d988391c4e88d04871e1ea8db4ecc5a4) to reduce dialog resizing and to avoid a possible crash when trying to use "Run now" context menu item while other jobs are running.

Please provide a new jobslog.txt from such a multiple progress dialog run.

QuoteI'm not sure if this is intended functionality or not, but the .py jobs that are created (in \AppData\Roaming\avidemux\jobs) and added to the queue, do they ever get automatically deleted?

No, it is up to the user to remove them manually. This is a known feature / limitation / shortcoming of the existing implementation.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 06, 2019, 11:54:33 AM
Quote from: eumagga0x2a on October 05, 2019, 07:35:47 PM
Do you get this only with number of jobs being greater than one?
No, 2 progress dialogs appear even if I only run 1 job. I've tried testing 1, 2, 3 jobs, encoding to x265/mkv, to x264/mp4 and to xvid4/avi, and it always produces 2 progress dialogs.

Edit:- One thing I have noticed however, if I right click > "Run Now" on a job in the job queue, only 1 progress dialog appears, so the problem is specifically to do with the "Run jobs" button itself.

Quote from: eumagga0x2aPlease provide a new jobslog.txt from such a multiple progress dialog run.
I've attached jobslog.txt (and screenshots) from doing only 1 job and 3 jobs via the Run jobs button.

Quote from: eumagga0x2aNo, it is up to the user to remove them manually. This is a known feature / limitation / shortcoming of the existing implementation.
I suspected as much and again, it's only a minor quibble :)
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 06, 2019, 12:28:59 PM
Thank you, I've just tried it with the latest nightly (i.e. without the last patch) and can confirm the puzzling behavior on Windows (puzzling because even with the last patch reverted, I don't get two progress dialogs created on macOS when clicking on "Run jobs").
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 06, 2019, 01:13:44 PM
I've tried testing a single job in the queue and continuously doing a cycle of clicking Run jobs, letting it finish, forcing it to ready and clicking Run jobs again. It seems every few tries or so I do get 1 progress dialog, but often it's still 2, as seen in this video: https://streamable.com/tkdmi

I have yet to deduce why this is, I thought it was the speed between when I hovered over the Run job and the actual mouse click at first, or maybe there's a lingering CLI process or connection in the background, but honestly it seems completely random.

I've attached a jobslog.txt if that helps.
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 06, 2019, 02:18:34 PM
Thank you, so this should be some race condition. Let's wait until there is a new nightly which includes the patch which moved the open() call out of the progress dialog constructor.
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 06, 2019, 02:55:14 PM
A fresh MinGW nightly (191006) has been uploaded to https://avidemux.org/nightly/win64/ (https://avidemux.org/nightly/win64/), the issue with multiple progress dialogs seems to be fixed.

Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 06, 2019, 04:23:58 PM
It certainly does look like the problem has been fully resolved, I sound like a broken record, but thanks again! ;D

I guess the only remaining thing is the jobs timestamp issue with MinGW builds, but as you said earlier you don't have the build environment to debug, plus I can always wait for the next VC++ stable.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 13, 2019, 10:20:27 PM
I've run into a new problem with the Queue, I believe it's tied with problematic video files that give the question "This video contains B-frames, but presentation time stamps (PTS) are either missing or monotonically increasing. Avidemux can try to reconstruct correct PTS by decoding the entire video. This may take a lot of time. Proceed?" when opening in Avidemux.

I select "No" as it pops up in Avidemux, edit and then add the file to the Queue. However whilst running the job from the Queue, it always silently selects "Yes". I think this causes a discrepancy between the times it is looking for and the adm.addSegment times that are listed in the .py job file.

I'm not 100% sure that's the reason why the job is failing, but that's my deduction anyway.

I've attached the jobslog.txt and here's cmd.exe Avidemux CLI output when running the same .py job manually without the slave option (too big for attachment):

https://paste.ee/p/moNuI

Would it be possible for the Queue to honour whatever answer you chose for the initial question and parse that rather than always defaulting to Yes?
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 13, 2019, 10:54:59 PM
The only operation which has a chance to succeed without reconstructing the right display order and thus PTS of all frames is plainly re-encoding the entire video, so if you want to edit it, you MUST let the reconstruction complete.

The internal way to perform the task should be improved (we don't need to decode macroblocks, just parsing the slice headers would be enough, but all we have just now is a hammer, so everything must be a nail), this is true, of course.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 13, 2019, 11:00:30 PM
Sorry maybe I'm not following, but if I load the same problematic .py job (see attachment) with the GUI, select "No" to the aforementioned question, and save through there (as opposed to using the Queue), the video saves fine. There doesn't seem to be a need for reconstructing the correct PTS, in my case at least.

To clarify, by editing I mean I cut portions out, sometimes scale down to 720p, re-encode the video to HEVC in a mkv container, but leave the audio to Copy.
Title: Re: A few Queue problems/bugs
Post by: eumagga0x2a on October 14, 2019, 12:30:42 AM
Your source file is a mp4, so the reason for the PTS reconstruction prompt appearing, aimed at AVI where PTS are missing by design, is likely not missing PTS but wrong (out of order) PTS. The admlog.txt from loading the source mp4 would have clarified the actual reason. Yes, the PTS are out of order, so the reconstruction is triggered.

As long as keyframe PTS are present and correct, saving may indeed succeed as you describe, but this is more of an edge case, IMHO.

I'm not inclined to make it easier for users to shoot their own feet as with different setup and PTS broken in a different way and copy mode instead of re-encoding the output would be broken too. In silent mode (this is what Jobs GUI with CLI Avidemux is doing), the only safe option is to get correct PTS for the whole video.

However, the tools to reconstruct PTS should be improved, so that it doesn't take significantly more time than just indexing a MKV. This is on my todo list.
Title: Re: A few Queue problems/bugs
Post by: Bearbear on October 14, 2019, 04:21:21 PM
Thanks for looking into it, I guess I'll just have to manually save the problematic files rather than using the Queue.