Encoding multi-jpegs with mencoder, skipping broken files

Posted on

Problem :

I’ve multiple jpegs uploaded form IP cam via FTP, I use mencoder to periodically pack them into single avi file, problem is that sometimes one or two jpegs submitted by cam are broken, and this make mencoder exit, without producing movie :/

Is there a way to force mencoder to skip broken jpeg files?

Solution :

I have the same problem – mencoder quits 25% or so along the way with the -mf:*jpg option.

I initially used IrfanView and did a 100% jpeg batch convert on a directory.

That told me there was a 0 byte file which it couldn’t load there.

Because my files are all jpg’s from a cctv they are all about the same size – 40k, so I decided all i have to do is look for any files < 38k and remove them.

DIR /OS > Files_in_Size_Order_Smallest_First.txt

Then just delete the few files which are likely corrupt being under 10k or so (found a lot of good files are smaller than 38k)

Leave a Reply

Your email address will not be published. Required fields are marked *