+2016-03-02 c.hetherington <cth@carlh.net>
+
+ * Add configurable option to disable EBUR128
+ analysis.
+
2016-03-01 Carl Hetherington <cth@carlh.net>
* Version 2.6.30 released.
#include "playlist.h"
#include "filter.h"
#include "audio_filter_graph.h"
+#include "config.h"
extern "C" {
#include <libavutil/channel_layout.h>
#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
for (DCPTime t = start; t < length; t += block) {
shared_ptr<const AudioBuffers> audio = player->get_audio (t, block, false);
#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
- _ebur128->process (audio);
+ if (Config::instance()->analyse_ebur128 ()) {
+ _ebur128->process (audio);
+ }
#endif
analyse (audio);
set_progress ((t.seconds() - start.seconds()) / (length.seconds() - start.seconds()));
_analysis->set_sample_peak (_sample_peak, DCPTime::from_frames (_sample_peak_frame, _film->audio_frame_rate ()));
#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
- void* eb = _ebur128->get("Parsed_ebur128_0")->priv;
- double true_peak = 0;
- for (int i = 0; i < _film->audio_channels(); ++i) {
- true_peak = max (true_peak, av_ebur128_get_true_peaks(eb)[i]);
+ if (Config::instance()->analyse_ebur128 ()) {
+ void* eb = _ebur128->get("Parsed_ebur128_0")->priv;
+ double true_peak = 0;
+ for (int i = 0; i < _film->audio_channels(); ++i) {
+ true_peak = max (true_peak, av_ebur128_get_true_peaks(eb)[i]);
+ }
+ _analysis->set_true_peak (true_peak);
+ _analysis->set_integrated_loudness (av_ebur128_get_integrated_loudness(eb));
+ _analysis->set_loudness_range (av_ebur128_get_loudness_range(eb));
}
- _analysis->set_true_peak (true_peak);
- _analysis->set_integrated_loudness (av_ebur128_get_integrated_loudness(eb));
- _analysis->set_loudness_range (av_ebur128_get_loudness_range(eb));
#endif
if (_playlist->content().size() == 1) {
_check_for_test_updates = false;
_maximum_j2k_bandwidth = 250000000;
_log_types = LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR;
+ _analyse_ebur128 = true;
_automatic_audio_analysis = false;
#ifdef DCPOMATIC_WINDOWS
_win32_console = false;
_allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate").get_value_or (false);
_log_types = f.optional_number_child<int> ("LogTypes").get_value_or (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
+ _analyse_ebur128 = f.optional_bool_child("AnalyseEBUR128").get_value_or (true);
_automatic_audio_analysis = f.optional_bool_child ("AutomaticAudioAnalysis").get_value_or (false);
#ifdef DCPOMATIC_WINDOWS
_win32_console = f.optional_bool_child ("Win32Console").get_value_or (false);
root->add_child("MaximumJ2KBandwidth")->add_child_text (raw_convert<string> (_maximum_j2k_bandwidth));
root->add_child("AllowAnyDCPFrameRate")->add_child_text (_allow_any_dcp_frame_rate ? "1" : "0");
root->add_child("LogTypes")->add_child_text (raw_convert<string> (_log_types));
+ root->add_child("AnalyseEBUR128")->add_child_text (_analyse_ebur128 ? "1" : "0");
root->add_child("AutomaticAudioAnalysis")->add_child_text (_automatic_audio_analysis ? "1" : "0");
#ifdef DCPOMATIC_WINDOWS
root->add_child("Win32Console")->add_child_text (_win32_console ? "1" : "0");
return _log_types;
}
+ bool analyse_ebur128 () const {
+ return _analyse_ebur128;
+ }
+
bool automatic_audio_analysis () const {
return _automatic_audio_analysis;
}
maybe_set (_log_types, t);
}
+ void set_analyse_ebur128 (bool a) {
+ maybe_set (_analyse_ebur128, a);
+ }
+
void set_automatic_audio_analysis (bool a) {
maybe_set (_automatic_audio_analysis, a);
}
/** maximum allowed J2K bandwidth in bits per second */
int _maximum_j2k_bandwidth;
int _log_types;
+ bool _analyse_ebur128;
bool _automatic_audio_analysis;
#ifdef DCPOMATIC_WINDOWS
bool _win32_console;
table->Add (_cinemas_file, wxGBPosition (r, 1));
++r;
+#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
+ _analyse_ebur128 = new wxCheckBox (_panel, wxID_ANY, _("Find integrated loudness, true peak and loudness range when analysing audio"));
+ table->Add (_analyse_ebur128, wxGBPosition (r, 0), wxGBSpan (1, 2));
+ ++r;
+#endif
+
_automatic_audio_analysis = new wxCheckBox (_panel, wxID_ANY, _("Automatically analyse content audio"));
table->Add (_automatic_audio_analysis, wxGBPosition (r, 0), wxGBSpan (1, 2));
++r;
_num_local_encoding_threads->SetRange (1, 128);
_num_local_encoding_threads->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&GeneralPage::num_local_encoding_threads_changed, this));
+#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
+ _analyse_ebur128->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::analyse_ebur128_changed, this));
+#endif
_automatic_audio_analysis->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::automatic_audio_analysis_changed, this));
_check_for_updates->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::check_for_updates_changed, this));
_check_for_test_updates->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::check_for_test_updates_changed, this));
}
checked_set (_num_local_encoding_threads, config->num_local_encoding_threads ());
+#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
+ checked_set (_analyse_ebur128, config->analyse_ebur128 ());
+#endif
checked_set (_automatic_audio_analysis, config->automatic_audio_analysis ());
checked_set (_check_for_updates, config->check_for_updates ());
checked_set (_check_for_test_updates, config->check_for_test_updates ());
}
}
+#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
+ void analyse_ebur128_changed ()
+ {
+ Config::instance()->set_analyse_ebur128 (_analyse_ebur128->GetValue ());
+ }
+#endif
+
void automatic_audio_analysis_changed ()
{
Config::instance()->set_automatic_audio_analysis (_automatic_audio_analysis->GetValue ());
wxChoice* _language;
wxSpinCtrl* _num_local_encoding_threads;
FilePickerCtrl* _cinemas_file;
+#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
+ wxCheckBox* _analyse_ebur128;
+#endif
wxCheckBox* _automatic_audio_analysis;
wxCheckBox* _check_for_updates;
wxCheckBox* _check_for_test_updates;