Skip to content

Commit

Permalink
Improved FFmpeg logging.
Browse files Browse the repository at this point in the history
Added ocio ICS to session files.
  • Loading branch information
ggarra13 committed Mar 8, 2024
1 parent fbba11b commit 47cc4bf
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
4 changes: 4 additions & 0 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
======
Expand Down
2 changes: 1 addition & 1 deletion mrv2/lib/mrvApp/mrvApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
32 changes: 25 additions & 7 deletions mrv2/lib/mrvFl/mrvSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#include "mrvSession.h"

#include "mrvFl/mrvOCIO.h"

namespace
{
const char* kModule = "mrv2s";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -467,6 +471,9 @@ namespace mrv
toggle_secondary_cb(nullptr, ui);
}


unsigned numFiles = model->observeFiles()->getSize();

// Decode ICS
if (version >= 2)
{
Expand All @@ -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();
Expand Down Expand Up @@ -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<int> Bindexes = session["Bindexes"];
model->clearB();
for (auto i : Bindexes)
Expand Down
6 changes: 6 additions & 0 deletions mrv2/lib/mrvNetwork/mrvFilesModelItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion tlRender
Submodule tlRender updated 1 files
+8 −0 lib/tlIO/FFmpeg.cpp

0 comments on commit 47cc4bf

Please sign in to comment.