A while back I wrote about audio compression causing a black screen of death on my WD TV HD player with a one-line fix to the problem.
I have an improved solution. I wrote a quick BASH script that scans all the videos it finds in the Matroska (.mkv) format in the current directory as well as any subdirectories it finds, removing all compression from .mkvs it finds and saving a new mkv with “fixed” appended to the filename.
# This script will traverse all subdirectories looking for Matroska (.mkv) files
# When an .mkv file is found, it will be checked for compression
# If compression is found, create a new file without compression with "-fixed" added to name
# (e.g. badmovie.mkv -> badmovie-fixed.mkv)
# Run from the root directory that you want to begin scanning from (e.g. /home/foo/Videos or /media/USBdrive)
# 1/22/2012 v2
# better handling for files with spaces; removes all compression, not just track 1
# remove the need for a command line parameter
find -type d | while read directory
for file in *.mkv
if mkvinfo "$file" | grep ompress > /dev/null
cut_len=$(($file_len - 4))
mkvmerge -o "$fixedfile" --compression -1:none "$file"
if mkvinfo $fixedfile | grep compression > /dev/null
echo "$fixedfile still has issues"
Note, I edited this post on 1/22/12 with the current version of this script which handles filenames with spaces and removes all compression, not just the first track.