1 /* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
4 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <boost/filesystem.hpp>
31 #include <boost/algorithm/string.hpp>
32 #include <boost/lexical_cast.hpp>
33 #include <boost/date_time.hpp>
34 #include <libxml++/libxml++.h>
35 #include <libcxml/cxml.h>
41 #include "job_manager.h"
42 #include "ab_transcode_job.h"
43 #include "transcode_job.h"
44 #include "scp_dcp_job.h"
46 #include "exceptions.h"
47 #include "examine_content_job.h"
51 #include "ui_signaller.h"
52 #include "analyse_audio_job.h"
55 #include "ffmpeg_content.h"
56 #include "imagemagick_content.h"
57 #include "sndfile_content.h"
58 #include "dcp_content_type.h"
63 using std::stringstream;
76 using boost::shared_ptr;
77 using boost::lexical_cast;
78 using boost::to_upper_copy;
79 using boost::ends_with;
80 using boost::starts_with;
81 using boost::optional;
84 int const Film::state_version = 4;
86 /** Construct a Film object in a given directory, reading any metadata
87 * file that exists in that directory. An exception will be thrown if
88 * must_exist is true and the specified directory does not exist.
90 * @param d Film directory.
91 * @param must_exist true to throw an exception if does not exist.
94 Film::Film (string d, bool must_exist)
95 : _playlist (new Playlist)
96 , _use_dci_name (true)
97 , _trust_content_headers (true)
98 , _dcp_content_type (Config::instance()->default_dcp_content_type ())
99 , _format (Config::instance()->default_format ())
100 , _scaler (Scaler::from_id ("bicubic"))
107 , _with_subtitles (false)
108 , _subtitle_offset (0)
109 , _subtitle_scale (1)
111 , _j2k_bandwidth (200000000)
112 , _dci_metadata (Config::instance()->default_dci_metadata ())
113 , _dcp_video_frame_rate (0)
116 set_dci_date_today ();
118 _playlist->Changed.connect (bind (&Film::playlist_changed, this));
119 _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2));
121 /* Make state.directory a complete path without ..s (where possible)
122 (Code swiped from Adam Bowen on stackoverflow)
125 boost::filesystem::path p (boost::filesystem::system_complete (d));
126 boost::filesystem::path result;
127 for (boost::filesystem::path::iterator i = p.begin(); i != p.end(); ++i) {
129 if (boost::filesystem::is_symlink (result) || result.filename() == "..") {
132 result = result.parent_path ();
134 } else if (*i != ".") {
139 set_directory (result.string ());
141 if (!boost::filesystem::exists (directory())) {
143 throw OpenFileError (directory());
145 boost::filesystem::create_directory (directory());
155 _log.reset (new FileLog (file ("log")));
158 Film::Film (Film const & o)
159 : boost::enable_shared_from_this<Film> (o)
160 /* note: the copied film shares the original's log */
162 , _playlist (new Playlist (o._playlist))
163 , _directory (o._directory)
165 , _use_dci_name (o._use_dci_name)
166 , _trust_content_headers (o._trust_content_headers)
167 , _dcp_content_type (o._dcp_content_type)
168 , _format (o._format)
170 , _filters (o._filters)
171 , _scaler (o._scaler)
172 , _trim_start (o._trim_start)
173 , _trim_end (o._trim_end)
174 , _trim_type (o._trim_type)
176 , _audio_gain (o._audio_gain)
177 , _audio_delay (o._audio_delay)
178 , _with_subtitles (o._with_subtitles)
179 , _subtitle_offset (o._subtitle_offset)
180 , _subtitle_scale (o._subtitle_scale)
181 , _colour_lut (o._colour_lut)
182 , _j2k_bandwidth (o._j2k_bandwidth)
183 , _dci_metadata (o._dci_metadata)
184 , _dcp_video_frame_rate (o._dcp_video_frame_rate)
185 , _dci_date (o._dci_date)
188 _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2));
192 Film::video_state_identifier () const
197 pair<string, string> f = Filter::ffmpeg_strings (filters());
201 << "_" << _playlist->video_digest()
202 << "_" << crop().left << "_" << crop().right << "_" << crop().top << "_" << crop().bottom
203 << "_" << _dcp_video_frame_rate
204 << "_" << f.first << "_" << f.second
205 << "_" << scaler()->id()
206 << "_" << j2k_bandwidth()
207 << "_" << boost::lexical_cast<int> (colour_lut());
210 pair<string, string> fa = Filter::ffmpeg_strings (Config::instance()->reference_filters());
211 s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second;
217 /** @return The path to the directory to write video frame info files to */
219 Film::info_dir () const
221 boost::filesystem::path p;
223 p /= video_state_identifier ();
224 return dir (p.string());
228 Film::internal_video_mxf_dir () const
230 boost::filesystem::path p;
231 return dir ("video");
235 Film::internal_video_mxf_filename () const
237 return video_state_identifier() + ".mxf";
241 Film::dcp_video_mxf_filename () const
243 return filename_safe_name() + "_video.mxf";
247 Film::dcp_audio_mxf_filename () const
249 return filename_safe_name() + "_audio.mxf";
253 Film::filename_safe_name () const
255 string const n = name ();
257 for (size_t i = 0; i < n.length(); ++i) {
258 if (isalnum (n[i])) {
269 Film::audio_analysis_path () const
271 boost::filesystem::path p;
273 p /= _playlist->audio_digest();
274 return file (p.string ());
277 /** Add suitable Jobs to the JobManager to create a DCP for this Film */
281 set_dci_date_today ();
283 if (dcp_name().find ("/") != string::npos) {
284 throw BadSettingError (_("name"), _("cannot contain slashes"));
287 log()->log (String::compose ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary()));
291 gethostname (buffer, sizeof (buffer));
292 log()->log (String::compose ("Starting to make DCP on %1", buffer));
295 // log()->log (String::compose ("Content is %1; type %2", content_path(), (content_type() == STILL ? _("still") : _("video"))));
297 // log()->log (String::compose ("Content length %1", length().get()));
299 // log()->log (String::compose ("Content digest %1", content_digest()));
300 // log()->log (String::compose ("Content at %1 fps, DCP at %2 fps", source_frame_rate(), dcp_frame_rate()));
301 log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads()));
302 log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth()));
303 #ifdef DCPOMATIC_DEBUG
304 log()->log ("DCP-o-matic built in debug mode.");
306 log()->log ("DCP-o-matic built in optimised mode.");
309 log()->log ("libdcp built in debug mode.");
311 log()->log ("libdcp built in optimised mode.");
313 pair<string, int> const c = cpu_info ();
314 log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second));
317 throw MissingSettingError (_("format"));
320 if (_playlist->content().empty ()) {
321 throw StringError (_("You must add some content to the DCP before creating it"));
324 if (dcp_content_type() == 0) {
325 throw MissingSettingError (_("content type"));
328 if (name().empty()) {
329 throw MissingSettingError (_("name"));
335 r = JobManager::instance()->add (shared_ptr<Job> (new ABTranscodeJob (shared_from_this())));
337 r = JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this())));
341 /** Start a job to analyse the audio in our Playlist */
343 Film::analyse_audio ()
345 if (_analyse_audio_job) {
349 _analyse_audio_job.reset (new AnalyseAudioJob (shared_from_this()));
350 _analyse_audio_job->Finished.connect (bind (&Film::analyse_audio_finished, this));
351 JobManager::instance()->add (_analyse_audio_job);
354 /** Start a job to examine a piece of content */
356 Film::examine_content (shared_ptr<Content> c)
358 shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c, trust_content_headers ()));
359 JobManager::instance()->add (j);
363 Film::analyse_audio_finished ()
367 if (_analyse_audio_job->finished_ok ()) {
368 AudioAnalysisSucceeded ();
371 _analyse_audio_job.reset ();
374 /** Start a job to send our DCP to the configured TMS */
376 Film::send_dcp_to_tms ()
378 shared_ptr<Job> j (new SCPDCPJob (shared_from_this()));
379 JobManager::instance()->add (j);
382 /** Count the number of frames that have been encoded for this film.
383 * @return frame count.
386 Film::encoded_frames () const
393 for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (info_dir ()); i != boost::filesystem::directory_iterator(); ++i) {
395 boost::this_thread::interruption_point ();
401 /** Write state to our `metadata' file */
403 Film::write_metadata () const
405 boost::mutex::scoped_lock lm (_state_mutex);
408 boost::filesystem::create_directories (directory());
411 xmlpp::Element* root = doc.create_root_node ("Metadata");
413 root->add_child("Version")->add_child_text (boost::lexical_cast<string> (state_version));
414 root->add_child("Name")->add_child_text (_name);
415 root->add_child("UseDCIName")->add_child_text (_use_dci_name ? "1" : "0");
416 root->add_child("TrustContentHeaders")->add_child_text (_trust_content_headers ? "1" : "0");
418 if (_dcp_content_type) {
419 root->add_child("DCPContentType")->add_child_text (_dcp_content_type->dci_name ());
423 root->add_child("Format")->add_child_text (_format->id ());
426 switch (_trim_type) {
428 root->add_child("TrimType")->add_child_text ("CPL");
431 root->add_child("TrimType")->add_child_text ("Encode");
434 root->add_child("LeftCrop")->add_child_text (boost::lexical_cast<string> (_crop.left));
435 root->add_child("RightCrop")->add_child_text (boost::lexical_cast<string> (_crop.right));
436 root->add_child("TopCrop")->add_child_text (boost::lexical_cast<string> (_crop.top));
437 root->add_child("BottomCrop")->add_child_text (boost::lexical_cast<string> (_crop.bottom));
439 for (vector<Filter const *>::const_iterator i = _filters.begin(); i != _filters.end(); ++i) {
440 root->add_child("Filter")->add_child_text ((*i)->id ());
443 root->add_child("Scaler")->add_child_text (_scaler->id ());
444 root->add_child("TrimStart")->add_child_text (boost::lexical_cast<string> (_trim_start));
445 root->add_child("TrimEnd")->add_child_text (boost::lexical_cast<string> (_trim_end));
446 root->add_child("AB")->add_child_text (_ab ? "1" : "0");
447 root->add_child("AudioGain")->add_child_text (boost::lexical_cast<string> (_audio_gain));
448 root->add_child("AudioDelay")->add_child_text (boost::lexical_cast<string> (_audio_delay));
449 root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0");
450 root->add_child("SubtitleOffset")->add_child_text (boost::lexical_cast<string> (_subtitle_offset));
451 root->add_child("SubtitleScale")->add_child_text (boost::lexical_cast<string> (_subtitle_scale));
452 root->add_child("ColourLUT")->add_child_text (boost::lexical_cast<string> (_colour_lut));
453 root->add_child("J2KBandwidth")->add_child_text (boost::lexical_cast<string> (_j2k_bandwidth));
454 _dci_metadata.as_xml (root->add_child ("DCIMetadata"));
455 root->add_child("DCPVideoFrameRate")->add_child_text (boost::lexical_cast<string> (_dcp_video_frame_rate));
456 root->add_child("DCIDate")->add_child_text (boost::gregorian::to_iso_string (_dci_date));
457 _playlist->as_xml (root->add_child ("Playlist"));
459 doc.write_to_file_formatted (file ("metadata.xml"));
464 /** Read state from our metadata file */
466 Film::read_metadata ()
468 boost::mutex::scoped_lock lm (_state_mutex);
471 if (boost::filesystem::exists (file ("metadata")) && !boost::filesystem::exists (file ("metadata.xml"))) {
472 throw StringError (_("This film was created with an older version of DCP-o-matic, and unfortunately it cannot be loaded into this version. You will need to create a new Film, re-add your content and set it up again. Sorry!"));
475 cxml::File f (file ("metadata.xml"), "Metadata");
477 _name = f.string_child ("Name");
478 _use_dci_name = f.bool_child ("UseDCIName");
479 _trust_content_headers = f.bool_child ("TrustContentHeaders");
482 optional<string> c = f.optional_string_child ("DCPContentType");
484 _dcp_content_type = DCPContentType::from_dci_name (c.get ());
489 optional<string> c = f.optional_string_child ("Format");
491 _format = Format::from_id (c.get ());
496 optional<string> c = f.optional_string_child ("TrimType");
497 if (!c || c.get() == "CPL") {
499 } else if (c && c.get() == "Encode") {
504 _crop.left = f.number_child<int> ("LeftCrop");
505 _crop.right = f.number_child<int> ("RightCrop");
506 _crop.top = f.number_child<int> ("TopCrop");
507 _crop.bottom = f.number_child<int> ("BottomCrop");
510 list<shared_ptr<cxml::Node> > c = f.node_children ("Filter");
511 for (list<shared_ptr<cxml::Node> >::iterator i = c.begin(); i != c.end(); ++i) {
512 _filters.push_back (Filter::from_id ((*i)->content ()));
516 _scaler = Scaler::from_id (f.string_child ("Scaler"));
517 _trim_start = f.number_child<int> ("TrimStart");
518 _trim_end = f.number_child<int> ("TrimEnd");
519 _ab = f.bool_child ("AB");
520 _audio_gain = f.number_child<float> ("AudioGain");
521 _audio_delay = f.number_child<int> ("AudioDelay");
522 _with_subtitles = f.bool_child ("WithSubtitles");
523 _subtitle_offset = f.number_child<float> ("SubtitleOffset");
524 _subtitle_scale = f.number_child<float> ("SubtitleScale");
525 _colour_lut = f.number_child<int> ("ColourLUT");
526 _j2k_bandwidth = f.number_child<int> ("J2KBandwidth");
527 _dci_metadata = DCIMetadata (f.node_child ("DCIMetadata"));
528 _dcp_video_frame_rate = f.number_child<int> ("DCPVideoFrameRate");
529 _dci_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate"));
531 _playlist->set_from_xml (f.node_child ("Playlist"));
537 Film::cropped_size (libdcp::Size s) const
539 boost::mutex::scoped_lock lm (_state_mutex);
540 s.width -= _crop.left + _crop.right;
541 s.height -= _crop.top + _crop.bottom;
545 /** Given a directory name, return its full path within the Film's directory.
546 * The directory (and its parents) will be created if they do not exist.
549 Film::dir (string d) const
551 boost::mutex::scoped_lock lm (_directory_mutex);
553 boost::filesystem::path p;
557 boost::filesystem::create_directories (p);
562 /** Given a file or directory name, return its full path within the Film's directory.
563 * _directory_mutex must not be locked on entry.
564 * Any required parent directories will be created.
567 Film::file (string f) const
569 boost::mutex::scoped_lock lm (_directory_mutex);
571 boost::filesystem::path p;
575 boost::filesystem::create_directories (p.parent_path ());
580 /** @return a DCI-compliant name for a DCP of this film */
582 Film::dci_name (bool if_created_now) const
586 string fixed_name = to_upper_copy (name());
587 for (size_t i = 0; i < fixed_name.length(); ++i) {
588 if (fixed_name[i] == ' ') {
593 /* Spec is that the name part should be maximum 14 characters, as I understand it */
594 if (fixed_name.length() > 14) {
595 fixed_name = fixed_name.substr (0, 14);
600 if (dcp_content_type()) {
601 d << "_" << dcp_content_type()->dci_name();
605 d << "_" << format()->dci_name();
608 DCIMetadata const dm = dci_metadata ();
610 if (!dm.audio_language.empty ()) {
611 d << "_" << dm.audio_language;
612 if (!dm.subtitle_language.empty()) {
613 d << "-" << dm.subtitle_language;
619 if (!dm.territory.empty ()) {
620 d << "_" << dm.territory;
621 if (!dm.rating.empty ()) {
622 d << "-" << dm.rating;
628 if (!dm.studio.empty ()) {
629 d << "_" << dm.studio;
632 if (if_created_now) {
633 d << "_" << boost::gregorian::to_iso_string (boost::gregorian::day_clock::local_day ());
635 d << "_" << boost::gregorian::to_iso_string (_dci_date);
638 if (!dm.facility.empty ()) {
639 d << "_" << dm.facility;
642 if (!dm.package_type.empty ()) {
643 d << "_" << dm.package_type;
649 /** @return name to give the DCP */
651 Film::dcp_name (bool if_created_now) const
653 if (use_dci_name()) {
654 return dci_name (if_created_now);
662 Film::set_directory (string d)
664 boost::mutex::scoped_lock lm (_state_mutex);
670 Film::set_name (string n)
673 boost::mutex::scoped_lock lm (_state_mutex);
676 signal_changed (NAME);
680 Film::set_use_dci_name (bool u)
683 boost::mutex::scoped_lock lm (_state_mutex);
686 signal_changed (USE_DCI_NAME);
690 Film::set_trust_content_headers (bool t)
693 boost::mutex::scoped_lock lm (_state_mutex);
694 _trust_content_headers = t;
697 signal_changed (TRUST_CONTENT_HEADERS);
699 Playlist::ContentList content = _playlist->content ();
700 if (!_trust_content_headers && !content.empty()) {
701 /* We just said that we don't trust the content's header */
702 for (Playlist::ContentList::iterator i = content.begin(); i != content.end(); ++i) {
703 examine_content (*i);
709 Film::set_dcp_content_type (DCPContentType const * t)
712 boost::mutex::scoped_lock lm (_state_mutex);
713 _dcp_content_type = t;
715 signal_changed (DCP_CONTENT_TYPE);
719 Film::set_format (Format const * f)
722 boost::mutex::scoped_lock lm (_state_mutex);
725 signal_changed (FORMAT);
729 Film::set_crop (Crop c)
732 boost::mutex::scoped_lock lm (_state_mutex);
735 signal_changed (CROP);
739 Film::set_left_crop (int c)
742 boost::mutex::scoped_lock lm (_state_mutex);
744 if (_crop.left == c) {
750 signal_changed (CROP);
754 Film::set_right_crop (int c)
757 boost::mutex::scoped_lock lm (_state_mutex);
758 if (_crop.right == c) {
764 signal_changed (CROP);
768 Film::set_top_crop (int c)
771 boost::mutex::scoped_lock lm (_state_mutex);
772 if (_crop.top == c) {
778 signal_changed (CROP);
782 Film::set_bottom_crop (int c)
785 boost::mutex::scoped_lock lm (_state_mutex);
786 if (_crop.bottom == c) {
792 signal_changed (CROP);
796 Film::set_filters (vector<Filter const *> f)
799 boost::mutex::scoped_lock lm (_state_mutex);
802 signal_changed (FILTERS);
806 Film::set_scaler (Scaler const * s)
809 boost::mutex::scoped_lock lm (_state_mutex);
812 signal_changed (SCALER);
816 Film::set_trim_start (int t)
819 boost::mutex::scoped_lock lm (_state_mutex);
822 signal_changed (TRIM_START);
826 Film::set_trim_end (int t)
829 boost::mutex::scoped_lock lm (_state_mutex);
832 signal_changed (TRIM_END);
836 Film::set_trim_type (TrimType t)
839 boost::mutex::scoped_lock lm (_state_mutex);
842 signal_changed (TRIM_TYPE);
846 Film::set_ab (bool a)
849 boost::mutex::scoped_lock lm (_state_mutex);
856 Film::set_audio_gain (float g)
859 boost::mutex::scoped_lock lm (_state_mutex);
862 signal_changed (AUDIO_GAIN);
866 Film::set_audio_delay (int d)
869 boost::mutex::scoped_lock lm (_state_mutex);
872 signal_changed (AUDIO_DELAY);
876 Film::set_with_subtitles (bool w)
879 boost::mutex::scoped_lock lm (_state_mutex);
882 signal_changed (WITH_SUBTITLES);
886 Film::set_subtitle_offset (int o)
889 boost::mutex::scoped_lock lm (_state_mutex);
890 _subtitle_offset = o;
892 signal_changed (SUBTITLE_OFFSET);
896 Film::set_subtitle_scale (float s)
899 boost::mutex::scoped_lock lm (_state_mutex);
902 signal_changed (SUBTITLE_SCALE);
906 Film::set_colour_lut (int i)
909 boost::mutex::scoped_lock lm (_state_mutex);
912 signal_changed (COLOUR_LUT);
916 Film::set_j2k_bandwidth (int b)
919 boost::mutex::scoped_lock lm (_state_mutex);
922 signal_changed (J2K_BANDWIDTH);
926 Film::set_dci_metadata (DCIMetadata m)
929 boost::mutex::scoped_lock lm (_state_mutex);
932 signal_changed (DCI_METADATA);
937 Film::set_dcp_video_frame_rate (int f)
940 boost::mutex::scoped_lock lm (_state_mutex);
941 _dcp_video_frame_rate = f;
943 signal_changed (DCP_VIDEO_FRAME_RATE);
947 Film::signal_changed (Property p)
950 boost::mutex::scoped_lock lm (_state_mutex);
956 set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ());
963 ui_signaller->emit (boost::bind (boost::ref (Changed), p));
968 Film::set_dci_date_today ()
970 _dci_date = boost::gregorian::day_clock::local_day ();
974 Film::info_path (int f) const
976 boost::filesystem::path p;
981 s << setfill('0') << f << ".md5";
985 /* info_dir() will already have added any initial bit of the path,
986 so don't call file() on this.
992 Film::j2c_path (int f, bool t) const
994 boost::filesystem::path p;
996 p /= video_state_identifier ();
1000 s << setfill('0') << f << ".j2c";
1007 return file (p.string ());
1010 /** Make an educated guess as to whether we have a complete DCP
1012 * @return true if we do.
1016 Film::have_dcp () const
1019 libdcp::DCP dcp (dir (dcp_name()));
1029 Film::player () const
1031 boost::mutex::scoped_lock lm (_state_mutex);
1032 return shared_ptr<Player> (new Player (shared_from_this (), _playlist));
1035 shared_ptr<Playlist>
1036 Film::playlist () const
1038 boost::mutex::scoped_lock lm (_state_mutex);
1042 Playlist::ContentList
1043 Film::content () const
1045 return _playlist->content ();
1049 Film::add_content (shared_ptr<Content> c)
1052 examine_content (c);
1056 Film::remove_content (shared_ptr<Content> c)
1058 _playlist->remove (c);
1062 Film::length () const
1064 return _playlist->length (shared_from_this ());
1068 Film::has_subtitles () const
1070 return _playlist->has_subtitles ();
1074 Film::best_dcp_video_frame_rate () const
1076 return _playlist->best_dcp_frame_rate ();
1080 Film::playlist_content_changed (boost::weak_ptr<Content> c, int p)
1082 if (p == VideoContentProperty::VIDEO_FRAME_RATE) {
1083 set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ());
1087 ui_signaller->emit (boost::bind (boost::ref (ContentChanged), c, p));
1092 Film::playlist_changed ()
1094 signal_changed (CONTENT);
1100 return _playlist->loop ();
1104 Film::set_loop (int c)
1106 _playlist->set_loop (c);
1110 Film::time_to_audio_frames (Time t) const
1112 return t * dcp_audio_frame_rate () / TIME_HZ;
1116 Film::time_to_video_frames (Time t) const
1118 return t * dcp_video_frame_rate () / TIME_HZ;
1122 Film::audio_frames_to_time (OutputAudioFrame f) const
1124 return f * TIME_HZ / dcp_audio_frame_rate ();
1128 Film::video_frames_to_time (OutputVideoFrame f) const
1130 return f * TIME_HZ / dcp_video_frame_rate ();
1134 Film::dcp_audio_frame_rate () const