[RESOLVED] Indexer Exit Codes

Anything related to video and my tools that is not a support request.
Post Reply
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

[RESOLVED] Indexer Exit Codes

Post 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! :)
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Indexer Exit Codes

Post by admin »

Sure, no problem. Give me a few days.
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: Indexer Exit Codes

Post by Zathor »

Great! Thank you very much and take your time.
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Indexer Exit Codes

Post 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.
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: Indexer Exit Codes

Post 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:
DAE avatar
Aleron Ives
Posts: 126
Joined: Fri May 31, 2013 8:36 pm

Re: Indexer Exit Codes

Post 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.
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Indexer Exit Codes

Post 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.
DAE avatar
Aleron Ives
Posts: 126
Joined: Fri May 31, 2013 8:36 pm

Re: Indexer Exit Codes

Post by Aleron Ives »

Ah, if it's a limitation of MKV, then I agree it isn't your problem to deal with. ;)
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: Indexer Exit Codes

Post 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 :)
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Indexer Exit Codes

Post by admin »

Thank you for your comments, Aleron and Zathor.

I have slipstreamed the changes for DGIndexNV.

Moving on to DGDecIM...
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Indexer Exit Codes

Post 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
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Indexer Exit Codes

Post by admin »

I went ahead and slipstreamed them.
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: [RESOLVED] Indexer Exit Codes

Post by Zathor »

Sorry, I was away over the weekend. Thank you very much!
Post Reply