mkvtoolnix/tests/test-256cropping_stereo_mode.rb
Moritz Bunkus 4893a23867 Refactored the handling of the different sources of cropping and stereo mode information.
Now the order is the correct order: options on the command line trump
everything else; second is the source container; third place is the
bitstream.
2009-10-25 20:51:21 +01:00

31 lines
786 B
Ruby

#!/usr/bin/ruby -w
class T_256cropping_stereo_mode < Test
def description
return "mkvmerge / Handling of cropping & stereo mode"
end
def get_info(file_name)
command = "mkvinfo --ui-language en_US \"#{file_name}\" | " +
"grep -E -i 'crop|stereo' | " +
"sed -e 's/Stereo mode: /: S/' -e 's/.*: //' -e 's/ .*//' | " +
"sort -n | " +
"tr '\n' '-' | " +
"sed -e 's/-$//'"
return `#{command}`.chomp
end
def run
result = ""
merge "--cropping 3:1,2,3,4 --stereo-mode 3:left -A data/mp4/rain_800.mp4"
[ "", "--cropping 1:5,6,7,8 --stereo-mode 1:right" ].each_with_index do |args, idx|
merge "#{tmp}#{idx}", "#{args} #{tmp}"
result += "#{idx}[" + get_info("#{tmp}#{idx}") + "]"
end
return result
end
end