summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-05-12 20:34:42 +0200
committerCarl Hetherington <cth@carlh.net>2020-05-12 20:34:42 +0200
commit4edc14c8b1410e24f68b510cc14409b96c0338a3 (patch)
tree20669816386ba0cd28d1cef2c4c7836cb47098f5 /src/tools
parent3e96f929fdf740f414b114c5d9765e22fcc46de6 (diff)
parentc6475f24a7b21fe2291ebc809431ecc2654d3355 (diff)
Re-work scaling following excellent insights by Carsten Kurz, described
on #1669. Now the scaling of video content is guessed based on its aspect ratio (taking into account pixel aspect ratio) and there is a "custom" option for overriding incorrectly-marked-up content or content which actually needs its shape to be changed. Essentially we are defaulting to what used to be called "no stretch". This commit also adds buttons to change left/right and top/bottom crop together, and auto-guessing of DCP container size when any change results in there being just one piece of video content in a project. These changes include breaking changes to metadata.xml; old projects should load (with new settings that preserve the project's apperance) but once saved they will not load into 2.14.x. DCP-o-matic saves a backup file (metadata.37.xml) when 2.15.x loads an old project.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc25
-rw-r--r--src/tools/dcpomatic_cli.cc6
-rw-r--r--src/tools/dcpomatic_create.cc9
3 files changed, 10 insertions, 30 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index f69ab5a6a..13569d11d 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -222,8 +222,6 @@ enum {
ID_file_close = 100,
ID_edit_copy,
ID_edit_paste,
- ID_content_scale_to_fit_width,
- ID_content_scale_to_fit_height,
ID_jobs_make_dcp,
ID_jobs_make_dcp_batch,
ID_jobs_make_kdms,
@@ -316,8 +314,6 @@ public:
Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_copy, this), ID_edit_copy);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_paste, this), ID_edit_paste);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES);
- Bind (wxEVT_MENU, boost::bind (&DOMFrame::content_scale_to_fit_width, this), ID_content_scale_to_fit_width);
- Bind (wxEVT_MENU, boost::bind (&DOMFrame::content_scale_to_fit_height, this), ID_content_scale_to_fit_height);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_dcp, this), ID_jobs_make_dcp);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_kdms, this), ID_jobs_make_kdms);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_dkdms, this), ID_jobs_make_dkdms);
@@ -983,22 +979,6 @@ private:
d->Destroy ();
}
- void content_scale_to_fit_width ()
- {
- ContentList vc = _film_editor->content_panel()->selected_video ();
- for (ContentList::iterator i = vc.begin(); i != vc.end(); ++i) {
- (*i)->video->scale_and_crop_to_fit_width (_film);
- }
- }
-
- void content_scale_to_fit_height ()
- {
- ContentList vc = _film_editor->content_panel()->selected_video ();
- for (ContentList::iterator i = vc.begin(); i != vc.end(); ++i) {
- (*i)->video->scale_and_crop_to_fit_height (_film);
- }
- }
-
void jobs_send_dcp_to_tms ()
{
_film->send_dcp_to_tms ();
@@ -1323,10 +1303,6 @@ private:
add_item (edit, _("&Preferences...\tCtrl-P"), wxID_PREFERENCES, ALWAYS);
#endif
- wxMenu* content = new wxMenu;
- add_item (content, _("Scale to fit &width"), ID_content_scale_to_fit_width, NEEDS_FILM | NEEDS_SELECTED_VIDEO_CONTENT);
- add_item (content, _("Scale to fit &height"), ID_content_scale_to_fit_height, NEEDS_FILM | NEEDS_SELECTED_VIDEO_CONTENT);
-
wxMenu* jobs_menu = new wxMenu;
add_item (jobs_menu, _("&Make DCP\tCtrl-M"), ID_jobs_make_dcp, NEEDS_FILM | NOT_DURING_DCP_CREATION);
add_item (jobs_menu, _("Make DCP in &batch converter\tCtrl-B"), ID_jobs_make_dcp_batch, NEEDS_FILM | NOT_DURING_DCP_CREATION);
@@ -1365,7 +1341,6 @@ private:
m->Append (_file_menu, _("&File"));
m->Append (edit, _("&Edit"));
- m->Append (content, _("&Content"));
m->Append (jobs_menu, _("&Jobs"));
m->Append (view, _("&View"));
m->Append (tools, _("&Tools"));
diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc
index 6a243e126..edf4808a0 100644
--- a/src/tools/dcpomatic_cli.cc
+++ b/src/tools/dcpomatic_cli.cc
@@ -96,8 +96,10 @@ print_dump (shared_ptr<Film> film)
<< "\tcrop left " << c->video->left_crop()
<< " right " << c->video->right_crop()
<< " top " << c->video->top_crop()
- << " bottom " << c->video->bottom_crop() << "\n"
- << "\tscale " << c->video->scale().name() << "\n";
+ << " bottom " << c->video->bottom_crop() << "\n";
+ if (c->video->custom_ratio()) {
+ cout << "\tscale to custom ratio " << *c->video->custom_ratio() << ":1\n";
+ }
if (c->video->colour_conversion()) {
if (c->video->colour_conversion().get().preset()) {
cout << "\tcolour conversion "
diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc
index 68ae09c31..857359117 100644
--- a/src/tools/dcpomatic_create.cc
+++ b/src/tools/dcpomatic_create.cc
@@ -96,14 +96,18 @@ main (int argc, char* argv[])
}
film->set_name (cc.name);
- film->set_container (cc.container_ratio);
+ if (cc.container_ratio) {
+ film->set_container (cc.container_ratio);
+ }
film->set_dcp_content_type (cc.dcp_content_type);
film->set_interop (cc.standard == dcp::INTEROP);
film->set_use_isdcf_name (!cc.no_use_isdcf_name);
film->set_signed (!cc.no_sign);
film->set_encrypted (cc.encrypt);
film->set_three_d (cc.threed);
- film->set_resolution (cc.fourk ? RESOLUTION_4K : RESOLUTION_2K);
+ if (cc.fourk) {
+ film->set_resolution (RESOLUTION_4K);
+ }
if (cc.j2k_bandwidth) {
film->set_j2k_bandwidth (*cc.j2k_bandwidth);
}
@@ -131,7 +135,6 @@ main (int argc, char* argv[])
BOOST_FOREACH (shared_ptr<Content> j, content) {
if (j->video) {
- j->video->set_scale (VideoContentScale(cc.content_ratio));
j->video->set_frame_type (i.frame_type);
}
}