The Living Thing / Notebooks :

Media metadata management, transcoding and editing

OK, I make music and DJ, and I would like to bulk edit and search my media using my own criteria, especially when it comes to dealing with the crappy media metadata that other artists give me with their tracks.

See also machine listening, playing music.


Rip VCDs because copying the files doesn’t work. Two choices. Firstly, using Mencoder which is ubiquitous but ugly. (2 here is the track number; you might have more tracks.)

$ mplayer vcd://  # tells you how many tracks. Now choose track 2 to rip
$ mencoder vcd://$i -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:v4mv:autoaspect -vf harddup -o ciptagelar_$i.avi;

Depending on where you want to play it, the following non-re-encoding step might be more hifi:

$ mplayer vcd://2 -dumpstream -dumpfile filename.mpg  # No re-encoding

Alternatively, use a specialist vcd ripper - vcdimager or vxdxrip.

General tweaking

Reduce size of bloated PDF:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook \
  -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

or, wrapped up into a nice little script, ShrinkPDF (infile, outfile, dpi):

./ in.pdf out.pdf 90

This works to concatenate PDFs:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite \
  -dPDFSETTINGS=/prepress -sOutputFile=output.pdf input*.pdf

Speaking of concatenation, here’s how to concatenate photos into low-framerate movie from IMG_5815 and subsequent sequential shots:

ffmpeg -framerate 3 -start_number 5815 -i IMG_%04d.jpg -c:v libx264 \
  -pix_fmt yuv420p -c:a copy ../outfile.m4v

editing/annotating metadata



Erase all (or most) of the explicit metadata from an image:

exiftool -all= filename.jpg


ExifTool is not guaranteed to remove metadata completely from a file when attempting to delete all metadata. For JPEG images, all APP segments (except Adobe APP14, which is not removed by default) and trailers are removed which effectively removes all metadata, but for other formats the results are less complete:

  • JPEG - APP segments (except Adobe APP14) and trailers are removed.
  • TIFF - XMP, IPTC and the ExifIFD are removed, but some EXIF may remain in IFD0.
  • PNG - Only iTXt, tEXt and zTXt chunks (including XMP) are removed.
  • PDF - The original metadata is never actually removed.
  • PS - Only some PostScript and XMP may be deleted.
  • MOV/MP4 - Only XMP is deleted.
  • RAW formats - It is not recommended to remove all metadata from RAW images because this will likely remove some proprietary information that is necessary for proper rendering of the image.