diff options
Diffstat (limited to 'src/lib/hints.cc')
| -rw-r--r-- | src/lib/hints.cc | 67 |
1 files changed, 46 insertions, 21 deletions
diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 9eebe4030..4a13f77a0 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -35,14 +35,14 @@ #include "player.h" #include "ratio.h" #include "text_content.h" +#include "variant.h" #include "video_content.h" #include "writer.h" #include <dcp/cpl.h> #include <dcp/filesystem.h> #include <dcp/raw_convert.h> #include <dcp/reel.h> -#include <dcp/reel_closed_caption_asset.h> -#include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_text_asset.h> #include <boost/algorithm/string.hpp> #include <iostream> @@ -75,7 +75,7 @@ using namespace boost::placeholders; Hints::Hints (weak_ptr<const Film> weak_film) : WeakConstFilm (weak_film) - , _writer (new Writer(weak_film, weak_ptr<Job>(), true)) + , _writer(new Writer(weak_film, weak_ptr<Job>(), film()->dir("hints") / dcpomatic::get_process_id(), true)) , _analyser (film(), film()->playlist(), true, [](float) {}) , _stop (false) { @@ -106,7 +106,13 @@ void Hints::check_few_audio_channels () { if (film()->audio_channels() < 6) { - hint (_("Your DCP has fewer than 6 audio channels. This may cause problems on some projectors. You may want to set the DCP to have 6 channels. It does not matter if your content has fewer channels, as DCP-o-matic will fill the extras with silence.")); + hint( + variant::insert_dcpomatic( + _("Your DCP has fewer than 6 audio channels. This may cause problems on some projectors. " + "You may want to set the DCP to have 6 channels. It does not matter if your content has " + "fewer channels, as %1 will fill the extras with silence.") + ) + ); } } @@ -116,7 +122,12 @@ Hints::check_upmixers () { auto ap = film()->audio_processor(); if (ap && (ap->id() == "stereo-5.1-upmix-a" || ap->id() == "stereo-5.1-upmix-b")) { - hint (_("You are using DCP-o-matic's stereo-to-5.1 upmixer. This is experimental and may result in poor-quality audio. If you continue, you should listen to the resulting DCP in a cinema to make sure that it sounds good.")); + hint(variant::insert_dcpomatic( + _("You are using %1's stereo-to-5.1 upmixer. This is experimental and " + "may result in poor-quality audio. If you continue, you should listen to the " + "resulting DCP in a cinema to make sure that it sounds good.") + ) + ); } } @@ -153,17 +164,17 @@ void Hints::check_unusual_container () { auto const film_container = film()->container()->id(); - if (film_container != "185" && film_container != "239") { + if (film()->video_encoding() != VideoEncoding::MPEG2 && film_container != "185" && film_container != "239") { hint (_("Your DCP uses an unusual container ratio. This may cause problems on some projectors. If possible, use Flat or Scope for the DCP container ratio.")); } } void -Hints::check_high_j2k_bandwidth () +Hints::check_high_video_bit_rate() { - if (film()->j2k_bandwidth() >= 245000000) { - hint (_("A few projectors have problems playing back very high bit-rate DCPs. It is a good idea to drop the JPEG2000 bandwidth down to about 200Mbit/s; this is unlikely to have any visible effect on the image.")); + if (film()->video_encoding() == VideoEncoding::JPEG2000 && film()->video_bit_rate(VideoEncoding::JPEG2000) >= 245000000) { + hint (_("A few projectors have problems playing back very high bit-rate DCPs. It is a good idea to drop the video bit rate down to about 200Mbit/s; this is unlikely to have any visible effect on the image.")); } } @@ -251,6 +262,15 @@ Hints::check_interop () void +Hints::check_video_encoding() +{ + if (film()->video_encoding() == VideoEncoding::MPEG2) { + hint(_("The vast majority of cinemas in Europe, Australasia and North America expect DCPs encoded with JPEG2000 rather than MPEG2. Make sure that your cinema really wants an old-style MPEG2 DCP.")); + } +} + + +void Hints::check_big_font_files () { bool big_font_files = false; @@ -350,7 +370,7 @@ Hints::check_loudness () static bool -subtitle_mxf_too_big (shared_ptr<dcp::SubtitleAsset> asset) +subtitle_mxf_too_big(shared_ptr<dcp::TextAsset> asset) { return asset && asset->file() && dcp::filesystem::file_size(*asset->file()) >= (MAX_TEXT_MXF_SIZE - SIZE_SLACK); } @@ -450,12 +470,13 @@ try check_certificates (); check_interop (); + check_video_encoding(); check_big_font_files (); check_few_audio_channels (); check_upmixers (); check_incorrect_container (); check_unusual_container (); - check_high_j2k_bandwidth (); + check_high_video_bit_rate(); check_frame_rate (); check_4k_3d (); check_speed_up (); @@ -482,7 +503,7 @@ try auto dcp_dir = film->dir("hints") / dcpomatic::get_process_id(); dcp::filesystem::remove_all(dcp_dir); - _writer->finish (film->dir("hints") / dcpomatic::get_process_id()); + _writer->finish(); dcp::DCP dcp (dcp_dir); dcp.read (); @@ -717,16 +738,20 @@ Hints::check_certificates () switch (*bad) { case Config::BAD_SIGNER_UTF8_STRINGS: - hint(_("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error " - "which will prevent DCPs from being validated correctly on some systems. It is advisable to " - "re-create the signing certificate chain by clicking the \"Re-make certificates and key...\" " - "button in the Keys page of Preferences.")); + hint(variant::insert_dcpomatic( + _("The certificate chain that %1 uses for signing DCPs and KDMs contains a small error " + "which will prevent DCPs from being validated correctly on some systems. It is advisable to " + "re-create the signing certificate chain by clicking the \"Re-make certificates and key...\" " + "button in the Keys page of Preferences.") + )); break; case Config::BAD_SIGNER_VALIDITY_TOO_LONG: - hint(_("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs has a validity period " - "that is too long. This will cause problems playing back DCPs on some systems. " - "It is advisable to re-create the signing certificate chain by clicking the " - "\"Re-make certificates and key...\" button in the Keys page of Preferences.")); + hint(variant::insert_dcpomatic( + _("The certificate chain that %1 uses for signing DCPs and KDMs has a validity period " + "that is too long. This will cause problems playing back DCPs on some systems. " + "It is advisable to re-create the signing certificate chain by clicking the " + "\"Re-make certificates and key...\" button in the Keys page of Preferences.") + )); break; default: /* Some bad situations can't happen here as DCP-o-matic would have refused to start until they are fixed */ @@ -739,7 +764,7 @@ void Hints::check_8_or_16_audio_channels() { auto const channels = film()->audio_channels(); - if (channels != 8 && channels != 16) { + if (film()->video_encoding() != VideoEncoding::MPEG2 && channels != 8 && channels != 16) { hint(String::compose(_("Your DCP has %1 audio channels, rather than 8 or 16. This may cause some distributors to raise QC errors when they check your DCP. To avoid this, set the DCP audio channels to 8 or 16."), channels)); } } |
