Merge tag 'v2.16.77' into v2.17.x
[dcpomatic.git] / src / tools / dcpomatic_cli.cc
index 3e1e13c515f84a1ce60e4938833e44541fbb9923..9cb3c832a9c5bb6f77bd68221e2393b57617b580 100644 (file)
@@ -28,6 +28,9 @@
 #include "lib/ffmpeg_encoder.h"
 #include "lib/film.h"
 #include "lib/filter.h"
+#ifdef DCPOMATIC_GROK
+#include "lib/grok/context.h"
+#endif
 #include "lib/hints.h"
 #include "lib/job_manager.h"
 #include "lib/json_server.h"
@@ -39,6 +42,7 @@
 #include "lib/util.h"
 #include "lib/version.h"
 #include "lib/video_content.h"
+#include <dcp/filesystem.h>
 #include <dcp/version.h>
 #include <getopt.h>
 #include <iostream>
@@ -90,12 +94,13 @@ print_dump (shared_ptr<Film> film)
        cout << film->dcp_name (true) << "\n"
             << film->container()->container_nickname() << " at " << ((film->resolution() == Resolution::TWO_K) ? "2K" : "4K") << "\n"
             << (film->j2k_bandwidth() / 1000000) << "Mbit/s" << "\n"
+            << "Duration " << (film->length().timecode(film->video_frame_rate())) << "\n"
             << "Output " << film->video_frame_rate() << "fps " << (film->three_d() ? "3D" : "2D") << " " << (film->audio_frame_rate() / 1000) << "kHz\n"
             << (film->interop() ? "Inter-Op" : "SMPTE") << " " << (film->encrypted() ? "encrypted" : "unencrypted") << "\n";
 
        for (auto c: film->content()) {
                cout << "\n"
-                    << c->path(0) << "\n"
+                    << c->path(0).string() << "\n"
                     << "\tat " << c->position().seconds ()
                     << " length " << c->full_length(film).seconds ()
                     << " start trim " << c->trim_start().seconds ()
@@ -412,7 +417,7 @@ main (int argc, char* argv[])
        signal_manager = new SignalManager ();
 
        if (no_remote || export_format) {
-               EncodeServerFinder::instance()->stop ();
+               EncodeServerFinder::drop();
        }
 
        if (json_port) {
@@ -442,7 +447,7 @@ main (int argc, char* argv[])
        for (auto i: film->content()) {
                auto paths = i->paths();
                for (auto j: paths) {
-                       if (!boost::filesystem::exists(j)) {
+                       if (!dcp::filesystem::exists(j)) {
                                cerr << argv[0] << ": content file " << j << " not found.\n";
                                exit (EXIT_FAILURE);
                        }
@@ -495,6 +500,11 @@ main (int argc, char* argv[])
                }
        }
 
+#ifdef DCPOMATIC_GROK
+       grk_plugin::setMessengerLogger(new grk_plugin::GrokLogger("[GROK] "));
+       setup_grok_library_path();
+#endif
+
        if (progress) {
                if (export_format) {
                        cout << "\nExporting " << film->name() << "\n";