vollbremsung

[github] [help-page]

Recently I found myself with a huge bunch of media files my DLNA enabled TV could not play due to not supported codecs. I had a very rudimentary bash script for bulk encoding files using HandbrakeCLI which I tended to utilise until now to solve this problem. But it was not very comfortable to use and so dumb you had to adjust it a lot depending on the file types you want to convert. Additionally it did not take all audio and subtitle tracks (the Handbrake preset only takes the first), leading to a loss of data in some cases.

So I decided to do this right once and for all and wrote a nice litte ruby script called vollbremsung (meaning full application of the brake in German), which evolved into my very first ruby gem. Therefore it is available via gem install vollbremsung

It takes target paths and probes them for suited files. If a target path is a file, it is the only match, if it is a directory all containing files with a matching file type (basically all the non MP4 multimedia types like .avi, .flv, .mov, etc.) are taken. The --recursive option will extend the search scope to probe the subfiletree as well. It furthermore analyses each file for its structure utilising ffmpegs ffprobe tool in order to extend Handbrakes default preset, processing all audio and subtitle tracks, not only the first ones.

The video streams will be converted to H.264 while audio streams will enjoy the AAC codec. Every DLNA enabled TV should be able to handle these two.

The x264-preset used is veryfast which should be a good tradeoff most of the time. If you want to change this manually, use the --x264-preset PRESET option.

The --delete and --move option allow post processing actions. delete will of course remove the source file upon successfull processing, while move will add a .old file extension for archive purposes. This is always a good option, just to be sure.

Additionally, vollbremsung can set the MP4 title tag to the filename via the --title option, in case the old file title metadata is somewhat misshampen - which I find often enough.

Per default the m4v file extension is used to indicate that the files contain video content. It turned out that some TVs can’t handle this extension and require plain mp4. The --mp4-ext option will make vollbremsung create mp4 files. You can of course rename the output files manually as well.

Finally, if you only want to know which files would match for a given target, use the --list-only option. No processing will be done, just the matches printed.