« |
Main
| »
June 05, 2009
explain is a Java system to allow you to inspect
various media files on the command line, regardless of the type of
file (to some degree. To use it you pass in media files (e.g. images,
mp3s), and it will spit out relevant information for that kind of
file. For example, for an mp3 you may want to see the artist, for an
image you may wan to see the size. If it can't determine the type of
file (by extension), it will treat it as text.
Source + Release
Here is the source to browse:
AbstractHandler.java
Explain.java
Handler.java
ImageHandler.java
MP3Handler.java
Makefile
Test.java
TextHandler.java
Util.java
Version.java
along with a tar ball and the built jar:
explain.tar.gz
explain.jar
Examples of using could be viewing the information about an image:
java -jar explain.jar testfiles/darth.jpg
Name : darth.jpg
Size : 0.17 KB
Modified : Fri Jun 05 07:44:43 EDT 2009
Width : 400
Height : 400
ColorSpaceType : YCbCr
NumChannels : 3
CompressionTypeName : JPEG
Lossless : false
NumProgressiveScans : 1
PixelAspectRatio : 1.0
ImageOrientation : normal
or an mp3:
% java -jar explain.jar testfiles/test.mp3
Name : test.mp3
Size : 1.53 MB
Modified : Fri Jun 05 07:44:44 EDT 2009
Bitrate : 247 KB/s
# channels : 2
Encoding type : MPEG Version 1 (ISO/IEC 11172-3)
Length : 494.1061 s
Sampling rate : 44100 Hz
Title : The Highest Journey
Artist : M83
Album : Digital Shades
Genre : Alternative Rock
Year : 2007
Comment : Amazon.com Song ID: 202558238
Track #1 : 10/11
or text file:
java -jar explain.jar testfiles/test.txt
Name : test.txt
Size : 55 bytes
Modified : Fri Jun 05 09:50:55 EDT 2009
# lines : 6
# words : 8
If you include no files, you get something like this
java -jar explain.jar
I support the following formats:
- [png, jpg, gif, bmp, tiff]: Images files
- [mp3]: MP3 audio files
Everything else is handled as text
Posted by jeff at June 5, 2009 12:01 PM