+++ /dev/null
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Exec=@PREFIX@/bin/dcpomatic
-Name=DCP-o-matic
-Icon=dcpomatic
-Comment=DCP generator
-Categories=AudioVideo;Video
+++ /dev/null
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Exec=@PREFIX@/bin/dcpomatic_batch
-Name=DCP-o-matic Batch Converter
-Icon=dcpomatic
-Comment=DCP generator
-Categories=AudioVideo;Video
+++ /dev/null
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <stdexcept>
-#include "ab_transcode_job.h"
-#include "film.h"
-#include "ab_transcoder.h"
-#include "config.h"
-#include "log.h"
-
-#include "i18n.h"
-
-using std::string;
-using boost::shared_ptr;
-
-/** @param f Film to compare.
- */
-ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f)
- : Job (f)
-{
- _film_b.reset (new Film (*_film));
- _film_b->set_scaler (Config::instance()->reference_scaler ());
- /* XXX */
-// _film_b->set_filters (Config::instance()->reference_filters ());
-}
-
-string
-ABTranscodeJob::name () const
-{
- return String::compose (_("A/B transcode %1"), _film->name());
-}
-
-void
-ABTranscodeJob::run ()
-{
- try {
- /* _film_b is the one with reference filters */
- ABTranscoder w (_film_b, _film, shared_from_this ());
- w.go ();
- set_progress (1);
- set_state (FINISHED_OK);
-
- _film->log()->log ("A/B transcode job completed successfully");
-
- } catch (std::exception& e) {
-
- set_progress (1);
- set_state (FINISHED_ERROR);
- _film->log()->log (String::compose ("A/B transcode job failed (%1)", e.what()));
- throw;
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-/** @file src/ab_transcode_job.h
- * @brief Job to run a transcoder which produces output for A/B comparison of various settings.
- */
-
-#include <boost/shared_ptr.hpp>
-#include "job.h"
-
-class Film;
-
-/** @class ABTranscodeJob
- * @brief Job to run a transcoder which produces output for A/B comparison of various settings.
- *
- * The right half of the frame will be processed using the Film supplied;
- * the left half will be processed using the same state but with the reference
- * filters and scaler.
- */
-class ABTranscodeJob : public Job
-{
-public:
- ABTranscodeJob (
- boost::shared_ptr<Film> f
- );
-
- std::string name () const;
- void run ();
-
-private:
- /** Copy of our Film using the reference filters and scaler */
- boost::shared_ptr<Film> _film_b;
-};
+++ /dev/null
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <boost/shared_ptr.hpp>
-#include "ab_transcoder.h"
-#include "film.h"
-#include "encoder.h"
-#include "job.h"
-#include "image.h"
-#include "player.h"
-#include "combiner.h"
-
-/** @file src/ab_transcoder.cc
- * @brief A transcoder which uses one Film for the left half of the screen, and a different one
- * for the right half (to facilitate A/B comparisons of settings)
- */
-
-using std::string;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
-
-/** @param a Film to use for the left half of the screen.
- * @param b Film to use for the right half of the screen.
- * @param o Decoder options.
- * @param j Job that we are associated with.
- * @param e Encoder to use.
- */
-
-ABTranscoder::ABTranscoder (shared_ptr<Film> film_a, shared_ptr<Film> film_b, shared_ptr<Job> j)
- : _player_a (film_a->player ())
- , _player_b (film_b->player ())
- , _job (j)
- , _encoder (new Encoder (film_a, j))
- , _combiner (new Combiner)
-{
- _player_a->Video.connect (bind (&Combiner::process_video, _combiner, _1, _2, _3));
- _player_b->Video.connect (bind (&Combiner::process_video_b, _combiner, _1, _2, _3));
-
- _combiner->connect_video (_encoder);
- _player_a->connect_audio (_encoder);
-}
-
-void
-ABTranscoder::go ()
-{
- _encoder->process_begin ();
- while (!_player_a->pass () || !_player_b->pass ()) {}
- _encoder->process_end ();
-}
+++ /dev/null
-/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-/** @file src/ab_transcoder.h
- * @brief A transcoder which uses one Film for the left half of the screen, and a different one
- * for the right half (to facilitate A/B comparisons of settings)
- */
-
-#include <boost/shared_ptr.hpp>
-#include <stdint.h>
-#include "util.h"
-
-class Job;
-class Encoder;
-class Image;
-class Log;
-class Film;
-class Combiner;
-class Player;
-
-/** @class ABTranscoder
- * @brief A transcoder which uses one Film for the left half of the screen, and a different one
- * for the right half (to facilitate A/B comparisons of settings)
- */
-class ABTranscoder
-{
-public:
- ABTranscoder (
- boost::shared_ptr<Film> a,
- boost::shared_ptr<Film> b,
- boost::shared_ptr<Job> j
- );
-
- void go ();
-
-private:
- boost::shared_ptr<Player> _player_a;
- boost::shared_ptr<Player> _player_b;
- boost::shared_ptr<Job> _job;
- boost::shared_ptr<Encoder> _encoder;
- boost::shared_ptr<Combiner> _combiner;
- boost::shared_ptr<Image> _image;
-};
Config::Config ()
: _num_local_encoding_threads (2)
, _server_port (6192)
- , _reference_scaler (Scaler::from_id (N_("bicubic")))
, _tms_path (N_("."))
, _sound_processor (SoundProcessor::from_id (N_("dolby_cp750")))
, _default_still_length (10)
_num_local_encoding_threads = f.number_child<int> ("NumLocalEncodingThreads");
_default_directory = f.string_child ("DefaultDirectory");
_server_port = f.number_child<int> ("ServerPort");
- c = f.optional_string_child ("ReferenceScaler");
- if (c) {
- _reference_scaler = Scaler::from_id (c.get ());
- }
-
- list<shared_ptr<cxml::Node> > filters = f.node_children ("ReferenceFilter");
- for (list<shared_ptr<cxml::Node> >::iterator i = filters.begin(); i != filters.end(); ++i) {
- _reference_filters.push_back (Filter::from_id ((*i)->content ()));
- }
list<shared_ptr<cxml::Node> > servers = f.node_children ("Server");
for (list<shared_ptr<cxml::Node> >::iterator i = servers.begin(); i != servers.end(); ++i) {
_default_directory = v;
} else if (k == N_("server_port")) {
_server_port = atoi (v.c_str ());
- } else if (k == N_("reference_scaler")) {
- _reference_scaler = Scaler::from_id (v);
- } else if (k == N_("reference_filter")) {
- _reference_filters.push_back (Filter::from_id (v));
} else if (k == N_("server")) {
_servers.push_back (ServerDescription::create_from_metadata (v));
} else if (k == N_("tms_ip")) {
root->add_child("NumLocalEncodingThreads")->add_child_text (lexical_cast<string> (_num_local_encoding_threads));
root->add_child("DefaultDirectory")->add_child_text (_default_directory);
root->add_child("ServerPort")->add_child_text (lexical_cast<string> (_server_port));
- if (_reference_scaler) {
- root->add_child("ReferenceScaler")->add_child_text (_reference_scaler->id ());
- }
-
- for (vector<Filter const *>::const_iterator i = _reference_filters.begin(); i != _reference_filters.end(); ++i) {
- root->add_child("ReferenceFilter")->add_child_text ((*i)->id ());
- }
for (vector<ServerDescription*>::const_iterator i = _servers.begin(); i != _servers.end(); ++i) {
(*i)->as_xml (root->add_child ("Server"));
return _servers;
}
- Scaler const * reference_scaler () const {
- return _reference_scaler;
- }
-
- std::vector<Filter const *> reference_filters () const {
- return _reference_filters;
- }
-
/** @return The IP address of a TMS that we can copy DCPs to */
std::string tms_ip () const {
return _tms_ip;
#include "filter.h"
#include "util.h"
#include "job_manager.h"
-#include "ab_transcode_job.h"
#include "transcode_job.h"
#include "scp_dcp_job.h"
#include "log.h"
, _dcp_content_type (Config::instance()->default_dcp_content_type ())
, _container (Config::instance()->default_container ())
, _scaler (Scaler::from_id ("bicubic"))
- , _ab (false)
, _with_subtitles (false)
, _subtitle_offset (0)
, _subtitle_scale (1)
, _dcp_content_type (o._dcp_content_type)
, _container (o._container)
, _scaler (o._scaler)
- , _ab (o._ab)
, _with_subtitles (o._with_subtitles)
, _subtitle_offset (o._subtitle_offset)
, _subtitle_scale (o._subtitle_scale)
<< "_" << j2k_bandwidth()
<< "_" << lexical_cast<int> (colour_lut());
- if (ab()) {
- pair<string, string> fa = Filter::ffmpeg_strings (Config::instance()->reference_filters());
- s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second;
- }
-
return s.str ();
}
throw MissingSettingError (_("name"));
}
- shared_ptr<Job> r;
-
- if (ab()) {
- r = JobManager::instance()->add (shared_ptr<Job> (new ABTranscodeJob (shared_from_this())));
- } else {
- r = JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this())));
- }
+ JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this())));
}
/** Start a job to analyse the audio in our Playlist */
}
root->add_child("Scaler")->add_child_text (_scaler->id ());
- root->add_child("AB")->add_child_text (_ab ? "1" : "0");
root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0");
root->add_child("SubtitleOffset")->add_child_text (lexical_cast<string> (_subtitle_offset));
root->add_child("SubtitleScale")->add_child_text (lexical_cast<string> (_subtitle_scale));
}
_scaler = Scaler::from_id (f.string_child ("Scaler"));
- _ab = f.bool_child ("AB");
_with_subtitles = f.bool_child ("WithSubtitles");
_subtitle_offset = f.number_child<float> ("SubtitleOffset");
_subtitle_scale = f.number_child<float> ("SubtitleScale");
signal_changed (SCALER);
}
-void
-Film::set_ab (bool a)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _ab = a;
- }
- signal_changed (AB);
-}
-
void
Film::set_with_subtitles (bool w)
{
DCP_CONTENT_TYPE,
CONTAINER,
SCALER,
- AB,
WITH_SUBTITLES,
SUBTITLE_OFFSET,
SUBTITLE_SCALE,
return _scaler;
}
- bool ab () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _ab;
- }
-
bool with_subtitles () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _with_subtitles;
void set_dcp_content_type (DCPContentType const *);
void set_container (Ratio const *);
void set_scaler (Scaler const *);
- void set_ab (bool);
void set_with_subtitles (bool);
void set_subtitle_offset (int);
void set_subtitle_scale (float);
Ratio const * _container;
/** Scaler algorithm to use */
Scaler const * _scaler;
- /** true to create an A/B comparison DCP, where the left half of the image
- is the video without any filters or post-processing, and the right half
- has the specified filters and post-processing.
- */
- bool _ab;
/** True if subtitles should be shown for this film */
bool _with_subtitles;
/** y offset for placing subtitles, in source pixels; +ve is further down
import i18n
sources = """
- ab_transcode_job.cc
- ab_transcoder.cc
analyse_audio_job.cc
audio_analysis.cc
audio_buffers.cc
#include "filter.h"
#include "transcode_job.h"
#include "job_manager.h"
-#include "ab_transcode_job.h"
#include "util.h"
#include "scaler.h"
#include "version.h"
film->log()->set_level ((Log::Level) log_level);
- cout << "\nMaking ";
- if (film->ab()) {
- cout << "A/B ";
- }
- cout << "DCP for " << film->name() << "\n";
+ cout << "\nMaking DCP for " << film->name() << "\n";
// cout << "Content: " << film->content() << "\n";
// pair<string, string> const f = Filter::ffmpeg_strings (film->filters ());
// cout << "Filters: " << f.first << " " << f.second << "\n";
_notebook->AddPage (_metadata_panel, _("Metadata"), false);
make_tms_panel ();
_notebook->AddPage (_tms_panel, _("TMS"), false);
- make_ab_panel ();
- _notebook->AddPage (_ab_panel, _("A/B mode"), false);
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
overall_sizer->Add (s, 1, wxEXPAND | wxALL, 6);
_tms_password->Connect (wxID_ANY, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler (ConfigDialog::tms_password_changed), 0, this);
}
-void
-ConfigDialog::make_ab_panel ()
-{
- _ab_panel = new wxPanel (_notebook);
- wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
- _ab_panel->SetSizer (s);
-
- wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6);
- table->AddGrowableCol (1, 1);
- s->Add (table, 1, wxALL, 8);
-
- add_label_to_sizer (table, _ab_panel, _("Reference scaler"));
- _reference_scaler = new wxChoice (_ab_panel, wxID_ANY);
- vector<Scaler const *> const sc = Scaler::all ();
- for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
- _reference_scaler->Append (std_to_wx ((*i)->name ()));
- }
-
- table->Add (_reference_scaler, 1, wxEXPAND);
- table->AddSpacer (0);
-
- {
- add_label_to_sizer (table, _ab_panel, _("Reference filters"));
- wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _reference_filters = new wxStaticText (_ab_panel, wxID_ANY, wxT (""));
- s->Add (_reference_filters, 1, wxEXPAND);
- _reference_filters_button = new wxButton (_ab_panel, wxID_ANY, _("Edit..."));
- s->Add (_reference_filters_button, 0);
- table->Add (s, 1, wxEXPAND);
- table->AddSpacer (0);
- }
-}
-
void
ConfigDialog::make_metadata_panel ()
{
_remove_server->Enable (i >= 0);
}
-void
-ConfigDialog::reference_scaler_changed (wxCommandEvent &)
-{
- int const n = _reference_scaler->GetSelection ();
- if (n >= 0) {
- Config::instance()->set_reference_scaler (Scaler::from_index (n));
- }
-}
-
-void
-ConfigDialog::edit_reference_filters_clicked (wxCommandEvent &)
-{
- FilterDialog* d = new FilterDialog (this, Config::instance()->reference_filters ());
- d->ActiveChanged.connect (boost::bind (&ConfigDialog::reference_filters_changed, this, _1));
- d->ShowModal ();
- d->Destroy ();
-}
-
-void
-ConfigDialog::reference_filters_changed (vector<Filter const *> f)
-{
- Config::instance()->set_reference_filters (f);
- pair<string, string> p = Filter::ffmpeg_strings (Config::instance()->reference_filters ());
- _reference_filters->SetLabel (std_to_wx (p.first) + N_(" ") + std_to_wx (p.second));
-}
-
void
ConfigDialog::edit_default_dci_metadata_clicked (wxCommandEvent &)
{
void default_still_length_changed (wxCommandEvent &);
void default_directory_changed (wxCommandEvent &);
void edit_default_dci_metadata_clicked (wxCommandEvent &);
- void reference_scaler_changed (wxCommandEvent &);
- void edit_reference_filters_clicked (wxCommandEvent &);
- void reference_filters_changed (std::vector<Filter const *>);
void add_server_clicked (wxCommandEvent &);
void edit_server_clicked (wxCommandEvent &);
void remove_server_clicked (wxCommandEvent &);
void make_misc_panel ();
void make_tms_panel ();
void make_metadata_panel ();
- void make_ab_panel ();
void make_servers_panel ();
wxNotebook* _notebook;
wxPanel* _misc_panel;
wxPanel* _tms_panel;
- wxPanel* _ab_panel;
wxPanel* _servers_panel;
wxPanel* _metadata_panel;
wxCheckBox* _set_language;
wxDirPickerCtrl* _default_directory;
#endif
wxButton* _default_dci_metadata_button;
- wxChoice* _reference_scaler;
- wxStaticText* _reference_filters;
- wxButton* _reference_filters_button;
wxListCtrl* _servers;
wxButton* _add_server;
wxButton* _edit_server;
#include "lib/film.h"
#include "lib/transcode_job.h"
#include "lib/exceptions.h"
-#include "lib/ab_transcode_job.h"
#include "lib/job_manager.h"
#include "lib/filter.h"
#include "lib/ratio.h"
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
/*
Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
f->set_name ("fred");
f->set_dcp_content_type (DCPContentType::from_pretty_name ("Short"));
f->set_container (Ratio::from_id ("185"));
- f->set_ab (true);
f->write_metadata ();
stringstream s;
BOOST_CHECK_EQUAL (g->name(), "fred");
BOOST_CHECK_EQUAL (g->dcp_content_type(), DCPContentType::from_pretty_name ("Short"));
BOOST_CHECK_EQUAL (g->container(), Ratio::from_id ("185"));
- BOOST_CHECK_EQUAL (g->ab(), true);
g->write_metadata ();
BOOST_CHECK_EQUAL (::system (s.str().c_str ()), 0);