2009-10-25 15:54:28 +00:00
|
|
|
#!/usr/bin/ruby -w
|
|
|
|
|
|
|
|
class T_255aspect_ratio_display_dimensions < Test
|
|
|
|
def description
|
2011-12-11 12:58:41 +00:00
|
|
|
"mkvmerge / Handling of aspect ratio & display dimensions"
|
2009-10-25 15:54:28 +00:00
|
|
|
end
|
|
|
|
|
2011-12-11 12:58:41 +00:00
|
|
|
def get_display_dimensions file_name
|
2015-08-15 16:27:44 +00:00
|
|
|
`mkvmerge --identify-for-gui "#{file_name}" | grep 'display_dimensions:' | sed -e 's/.*display_dimensions://' -e 's/ .*//'`.chomp
|
2009-10-25 15:54:28 +00:00
|
|
|
end
|
|
|
|
|
2011-12-11 12:58:41 +00:00
|
|
|
def run_test_with_args initial_args
|
2009-10-25 15:54:28 +00:00
|
|
|
merge "#{initial_args} -A data/mp4/rain_800.mp4"
|
|
|
|
result = get_display_dimensions tmp
|
2011-12-11 12:58:41 +00:00
|
|
|
[ "", "--display-dimensions 0:1212x2424", "--aspect-ratio 0:5", "--aspect-ratio-factor 0:5" ].each_with_index do |args, idx|
|
2009-10-25 15:54:28 +00:00
|
|
|
merge "#{tmp}#{idx}", "#{args} #{tmp}"
|
|
|
|
result += "-" + get_display_dimensions("#{tmp}#{idx}")
|
|
|
|
end
|
|
|
|
|
2011-12-11 12:58:41 +00:00
|
|
|
result
|
2009-10-25 15:54:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
result = ""
|
|
|
|
|
2011-12-11 16:21:44 +00:00
|
|
|
[ "--display-dimensions 0:4254x815", "--aspect-ratio 0:10", "--aspect-ratio-factor 0:10" ].each_with_index do |args, idx|
|
2009-10-25 15:54:28 +00:00
|
|
|
result += "#{idx}[" + run_test_with_args(args) + "]"
|
|
|
|
end
|
|
|
|
|
2011-12-11 12:58:41 +00:00
|
|
|
result
|
2009-10-25 15:54:28 +00:00
|
|
|
end
|
|
|
|
end
|