Page 1 of 1

[RESOLVED] Indexer Exit Codes

Posted: Sun Sep 27, 2015 8:37 am
by Zathor
I noticed that when an index cannot be created because the license is invalid with DGIndexNV/DGindexIM that the exit code is 0.
0 is also the exit code when everything is fine.

I am not sure what exit code will be returned for other error cases (hard disk full, video cannot be indexed, ...) as I have not tested that.

Is it possible to only return 0 when the index has been created successfully and in all other cases something else (e.g. specific to the error or always the same number)?
Otherwise I will implement a workaround in MeGUI so that a missing index file is detected as a failure but I am not sure if an abort due to insufficient hard disk space can be detected that way.

Thanks in advance for your advise! :)

Re: Indexer Exit Codes

Posted: Sun Sep 27, 2015 9:10 am
by admin
Sure, no problem. Give me a few days.

Re: Indexer Exit Codes

Posted: Sun Sep 27, 2015 9:38 am
by Zathor
Great! Thank you very much and take your time.

Re: Indexer Exit Codes

Posted: Tue Sep 29, 2015 12:07 pm
by admin
Here's something to test:

http://rationalqm.us/misc/zathor.zip

The MKV framerate issue should be solved. For the CLI error stuff I have implemented a return of 0 if everything goes OK, a return of 1 if the input file is not found, and a return of 2 for a bad license. I haven't done anything for a failure to make the DGI file as it is not so easy with my architecture. If I find a way to do it without too much hassle I will add it.

Please advise your test results.

Re: Indexer Exit Codes

Posted: Tue Sep 29, 2015 2:28 pm
by Zathor
admin wrote:Here's something to test:
Great, thank you very much!
admin wrote:The MKV framerate issue should be solved.
Yes, the sample is now detected as "FPS 239760 / 10000" which is more or less fine. Do you know why it is not written as "FPS 23976 / 1000"?
admin wrote:For the CLI error stuff I have implemented a return of 0 if everything goes OK, a return of 1 if the input file is not found, and a return of 2 for a bad license.
0 works as expected
1 works as expected
2 is also thrown but now there is no popup anymore that the license is wrong or the file is not found. Is this intentional? Then I will create a popup that the license is bad. Or is it possible to write to the console (when started with the command line) a message like "ERROR: Invalid license"? (and then also a message for exit code 1).

EDIT: I am also looking forward for DGIndexIM but I assume you want to implement it first in NV and then add it to IM. :agree:

Re: Indexer Exit Codes

Posted: Tue Sep 29, 2015 3:23 pm
by Aleron Ives
Zathor wrote:Yes, the sample is now detected as "FPS 239760 / 10000" which is more or less fine. Do you know why it is not written as "FPS 23976 / 1000"?
More importantly, shouldn't it be detected as 24000 / 1001, as that's the true framerate? 23.976 is an approximation, just as 29.970 is an approximation for 30000 / 1001 FPS.

Re: Indexer Exit Codes

Posted: Wed Sep 30, 2015 9:58 am
by admin
@Aleron

The frame DefaultDuration value specified in the MKV is 41708333 nanosec. That does not convert to the exact rate of 24000/1001. I could implement it such that a rate close enough to 24000/1001 is reported thusly, but I prefer to just give the approximation derived from the actual stream value and leave it at that. I doubt it is as important as you claim. Anyone that has a use case that is so sensitive can apply AssumeFPS(24000,1001) in the script. I'd be surprised if such a use case exists (i.e., where 23.9760 is not sufficiently precise).

@Zathor

Re: 239760/10000. That was just a choice of mine to allow for an extra decimal point of precision. In AVC we have these two numbers (fps_num and fps_den) in the stream. In MKV we have just the DefaultDuration and I have to invent fps_num and fps_den. Is it OK as is or do you need something specific?

Regarding the popup. I thought showing it was inconsistent with -h. I'll add a console error message.

Yes, first DGDecNV and then DGDecIM. ;)

I'll slipstream it when you tell me it's OK.

Re: Indexer Exit Codes

Posted: Wed Sep 30, 2015 2:32 pm
by Aleron Ives
Ah, if it's a limitation of MKV, then I agree it isn't your problem to deal with. ;)

Re: Indexer Exit Codes

Posted: Thu Oct 01, 2015 11:24 am
by Zathor
admin wrote:Re: 239760/10000. That was just a choice of mine to allow for an extra decimal point of precision. In AVC we have these two numbers (fps_num and fps_den) in the stream. In MKV we have just the DefaultDuration and I have to invent fps_num and fps_den. Is it OK as is or do you need something specific?
This is ok. It is only for the edge cases where the container has a different FPS than the stream and this should not happen so often. Precision should be fine. For 200.000 frames you have a difference of 8ms and I doubt that this will be noticed at all.
admin wrote:Regarding the popup. I thought showing it was inconsistent with -h. I'll add a console error message.
Yes, I agree that a popup should not appear when startet from the CLI. Looking forward to the console error message :)

Re: Indexer Exit Codes

Posted: Thu Oct 01, 2015 3:37 pm
by admin
Thank you for your comments, Aleron and Zathor.

I have slipstreamed the changes for DGIndexNV.

Moving on to DGDecIM...

Re: Indexer Exit Codes

Posted: Fri Oct 02, 2015 9:37 am
by admin
@Zathor

Here are the revised DGIndexIM builds. Please test them. When I get your OK I will slipstream them.

http://rationalqm.us/misc/zathor_im.zip

Re: Indexer Exit Codes

Posted: Mon Oct 05, 2015 8:08 am
by admin
I went ahead and slipstreamed them.

Re: [RESOLVED] Indexer Exit Codes

Posted: Mon Oct 05, 2015 2:00 pm
by Zathor
Sorry, I was away over the weekend. Thank you very much!