<listitem><code>-f</code>, <code>--dcp-frame-rate <rate></code> — set DCP video frame rate (otherwise guessed from content)</listitem>
<listitem><code>--container-ratio <ratio></code> — 119, 133, 137, 138, 166, 178, 185 or 239</listitem>
<listitem><code>-s</code>, <code>--still-length <n></code> — number of seconds that still content should last</listitem>
+<listitem><code>--auto-crop-threshold <n></code> — threshold to use for 'black' when auto-cropping</listitem>
<listitem><code>--standard <standard></code> — SMPTE or interop (default SMPTE)</listitem>
<listitem><code>--no-use-isdcf-name</code> — do not use an ISDCF name; use the specified name unmodified</listitem>
<listitem><code>--config <dir></code> — directory containing config.xml and cinemas.sqlite3</listitem>
" -f, --dcp-frame-rate <rate> set DCP video frame rate (otherwise guessed from content)\n"
" --container-ratio <ratio> 119, 133, 137, 138, 166, 178, 185 or 239\n"
" -s, --still-length <n> number of seconds that still content should last\n"
+ " --auto-crop-threshold <n> threshold to use for 'black' when auto-cropping\n"
" --standard <standard> SMPTE or interop (default SMPTE)\n"
" --no-use-isdcf-name do not use an ISDCF name; use the specified name unmodified\n"
" --config <dir> directory containing config.xml and cinemas.sqlite3\n"
argument_option(i, argc, argv, "-f", "--dcp-frame-rate", &claimed, &error, &dcp_frame_rate_int);
argument_option(i, argc, argv, "", "--container-ratio", &claimed, &error, &container_ratio_string);
argument_option(i, argc, argv, "-s", "--still-length", &claimed, &error, &still_length, string_to_nonzero_int);
+ argument_option(i, argc, argv, "", "--auto-crop-threshold", &claimed, &error, &auto_crop_threshold, string_to_int);
/* See comment below about --cpl */
argument_option(i, argc, argv, "", "--standard", &claimed, &error, &standard_string, string_to_string);
argument_option(i, argc, argv, "", "--config", &claimed, &error, &config_dir, string_to_path);
auto crop = guess_crop_by_brightness(
film,
film_content,
- Config::instance()->auto_crop_threshold(),
+ auto_crop_threshold.get_value_or(Config::instance()->auto_crop_threshold()),
std::min(
dcpomatic::ContentTime::from_seconds(1),
dcpomatic::ContentTime::from_frames(
BOOST_CHECK(!cc.content[1].auto_crop);
BOOST_CHECK(cc.content[2].auto_crop);
+ cc = run("dcpomatic2_create --auto-crop-threshold 42 --auto-crop foo.mp4 bar.mp4 --auto-crop baz.mp4");
+ BOOST_REQUIRE_EQUAL(cc.content.size(), 3U);
+ BOOST_CHECK(cc.content[0].auto_crop);
+ BOOST_CHECK(!cc.content[1].auto_crop);
+ BOOST_CHECK(cc.content[2].auto_crop);
+ BOOST_CHECK_EQUAL(cc.auto_crop_threshold.get_value_or(0), 42);
+
auto pillarbox = TestPaths::private_data() / "pillarbox.png";
cc = run("dcpomatic2_create --auto-crop " + pillarbox.string());
auto film = cc.make_film(error);