Rename Encoder -> FilmEncoder, and subclasses.
[dcpomatic.git] / src / tools / dcpomatic_cli.cc
index c335db616f5b8f78eab1aa9d4d7a158b31c8f555..9eec498f975d72d2dad73552cd2987c3d8fa71f4 100644 (file)
@@ -25,7 +25,7 @@
 #include "lib/cross.h"
 #include "lib/dcpomatic_log.h"
 #include "lib/encode_server_finder.h"
-#include "lib/ffmpeg_encoder.h"
+#include "lib/ffmpeg_film_encoder.h"
 #include "lib/film.h"
 #include "lib/filter.h"
 #ifdef DCPOMATIC_GROK
@@ -40,6 +40,7 @@
 #include "lib/signal_manager.h"
 #include "lib/transcode_job.h"
 #include "lib/util.h"
+#include "lib/variant.h"
 #include "lib/version.h"
 #include "lib/video_content.h"
 #include <dcp/filesystem.h>
@@ -66,7 +67,7 @@ static void
 help (string n)
 {
        cerr << "Syntax: " << n << " [OPTION] [<FILM>]\n"
-            << "  -v, --version                     show DCP-o-matic version\n"
+            << variant::insert_dcpomatic("  -v, --version                     show %1 version\n")
             << "  -h, --help                        show this help\n"
             << "  -f, --flags                       show flags passed to C++ compiler on build\n"
             << "  -n, --no-progress                 do not print progress to stdout\n"
@@ -75,7 +76,7 @@ help (string n)
             << "  -j, --json <port>                 run a JSON server on the specified port\n"
             << "  -k, --keep-going                  keep running even when the job is complete\n"
             << "  -s, --servers <file>              specify servers to use in a text file\n"
-            << "  -l, --list-servers                just display a list of encoding servers that DCP-o-matic is configured to use; don't encode\n"
+            << variant::insert_dcpomatic("  -l, --list-servers                just display a list of encoding servers that %1 is configured to use; don't encode\n")
             << "  -d, --dcp-path                    echo DCP's path to stdout on successful completion (implies -n)\n"
             << "  -c, --config <dir>                directory containing config.xml and cinemas.xml\n"
             << "      --dump                        just dump a summary of the film's settings; don't encode\n"
@@ -94,19 +95,20 @@ 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 ()
                     << " end trim " << c->trim_end().seconds () << "\n";
 
-               if (c->video) {
-                       cout << "\t" << c->video->size().width << "x" << c->video->size().height << "\n"
+               if (c->video && c->video->size()) {
+                       cout << "\t" << c->video->size()->width << "x" << c->video->size()->height << "\n"
                             << "\t" << c->active_video_frame_rate(film) << "fps\n"
                             << "\tcrop left " << c->video->requested_left_crop()
                             << " right " << c->video->requested_right_crop()
@@ -517,7 +519,7 @@ main (int argc, char* argv[])
        if (export_format) {
                auto job = std::make_shared<TranscodeJob>(film, behaviour);
                job->set_encoder (
-                       std::make_shared<FFmpegEncoder> (
+                       std::make_shared<FFmpegFilmEncoder>(
                                film, job, *export_filename, *export_format == "mp4" ? ExportFormat::H264_AAC : ExportFormat::PRORES_HQ, false, false, false, 23
                                )
                        );