Giter Club home page Giter Club logo

jpegfinder's Introduction

Jpegfinder

What?

Jpegfinder is a tiny tool for scraping through files (or block devices) and finding and extracting anything which looks a bit like a JPEG image.

Why?

I have a Hubsan H107D drone, which records video onto an SD card; but it's buggy and the resulting AVI MJPEG files are hopelessly corrupt. Jpegfinder will extract any (surviving) frames of video from the files, and then I can turn them into playable videos.

It's also useful for extracting interesting looking jpegs from any binary file. I suppose technically it's a forensics tool.

How?

Compile the tool (by running make). Invoke with:

$ jpegfinder -f broken.avi -j outputdir -w 720 -h 240

Command line flags are:

  • -f filename.avi: specifies the input file.

  • -j outputdir: specifies the directory output files go.

  • -w width -h height: if set to anything other than 0, then only jpegs of this size will be output. This is useful for reducing false positives when you know the size of the images you're looking for (like I do for my videos). (If not set, jpegfinder will emit everything, including garbage.)

  • -o offset: start looking at this offset. Useful for resuming a scan (because scans are slow).

Output files are named by the hex offset into the source file. This is so each file has a stable name, allowing runs to be repeated or resumed and you get the same names each time.

You can create a non-corrupt MJPEG video containing the output frames using ffmpeg, like this:

$ ffmpeg -f image2 -pattern_type glob -framerate 60 -i 'jpegs/*.jpg' -vcodec copy output.mkv

Note that if jpegfinder found any false positives, you'll get corrupt frames. But any competent video editor should find and ignore them. At least the file will be loadable (unlike the source).

Who?

jpegfinder was written entirely by me, David Given. Feel free to send me email at [email protected]. You may also like to visit my website; there may or may not be something interesting there.

License?

jpefinder is open source software available under the 2-clause BSD license. Simplified summary: do what you like with it, just don't claim you wrote it.

jpegfinder's People

Contributors

davidgiven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

4dvn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.