On Wed, 26 Jan 2005, E.Chalaron wrote:

> Thanks all for your advice. Will do something about parameters.... :-) like 

        <grin>

> Anyway I have another small thing here.
> A 400 ft reel of Super 8 comes to 28800 individual frames, which is obviously 
> too much to handle for bash/cat

        I was waiting for that issue to come up ;)

> the following is (of course) sending me back an error
> 
> find . -name \*.ppm | ppmtoy4m | blabla

> **ERROR: [ppmtoy4m] Bad Raw PPM magic!

        That is because the output of the 'find' is the names of the files,
        not the contents of the files.

> Any recommandation ? I probably missed something with xargs but not really 
> sure how it works

        man xargs

        but you knew that already ;)

        something like

          find . -print | xargs cat | pnmtoy4m ...

        should be about right BUT that doesn't solve the problem because
        when xargs gathers up the maximum number of filenames that can go into
        a 'cat command' (xargs reads the NAMES of the files from stdin and
        contructs "cat file1.ppm file2.ppm ...") it will run the cat command.
        Perhaps with 1000 filenames (maybe more but still not all of them - if
        it could do all of them you wouldn't need xargs ;)).

        What would have been better would have been to capture the files in
        batches into subdirectories each containing a smaller number of files.
        If you had subdirectories called 1/, 2/, 3/, etc and each contained
        just 1000 files it would be a lot easier to deal with.  Something
        like this (just off the top of my head) using subshells (each with its
        own limit on the number of characters for commandlines):

          ( (cd 1;cat *.ppm); (cd 2;cat *.ppm); (cd 3;cat *.ppm) ... ) | ...

        If I'm correct then each subshell inside a ( ) pair has its own limit
        on commandline size and the result will be a stream of ppm data.

        Hopefully the above will give some ideas for experimentation (maybe
        a variation can be used to reorganize the files into subdirectories).

        Cheers,
        Steven Schultz



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to