2017-08-03 19:06:55 +00:00
|
|
|
#!/usr/bin/ruby -w
|
|
|
|
|
|
|
|
# T_609propedit_video_colour_attributes
|
|
|
|
describe "mkvpropedit / video colour attributes"
|
|
|
|
|
|
|
|
def args *arrays
|
|
|
|
arrays.flatten.map.with_index { |elt, idx| "--set #{elt}=#{idx + 1}" }.join(" ")
|
|
|
|
end
|
|
|
|
|
|
|
|
test "set all attributes" do
|
2017-08-12 07:59:23 +00:00
|
|
|
merge "--no-audio data/avi/v.avi", :no_result => true
|
2017-08-03 19:06:55 +00:00
|
|
|
src = tmp
|
|
|
|
|
|
|
|
colour_attributes = [
|
2017-08-05 13:49:04 +00:00
|
|
|
"colour-matrix-coefficients",
|
2017-08-03 19:06:55 +00:00
|
|
|
"colour-bits-per-channel",
|
|
|
|
"chroma-subsample-horizontal",
|
|
|
|
"chroma-subsample-vertical",
|
|
|
|
"cb-subsample-horizontal",
|
|
|
|
"cb-subsample-vertical",
|
|
|
|
"chroma-siting-horizontal",
|
|
|
|
"chroma-siting-vertical",
|
|
|
|
"colour-range",
|
|
|
|
"colour-transfer-characteristics",
|
|
|
|
"colour-primaries",
|
|
|
|
"max-content-light",
|
|
|
|
"max-frame-light",
|
|
|
|
]
|
|
|
|
|
|
|
|
colour_mastering_meta_attributes = [
|
|
|
|
"chromaticity-coordinates-red-x",
|
|
|
|
"chromaticity-coordinates-red-y",
|
|
|
|
"chromaticity-coordinates-green-x",
|
|
|
|
"chromaticity-coordinates-green-y",
|
|
|
|
"chromaticity-coordinates-blue-x",
|
|
|
|
"chromaticity-coordinates-blue-y",
|
|
|
|
"white-coordinates-x",
|
|
|
|
"white-coordinates-y",
|
|
|
|
"max-luminance",
|
|
|
|
"min-luminance",
|
|
|
|
]
|
|
|
|
|
|
|
|
hashes = []
|
|
|
|
work = "#{src}-1"
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --set pixel-width=1024"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --set pixel-width=1024 #{args(colour_attributes)}"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --set pixel-width=1024 #{args(colour_mastering_meta_attributes)}"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --set pixel-width=1024 #{args(colour_attributes, colour_mastering_meta_attributes)}"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
|
|
|
|
hashes.join("+")
|
|
|
|
end
|
|
|
|
|
|
|
|
test "delete attributes" do
|
2017-08-12 07:59:23 +00:00
|
|
|
merge "--no-audio --max-frame-light 0:41 --min-luminance 0:42 data/avi/v.avi", :no_result => true
|
2017-08-03 19:06:55 +00:00
|
|
|
|
|
|
|
hashes = []
|
|
|
|
src = tmp
|
|
|
|
work = "#{src}-1"
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --delete language"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
# sys "mkvinfo #{work} >&2"
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --delete language --delete min-luminance"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
# sys "mkvinfo #{work} >&2"
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --delete language --delete max-frame-light"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
# sys "mkvinfo #{work} >&2"
|
|
|
|
|
2017-08-12 07:59:23 +00:00
|
|
|
cp src, work
|
2017-08-03 19:06:55 +00:00
|
|
|
propedit work, "--edit track:v1 --delete language --delete max-frame-light --delete min-luminance"
|
|
|
|
hashes << hash_file(work)
|
|
|
|
# sys "mkvinfo #{work} >&2"
|
|
|
|
|
|
|
|
hashes.join("+")
|
|
|
|
end
|