# e.g. --run_tests=foo
set -e
-PRIVATE_GIT="b6277c54428e0abe2003c27868fe8f02119ef869"
+PRIVATE_GIT="59b62615a48a1f3a70e9c028b92dfba75c1719ba"
if [ "$1" == "--check" ]; then
shift 1
if [ -f /src/backports/dcp_inspect ]; then
export DCPOMATIC_DCP_INSPECT=/src/backports/dcp_inspect
fi
+ set +e
+ python3 -m clairmeta.cli --help > /dev/null 2>&1
+ if [ "$?" == "0" ]; then
+ export DCPOMATIC_CLAIRMETA=1
+ fi
+ set -e
fi
if [ "$(uname)" == "Darwin" ]; then
vf->set_reel_type(ReelType::BY_VIDEO_CONTENT);
ov_dcp->set_reference_video(true);
ov_dcp->set_reference_audio(true);
+ subtitles[0]->text[0]->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(
vf,
dcp::VerificationNote::Code::INVALID_CLOSED_CAPTION_LINE_LENGTH,
dcp::VerificationNote::Code::MISSING_CPL_METADATA,
dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
- }
+ },
+ true,
+ /* Clairmeta gives an error about having duplicate ClosedCaption entries,
+ * which seems wrong.
+ */
+ false
);
dcp::DCP check (film->dir(film->dcp_name()));
-Subproject commit 314e09cbac2e023a7acb61e1b32db76fe6dd775e
+Subproject commit a81d5737e54105f95d3d0cbf602dd355b8814244
film->set_interop (true);
auto content = make_shared<DCPSubtitleContent>("test/data/dcp_sub3.xml");
film->examine_and_add_content (content);
+ content->only_text()->set_language(dcp::LanguageTag("de"));
BOOST_REQUIRE (!wait_for_jobs ());
make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
content->only_text()->add_font(make_shared<Font>("font1"));
content2->only_text()->add_font(make_shared<Font>("font2"));
+ content->only_text()->set_language(dcp::LanguageTag("de"));
+ content2->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
auto content = make_shared<DCPSubtitleContent>("test/data/dcp_sub6.xml");
auto film = new_test_film2 ("dcp_subtitle_test5", {content});
film->set_interop (true);
+ content->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
auto content = make_shared<DCPSubtitleContent>("test/data/dcp_sub4.xml");
auto film = new_test_film2("test_font_override", {content});
film->set_interop(true);
+ content->only_text()->set_language(dcp::LanguageTag("de"));
BOOST_REQUIRE_EQUAL(content->text.size(), 1U);
auto font = content->text.front()->get_font("0_theFontId");
auto film = new_test_film2("check_for_no_empty_text_nodes_in_failure_case", content, &cl);
auto text = content[0]->text.front();
text->set_type (TextType::CLOSED_CAPTION);
- text->set_dcp_track({"English", dcp::LanguageTag("en-GB")});
+ text->set_dcp_track({"English", dcp::LanguageTag("en")});
make_and_verify_dcp (film, {
dcp::VerificationNote::Code::MISSING_CPL_METADATA
*/
+#include "lib/content.h"
#include "lib/content_factory.h"
#include "lib/film.h"
+#include "lib/text_content.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
auto sub = content_factory("test/data/15s.srt")[0];
auto film = new_test_film2("interop_file_extension_test", { video, audio, sub });
film->set_interop(true);
+ sub->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(
film, {
dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES,
dcp::VerificationNote::Code::INVALID_JPEG2000_TILE_PART_SIZE,
},
+ target_bits_per_second <= 250000000,
target_bits_per_second <= 250000000
);
auto subs = content_factory("test/data/15s.srt").front();
auto film = new_test_film2(name + "_in", { picture, subs });
film->set_interop(true);
+ subs->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(film, {dcp::VerificationNote::Code::INVALID_STANDARD});
vector<string> const args = {
auto subs = content_factory("test/data/15s.srt").front();
films[i] = new_test_film2(String::compose("%1_%2_in", name, i), { picture, subs });
films[i]->set_interop(interop);
+ subs->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(films[i], acceptable_errors);
}
film->set_interop(true);
arrietty->set_trim_end(dcpomatic::ContentTime::from_seconds(110));
arrietty->text[0]->set_use(true);
+ arrietty->text[0]->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(
film,
{
boost::filesystem::resize_file (video, 2 * 1024 * 1024);
- make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE, dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE });
+ make_and_verify_dcp(
+ film,
+ {
+ dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE,
+ dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE
+ },
+ true,
+ /* We end up with two CPLs in this directory, which Clairmeta gives an error for */
+ false
+ );
auto A = make_shared<dcp::MonoPictureAsset>("build/test/recover_test_2d/original.mxf");
auto B = make_shared<dcp::MonoPictureAsset>(video);
boost::filesystem::resize_file (video, 2 * 1024 * 1024);
- make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE, dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE });
+ make_and_verify_dcp(
+ film,
+ {
+ dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE, dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE
+ },
+ true,
+ /* We end up with two CPLs in this directory, which Clairmeta gives an error for */
+ false
+ );
auto A = make_shared<dcp::StereoPictureAsset>("build/test/recover_test_3d/original.mxf");
auto B = make_shared<dcp::StereoPictureAsset>(video);
boost::filesystem::resize_file (video, 2 * 1024 * 1024);
- make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE, dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE });
+ make_and_verify_dcp(
+ film,
+ {
+ dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE, dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE
+ },
+ true,
+ /* We end up with two CPLs in this directory, which Clairmeta gives an error for */
+ false
+ );
auto A = make_shared<dcp::MonoPictureAsset>("build/test/recover_test_2d_encrypted/original.mxf");
A->set_key (film->key ());
/* Change the audio and re-make */
audio->audio->set_gain (-3);
- make_and_verify_dcp (film);
+ /* >1 CPLs in the DCP raises an error in ClairMeta */
+ make_and_verify_dcp(film, {}, true, false);
/* Video ID should be the same, sound different */
dcp::DCP dcp2 (film->dir(film->dcp_name()));
/* Crop video and re-make */
video->video->set_left_crop (5);
- make_and_verify_dcp (film);
+ /* >1 CPLs in the DCP raises an error in ClairMeta */
+ make_and_verify_dcp(film, {}, true, false);
/* Video and sound IDs should be different */
dcp::DCP dcp3 (film->dir(film->dcp_name()));
film->set_reel_type (ReelType::BY_LENGTH);
/* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
film->set_reel_length (31253154);
- /* dcp_inspect gives error about reel <1s in length */
+ /* dcp_inspect and clairmeta both give errors about reel <1s in length */
make_and_verify_dcp (
film,
{
dcp::VerificationNote::Code::INVALID_INTRINSIC_DURATION,
dcp::VerificationNote::Code::INVALID_DURATION,
},
- false);
+ false,
+ false
+ );
}
content->video->set_colour_conversion(*conversion);
auto calculate_picture_hashes = [](shared_ptr<Film> film) {
- make_and_verify_dcp(film);
+ /* >1 CPLs in the DCP raises an error in ClairMeta */
+ make_and_verify_dcp(film, {}, true, false);
dcp::DCP dcp(film->dir(film->dcp_name()));
dcp.read();
BOOST_REQUIRE(!dcp.cpls().empty());
if (standard == dcp::Standard::INTEROP) {
codes.push_back(dcp::VerificationNote::Code::INVALID_STANDARD);
}
- make_and_verify_dcp(film, codes, channels == 2 || channels == 6 || channels >= 8);
+ auto const dcp_inspect = channels == 2 || channels == 6 || channels >= 8;
+ auto const clairmeta = (channels % 2) == 0;
+ make_and_verify_dcp(film, codes, dcp_inspect, clairmeta);
boost::filesystem::path path = "build/test";
path /= film_name;
dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
dcp::VerificationNote::Code::MISSING_CPL_METADATA
- });
+ },
+ true,
+ /* ClairMeta tries to inspect the font file and fails because it isn't one */
+ false
+ );
/* Should be blank video with a subtitle MXF; sound is irrelevant */
check_dcp("test/data/srt_subtitle_test2", film->dir(film->dcp_name()), true);
content->only_text()->set_use (true);
content->only_text()->set_burn (false);
+ content->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp (film, {dcp::VerificationNote::Code::INVALID_STANDARD});
auto content = make_shared<StringTextFileContent>("test/data/subrip2.srt");
content->only_text()->set_use (true);
content->only_text()->set_burn (false);
+ content->only_text()->set_language(dcp::LanguageTag("de"));
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
content->set_position (film, DCPTime());
content->only_text()->set_use (true);
content->only_text()->set_burn (false);
+ content->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
BOOST_REQUIRE_EQUAL(content[0]->text.size(), 1U);
content[0]->set_paths({"test/data/short.srt"});
+ content[0]->only_text()->set_language(dcp::LanguageTag("de"));
CheckContentJob check(film);
check.run();
BOOST_REQUIRE_EQUAL(content[0]->text.size(), 1U);
content[0]->set_paths({"test/data/fonts.ass"});
+ content[0]->only_text()->set_language(dcp::LanguageTag("de"));
CheckContentJob check(film);
check.run();
auto subs = content_factory(TestPaths::private_data() / "clapperboard_with_subs.mkv");
auto film = new_test_film2("make_dcp_with_subs_from_mkv", subs);
subs[0]->text.front()->set_use(true);
- subs[0]->text.front()->set_language(dcp::LanguageTag("en-US"));
+ subs[0]->text.front()->set_language(dcp::LanguageTag("en"));
make_and_verify_dcp(film, { dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K });
}
auto subs = content_factory("test/data/no_font.xml");
auto film = new_test_film2("make_dcp_with_subs_without_font_tag", { subs });
subs[0]->text.front()->set_use(true);
+ subs[0]->text.front()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(
film,
{
auto source_subs = content_factory("test/data/short.srt");
auto source = new_test_film2("make_dcp_with_subs_in_dcp_without_font_tag_source", { source_subs });
source->set_interop(true);
+ source_subs[0]->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp(
source,
{
auto fr = content_factory("test/data/frames.srt");
auto film = new_test_film2 (name, fr);
- fr[0]->only_text()->set_language (dcp::LanguageTag("fr-FR"));
+ fr[0]->only_text()->set_language(dcp::LanguageTag("fr"));
film->set_interop (true);
film->set_audio_channels(6);
dcp::VerificationNote::Code::INVALID_STANDARD,
dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING,
dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION
- });
+ },
+ false,
+ /* clairmeta raises errors about subtitle spacing/duration */
+ false
+ );
- check_dcp (String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
+ check_dcp(String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
}
auto fr = content_factory("test/data/frames.srt");
auto film = new_test_film2 (name, fr);
- fr[0]->only_text()->set_language (dcp::LanguageTag("fr-FR"));
+ fr[0]->only_text()->set_language(dcp::LanguageTag("fr"));
film->set_interop (false);
make_and_verify_dcp (
auto film = new_test_film2(boost::unit_test::framework::current_test_unit().full_name(), { subs, video1, video2 });
video2->set_position(film, dcpomatic::DCPTime::from_seconds(5));
film->set_reel_type(ReelType::BY_VIDEO_CONTENT);
- subs->only_text()->set_language(dcp::LanguageTag("fr-FR"));
+ subs->only_text()->set_language(dcp::LanguageTag("fr"));
make_and_verify_dcp(
film,
string const name = "srt_in_interop_position_test";
auto fr = content_factory("test/data/short.srt");
auto film = new_test_film2(name, fr);
+ fr[0]->only_text()->set_language(dcp::LanguageTag("de"));
film->set_interop(true);
auto fr = content_factory("test/data/short.srt");
auto film = new_test_film2(name, fr);
- fr[0]->text[0]->set_language(dcp::LanguageTag("en-GB"));
+ fr[0]->text[0]->set_language(dcp::LanguageTag("en"));
film->set_interop(false);
make_and_verify_dcp (
BOOST_REQUIRE (!wait_for_jobs ());
content->only_text()->set_use (true);
content->only_text()->set_burn (false);
+ content->only_text()->set_language(dcp::LanguageTag("de"));
film->set_reel_type (ReelType::BY_LENGTH);
film->set_interop (true);
film->set_reel_length (1024 * 1024 * 512);
red_a->set_position (film, dcpomatic::DCPTime());
red_a->video->set_length (240);
sub_a->set_position (film, dcpomatic::DCPTime());
+ sub_a->only_text()->set_language(dcp::LanguageTag("de"));
red_b->set_position (film, dcpomatic::DCPTime::from_seconds(10));
red_b->video->set_length (240);
sub_b->set_position (film, dcpomatic::DCPTime::from_seconds(10));
+ sub_b->only_text()->set_language(dcp::LanguageTag("de"));
film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
{
dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING
- });
+ },
+ true,
+ /* ClairMeta gives an error with multiple ClosedCaption assets */
+ false
+ );
dcp::DCP dcp ("build/test/closed_captions_in_all_reels_test/" + film->dcp_name());
dcp.read ();
auto subtitle = content_factory("test/data/45s.srt")[0];
film->examine_and_add_content (subtitle);
BOOST_REQUIRE (!wait_for_jobs());
+ subtitle->only_text()->set_language(dcp::LanguageTag("de"));
make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
auto picture = content_factory("test/data/flat_red.png")[0];
auto sub = content_factory("test/data/hour.srt")[0];
- sub->text.front()->set_language(dcp::LanguageTag("en-GB"));
+ sub->text.front()->set_language(dcp::LanguageTag("en"));
auto film = new_test_film2(name, { picture, sub }, &cl);
picture->set_video_frame_rate(film, content_frame_rate);
void
#ifdef DCPOMATIC_LINUX
-make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool dcp_inspect)
+make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool dcp_inspect, bool clairmeta)
#else
-make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool)
+make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool, bool)
#endif
{
film->write_metadata ();
auto result = system(cmd.c_str());
BOOST_CHECK_EQUAL(WEXITSTATUS(result), 0);
}
+
+ if (clairmeta && getenv("DCPOMATIC_CLAIRMETA")) {
+ auto cmd = String::compose("python3 -m clairmeta.cli check -type dcp %1 > %2 2>&1", film->dir(film->dcp_name()), film->file("clairmeta.log"));
+ auto result = system(cmd.c_str());
+ BOOST_CHECK_EQUAL(WEXITSTATUS(result), 0);
+ }
#endif
}
extern boost::filesystem::path subtitle_file (std::shared_ptr<Film> film);
extern void make_random_file (boost::filesystem::path path, size_t size);
extern void verify_dcp(boost::filesystem::path dir, std::vector<dcp::VerificationNote::Code> ignore);
-extern void make_and_verify_dcp(std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {}, bool dcp_inspect = true);
+extern void make_and_verify_dcp(std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {}, bool dcp_inspect = true, bool clairmeta = true);
extern void check_int_close (int a, int b, int d);
extern void check_int_close (std::pair<int, int>, std::pair<int, int>, int d);
extern boost::filesystem::path find_file (boost::filesystem::path dir, std::string filename_part);
R->set_trim_end (dcpomatic::ContentTime::from_seconds(22));
film->set_three_d (true);
- make_and_verify_dcp (film, {dcp::VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D});
+ make_and_verify_dcp(
+ film,
+ {dcp::VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D},
+ true,
+ /* XXX: Clairmeta error about invalid edit rate 24 for 4K 3D */
+ false
+ );
}