From 47cc4bf273b46afbbac346d03a9b8c2dd361fa60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Fri, 8 Mar 2024 07:33:36 -0300 Subject: [PATCH] Improved FFmpeg logging. Added ocio ICS to session files. --- mrv2/docs/HISTORY.md | 4 +++ mrv2/lib/mrvApp/mrvApp.cpp | 2 +- mrv2/lib/mrvFl/mrvSession.cpp | 32 ++++++++++++++++++----- mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp | 6 +++++ tlRender | 2 +- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index 708a5dae2..d2b83fd8e 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -18,6 +18,10 @@ v1.0.8 Note that -ocioDisplay and -ocioView must be used together. - Made OCIO Input Color Space be stored with the image, except when doing comparisons in which the first image's Input Color Space is used. + - Made OCIO Input Color Space for each image be stored in session files. + - Made FFmpeg's repeated warnings and errors only show up once in the status + bar and the logs. + v1.0.7 ====== diff --git a/mrv2/lib/mrvApp/mrvApp.cpp b/mrv2/lib/mrvApp/mrvApp.cpp index 0c036a6c9..6cc24e5b2 100644 --- a/mrv2/lib/mrvApp/mrvApp.cpp +++ b/mrv2/lib/mrvApp/mrvApp.cpp @@ -657,7 +657,7 @@ namespace mrv const std::string& msg = i.message; const std::string& kModule = i.module; if (msg == lastMessage) - return; + continue; lastMessage = msg; switch (i.type) { diff --git a/mrv2/lib/mrvFl/mrvSession.cpp b/mrv2/lib/mrvFl/mrvSession.cpp index fa1e79bd3..5b5194d92 100644 --- a/mrv2/lib/mrvFl/mrvSession.cpp +++ b/mrv2/lib/mrvFl/mrvSession.cpp @@ -35,6 +35,8 @@ #include "mrvSession.h" +#include "mrvFl/mrvOCIO.h" + namespace { const char* kModule = "mrv2s"; @@ -434,6 +436,8 @@ namespace mrv if (!Aitem) continue; + Aitem->ocioIcs = item.ocioIcs; + mrv::image::setOcioIcs(Aitem->ocioIcs); Aitem->annotations = item.annotations; Aitem->videoLayer = item.videoLayer; Aitem->currentTime = item.currentTime; @@ -467,6 +471,9 @@ namespace mrv toggle_secondary_cb(nullptr, ui); } + + unsigned numFiles = model->observeFiles()->getSize(); + // Decode ICS if (version >= 2) { @@ -493,8 +500,24 @@ namespace mrv Preferences::OCIO(ui); - int value = j["ics"]; - ui->uiICS->value(value); + int Aindex = session["Aindex"]; + if (Aindex < numFiles) + model->setA(Aindex); + + int value; + auto Aitem = model->observeA()->get(); + if (Aitem && !Aitem->ocioIcs.empty()) + { + std::cerr << Aindex + << " set ocioIcs to " << Aitem->ocioIcs + << std::endl; + mrv::image::setOcioIcs(Aitem->ocioIcs); + } + else + { + value = j["ics"]; + ui->uiICS->value(value); + } value = j["view"]; ui->OCIOView->value(value); ui->uiView->updateOCIOOptions(); @@ -642,11 +665,6 @@ namespace mrv { ui->uiPrefs->uiPrefsAutoPlayback->value(autoplayback); - unsigned numFiles = model->observeFiles()->getSize(); - int Aindex = session["Aindex"]; - if (Aindex < numFiles) - model->setA(Aindex); - std::vector Bindexes = session["Bindexes"]; model->clearB(); for (auto i : Bindexes) diff --git a/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp b/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp index c469f6c48..01b8fbae4 100644 --- a/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp +++ b/mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp @@ -24,6 +24,8 @@ namespace mrv j["volume"] = value.volume; j["mute"] = value.mute; j["audioOffset"] = value.audioOffset; + std::cerr << value.path.get() << " setting " << value.ocioIcs + << std::endl; j["ocioIcs"] = value.ocioIcs; std::vector< draw::Annotation > annotations; for (const auto& annotation : value.annotations) @@ -67,7 +69,11 @@ namespace mrv j.at("mute").get_to(value.mute); j.at("audioOffset").get_to(value.audioOffset); if (j.contains("ocioIcs")) + { j.at("ocioIcs").get_to(value.ocioIcs); + std::cerr << value.path.get() << " got ocio Ics for " + << value.ocioIcs << std::endl; + } const nlohmann::json& annotations = j["annotations"]; for (const auto& annotation : annotations) { diff --git a/tlRender b/tlRender index a6a2f0fef..b89064e5c 160000 --- a/tlRender +++ b/tlRender @@ -1 +1 @@ -Subproject commit a6a2f0fefcf39cc680b3cf66c88b6f6d4daaaa95 +Subproject commit b89064e5c788ca97002f0a4b1171f1cc88de355c