Page 1 of 2
NConvert useage: option -n
Posted: Tue Mar 01, 2016 6:54 pm
by cday
Could someone please provide an explanation for the operation of the following option listed in the help file:
Code: Select all
-n start end step : Begin End Step (for image sequence)
The option dates back to the early days of NConvert, but I am unable to find any explanation of its operation, intended useage or example of its use through searching the forum or a Google search...
Our forum librarian, who has uncanny search powers
Helmut who was any early NConvert user

Re: NConvert useage: option -n
Posted: Tue Mar 01, 2016 7:32 pm
by oops66
Hello ... A sample with option -n is into the xnview wiki, did not help?
http://www.xnview.com/wiki/index.php/NC ... User_Guide
Code: Select all
ou can use it with images sequences.
For example, to convert the files file00.pic, file01.pic, ..., file10.pic and we convert to jpeg format with the name pattern res0.jpg, res1.jpg, ... type :
nconvert -out jpeg -n 1 10 1 -o res#.jpg file##.pic
[/color]
Re: NConvert useage: option -n
Posted: Tue Mar 01, 2016 8:00 pm
by XnTriq
Hi cday

This is what I've got (so far):
<edit> Chapeau, Monsieur oops66 ! </edit>
Re: NConvert useage: option -n
Posted: Tue Mar 01, 2016 8:03 pm
by cday
oops66 wrote:Hello ... A sample with option -n is into the xnview wiki, did not help?
http://www.xnview.com/wiki/index.php/NC ... User_Guide
Code: Select all
You can use [NConvert] with images sequences.
For example, to convert the files file00.pic, file01.pic, ..., file10.pic and ... to jpeg format with the name pattern res0.jpg, res1.jpg, ... type :
nconvert -out jpeg -n 1 10 1 -o res#.jpg file##.pic
[/color]
[Code edited to increase clarity.]
Thank you, that didn't show up in my searches, and the Wiki's are not a resource I normally think to turn to as they are often very limited or out of date.
That confirms the use of
-n but I think I might have to do some tests to fully understand it...
Re: NConvert useage: option -n
Posted: Tue Mar 01, 2016 8:08 pm
by cday
And thanks also to
XnTriq whose usual wealth of links will hopefully provide some further insight...

Re: NConvert useage: option -n
Posted: Wed Mar 02, 2016 3:30 am
by XnTriq
cday wrote:Thank you, that didn't show up in my searches, and the Wiki's are not a resource I normally think to turn to as they are often very limited or out of date.
As it turns out, this info was transferred from
Usage.txt to the Wiki.
Re: NConvert useage: option -n
Posted: Wed Mar 02, 2016 11:24 am
by oops66
cday wrote:...Thank you, that didn't show up in my searches, and the Wiki's are not a resource I normally think to turn to as they are often very limited or out of date.
That confirms the use of -n but I think I might have to do some tests to fully understand it...
Hello Cday & Xntriq, you're welcome ... yes some others tests are needed too.
Re: NConvert useage: option -n
Posted: Wed Mar 02, 2016 7:40 pm
by cday
Code: Select all
-n start end step : Begin End Step (for image sequence)
http://www.xnview.com/wiki/index.php/NC ... User_Guide[/url]
You can use [NConvert] with images sequences.
For example, to convert the files file00.pic, file01.pic, ..., file10.pic and ... to jpeg format with the name pattern res0.jpg, res1.jpg, ... type :
nconvert -out jpeg -n 1 10 1 -o res#.jpg file##.pic
I've been doing some [limited] tests and
-n only seems to work correctly for step=1, depending on what behaviour is expected.
With 20 input files numbered test-01 to test-19 and step=2 only alternate input files are converted:
Code: Select all
nconvert -out png -n 1 20 2 -o Output-##.png test-##.png
With end=40 again only alternate input files are converted, with an error message:
Code: Select all
nconvert -out png -n 1 40 2 -o Output-##.png test-##.png
Am I missing something?
Edit
It looks as though step refers to the *input* file numbers, so there is no way to increment *output* file names other than by 1?
Wouldn't the expected behaviour be for all the input files to be processed, with the step applied to the output names?
That isn't really clear in the help file, if it is the case...
Re: NConvert useage: option -n
Posted: Wed Mar 02, 2016 10:25 pm
by cday
Please see the edit added at the end of the previous post!
Re: NConvert useage: option -n
Posted: Wed Mar 02, 2016 10:53 pm
by oops66
cday wrote:Please see the edit added at the end of the previous post!
... FYI, same issue uneder Linux version NCONVERT v6.17
Code: Select all
nconvert -out png -n 1 20 2 -o Output-##.png test-##.png
** NCONVERT v6.17 (c) 1991-2011 Pierre-E Gougelet (Sep 17 2012/10:50:01) **
Version for Linux x86 (X11) (All rights reserved)
** This is a freeware software (for non commercial use)
Conversion of test-01.png into Output-01.png OK
Conversion of test-03.png into Output-03.png OK
Conversion of test-05.png into Output-05.png OK
Conversion of test-07.png into Output-07.png OK
Conversion of test-09.png into Output-09.png OK
Conversion of test-11.png into Output-11.png OK
Conversion of test-13.png into Output-13.png OK
Conversion of test-15.png into Output-15.png OK
Conversion of test-17.png into Output-17.png OK
Conversion of test-19.png into Output-19.png OK
$
nconvert -out png -n 1 40 2 -o Output-##.png test-##.png
Conversion of test-01.png into Output-01.png OK
Conversion of test-03.png into Output-03.png OK
Conversion of test-05.png into Output-05.png OK
Conversion of test-07.png into Output-07.png OK
Conversion of test-09.png into Output-09.png OK
Conversion of test-11.png into Output-11.png OK
Conversion of test-13.png into Output-13.png OK
Conversion of test-15.png into Output-15.png OK
Conversion of test-17.png into Output-17.png OK
Conversion of test-19.png into Output-19.png OK
Conversion of test-21.png into Output-21.png OK
Conversion of test-23.png into Output-23.png OK
Conversion of test-25.png into Output-25.png OK
Error: Can't open file (test-27.png)
Error: Can't open file (test-29.png)
Error: Can't open file (test-31.png)
Error: Can't open file (test-33.png)
Error: Can't open file (test-35.png)
Error: Can't open file (test-37.png)
Error: Can't open file (test-39.png)
Re: NConvert useage: option -n
Posted: Thu Mar 03, 2016 9:22 am
by xnview
-n replace ## by the range/step specified, in your test it works for step 2
Re: NConvert useage: option -n
Posted: Thu Mar 03, 2016 9:29 am
by cday
xnview wrote:-n replace ## by the range/step specified, in your test it works for step 2
Thanks, could you please post an edited version of my command line?
Re: NConvert useage: option -n
Posted: Thu Mar 03, 2016 10:20 am
by oops66
cday wrote:xnview wrote:-n replace ## by the range/step specified, in your test it works for step 2
Thanks, could you please post an edited version of my command line?
... I think Pierre's saying than the errors are normal, because -n replace ## (but only/mostly for the inputs files)

Re: NConvert useage: option -n
Posted: Thu Mar 03, 2016 10:42 am
by cday
oops66 wrote:I think Pierre's saying than the errors are normal, because -n replace ## (but only/mostly for the inputs files)

Well, O.K., but ## appears in two places in the command line...
But perhaps this shines at least a little light on a seemingly little known and probably rarely used NConvert option...

Re: NConvert useage: option -n
Posted: Thu Mar 03, 2016 11:38 am
by oops66
cday wrote:... But perhaps this shines at least a little light on an seemingly little known and probably rarely used NConvert option...

... Right, this -n option is not well explained into the help (nconvert -help), and the wiki example is not the good one too.