Add ProRes LT export option (#2834).
authorCarl Hetherington <cth@carlh.net>
Mon, 24 Jun 2024 21:01:13 +0000 (23:01 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 24 Jun 2024 21:01:13 +0000 (23:01 +0200)
src/lib/export_config.cc
src/lib/ffmpeg_file_encoder.cc
src/lib/ffmpeg_file_encoder.h
src/wx/export_video_file_dialog.cc
test/ffmpeg_encoder_test.cc

index 4dfbb902796565df2d49337d62eec8c2ca98fc00..79042e59c21597eedc70aea0c727dcb0fa13ba94 100644 (file)
@@ -65,6 +65,8 @@ ExportConfig::read(cxml::ConstNodePtr node)
                _format = ExportFormat::H264_AAC;
        } else if (format == "prores-4444") {
                _format = ExportFormat::PRORES_4444;
+       } else if (format == "prores-lt") {
+               _format = ExportFormat::PRORES_LT;
        } else {
                _format = ExportFormat::PRORES_HQ;
        }
@@ -89,6 +91,9 @@ ExportConfig::write(xmlpp::Element* element) const
                        /* Write this but we also accept 'prores' for backwards compatibility */
                        name = "prores-hq";
                        break;
+               case ExportFormat::PRORES_LT:
+                       name = "prores-lt";
+                       break;
                case ExportFormat::H264_AAC:
                        name = "h264-aac";
                        break;
@@ -138,4 +143,3 @@ ExportConfig::set_x264_crf(int crf)
 {
        _config->maybe_set(_x264_crf, crf);
 }
-
index 4547a8e8ef654d85e8c73dfe2bc780c265def6de..dfc0205ac6f2974f142bab2db4dcb380f06d8fa9 100644 (file)
@@ -241,6 +241,13 @@ FFmpegFileEncoder::FFmpegFileEncoder (
                av_dict_set (&_video_options, "profile", "3", 0);
                av_dict_set (&_video_options, "threads", "auto", 0);
                break;
+       case ExportFormat::PRORES_LT:
+               _sample_format = AV_SAMPLE_FMT_S32;
+               _video_codec_name = "prores_ks";
+               _audio_codec_name = "pcm_s24le";
+               av_dict_set(&_video_options, "profile", "1", 0);
+               av_dict_set(&_video_options, "threads", "auto", 0);
+               break;
        case ExportFormat::H264_AAC:
                _sample_format = AV_SAMPLE_FMT_FLTP;
                _video_codec_name = "libx264";
@@ -292,6 +299,7 @@ FFmpegFileEncoder::pixel_format (ExportFormat format)
        case ExportFormat::PRORES_4444:
                return AV_PIX_FMT_YUV444P10;
        case ExportFormat::PRORES_HQ:
+       case ExportFormat::PRORES_LT:
                return AV_PIX_FMT_YUV422P10;
        case ExportFormat::H264_AAC:
                return AV_PIX_FMT_YUV420P;
index 907eca53df235587a8fdbe4e6348d79689140631..a365f463a36c511fb953856ab03d9a0ed723cab9 100644 (file)
@@ -48,6 +48,7 @@ enum class ExportFormat
 {
        PRORES_4444,
        PRORES_HQ,
+       PRORES_LT,
        H264_AAC,
        SUBTITLES_DCP
 };
index 61198560294d792975cbcff0b665ba0ce970e0ec..6e32a8514f52206cbbc68ee45f589412c6fd5033 100644 (file)
@@ -22,6 +22,7 @@
 #include "check_box.h"
 #include "export_video_file_dialog.h"
 #include "file_picker_ctrl.h"
+#include "lib/ffmpeg_file_encoder.h"
 #include "wx_util.h"
 #include "lib/config.h"
 #include <dcp/warnings.h>
@@ -35,22 +36,25 @@ using std::string;
 using boost::bind;
 
 
-int constexpr FORMATS = 3;
+int constexpr FORMATS = 4;
 
 
 wxString format_names[] = {
        _("MOV / ProRes 4444"),
        _("MOV / ProRes HQ"),
+       _("MOV / ProRes LT"),
        _("MP4 / H.264"),
 };
 
 wxString format_filters[] = {
+       _("MOV files (*.mov)|*.mov"),
        _("MOV files (*.mov)|*.mov"),
        _("MOV files (*.mov)|*.mov"),
        _("MP4 files (*.mp4)|*.mp4"),
 };
 
 wxString format_extensions[] = {
+       "mov",
        "mov",
        "mov",
        "mp4",
@@ -59,6 +63,7 @@ wxString format_extensions[] = {
 ExportFormat formats[] = {
        ExportFormat::PRORES_4444,
        ExportFormat::PRORES_HQ,
+       ExportFormat::PRORES_LT,
        ExportFormat::H264_AAC,
 };
 
index b42ff92d8d00eb6f1c61573a0b56b938f4f7b24c..0a48cd7453be99cef73c93274307f5c15814a065 100644 (file)
@@ -69,6 +69,10 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
                name += "prores-hq";
                extension = "mov";
                break;
+       case ExportFormat::PRORES_LT:
+               name += "prores-lt";
+               extension = "mov";
+               break;
        case ExportFormat::SUBTITLES_DCP:
                BOOST_REQUIRE (false);
        }