2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <boost/filesystem.hpp>
29 #include <boost/algorithm/string.hpp>
30 #include <boost/lexical_cast.hpp>
31 #include <boost/date_time.hpp>
32 #include <libxml++/libxml++.h>
33 #include <libcxml/cxml.h>
39 #include "job_manager.h"
40 #include "ab_transcode_job.h"
41 #include "transcode_job.h"
42 #include "scp_dcp_job.h"
44 #include "exceptions.h"
45 #include "examine_content_job.h"
49 #include "ui_signaller.h"
50 #include "analyse_audio_job.h"
53 #include "ffmpeg_content.h"
54 #include "imagemagick_content.h"
55 #include "sndfile_content.h"
56 #include "dcp_content_type.h"
61 using std::stringstream;
74 using boost::shared_ptr;
75 using boost::lexical_cast;
76 using boost::to_upper_copy;
77 using boost::ends_with;
78 using boost::starts_with;
79 using boost::optional;
82 int const Film::state_version = 4;
84 /** Construct a Film object in a given directory, reading any metadata
85 * file that exists in that directory. An exception will be thrown if
86 * must_exist is true and the specified directory does not exist.
88 * @param d Film directory.
89 * @param must_exist true to throw an exception if does not exist.
92 Film::Film (string d, bool must_exist)
93 : _playlist (new Playlist)
94 , _use_dci_name (true)
95 , _trust_content_headers (true)
96 , _dcp_content_type (Config::instance()->default_dcp_content_type ())
97 , _format (Config::instance()->default_format ())
98 , _scaler (Scaler::from_id ("bicubic"))
105 , _with_subtitles (false)
106 , _subtitle_offset (0)
107 , _subtitle_scale (1)
109 , _j2k_bandwidth (200000000)
110 , _dci_metadata (Config::instance()->default_dci_metadata ())
111 , _dcp_video_frame_rate (0)
114 set_dci_date_today ();
116 _playlist->Changed.connect (bind (&Film::playlist_changed, this));
117 _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2));
119 /* Make state.directory a complete path without ..s (where possible)
120 (Code swiped from Adam Bowen on stackoverflow)
123 boost::filesystem::path p (boost::filesystem::system_complete (d));
124 boost::filesystem::path result;
125 for (boost::filesystem::path::iterator i = p.begin(); i != p.end(); ++i) {
127 if (boost::filesystem::is_symlink (result) || result.filename() == "..") {
130 result = result.parent_path ();
132 } else if (*i != ".") {
137 set_directory (result.string ());
139 if (!boost::filesystem::exists (directory())) {
141 throw OpenFileError (directory());
143 boost::filesystem::create_directory (directory());
153 _log.reset (new FileLog (file ("log")));
156 Film::Film (Film const & o)
157 : boost::enable_shared_from_this<Film> (o)
158 /* note: the copied film shares the original's log */
160 , _playlist (new Playlist (o._playlist))
161 , _directory (o._directory)
163 , _use_dci_name (o._use_dci_name)
164 , _trust_content_headers (o._trust_content_headers)
165 , _dcp_content_type (o._dcp_content_type)
166 , _format (o._format)
168 , _filters (o._filters)
169 , _scaler (o._scaler)
170 , _trim_start (o._trim_start)
171 , _trim_end (o._trim_end)
172 , _trim_type (o._trim_type)
174 , _audio_gain (o._audio_gain)
175 , _audio_delay (o._audio_delay)
176 , _with_subtitles (o._with_subtitles)
177 , _subtitle_offset (o._subtitle_offset)
178 , _subtitle_scale (o._subtitle_scale)
179 , _colour_lut (o._colour_lut)
180 , _j2k_bandwidth (o._j2k_bandwidth)
181 , _dci_metadata (o._dci_metadata)
182 , _dcp_video_frame_rate (o._dcp_video_frame_rate)
183 , _dci_date (o._dci_date)
186 _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2));
190 Film::video_state_identifier () const
195 pair<string, string> f = Filter::ffmpeg_strings (filters());
199 << "_" << _playlist->video_digest()
200 << "_" << crop().left << "_" << crop().right << "_" << crop().top << "_" << crop().bottom
201 << "_" << _dcp_video_frame_rate
202 << "_" << f.first << "_" << f.second
203 << "_" << scaler()->id()
204 << "_" << j2k_bandwidth()
205 << "_" << boost::lexical_cast<int> (colour_lut());
208 pair<string, string> fa = Filter::ffmpeg_strings (Config::instance()->reference_filters());
209 s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second;
215 /** @return The path to the directory to write video frame info files to */
217 Film::info_dir () const
219 boost::filesystem::path p;
221 p /= video_state_identifier ();
222 return dir (p.string());
226 Film::internal_video_mxf_dir () const
228 boost::filesystem::path p;
229 return dir ("video");
233 Film::internal_video_mxf_filename () const
235 return video_state_identifier() + ".mxf";
239 Film::dcp_video_mxf_filename () const
241 return filename_safe_name() + "_video.mxf";
245 Film::dcp_audio_mxf_filename () const
247 return filename_safe_name() + "_audio.mxf";
251 Film::filename_safe_name () const
253 string const n = name ();
255 for (size_t i = 0; i < n.length(); ++i) {
256 if (isalnum (n[i])) {
267 Film::audio_analysis_path () const
269 boost::filesystem::path p;
271 p /= _playlist->audio_digest();
272 return file (p.string ());
275 /** Add suitable Jobs to the JobManager to create a DCP for this Film */
279 set_dci_date_today ();
281 if (dcp_name().find ("/") != string::npos) {
282 throw BadSettingError (_("name"), _("cannot contain slashes"));
285 log()->log (String::compose ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary()));
289 gethostname (buffer, sizeof (buffer));
290 log()->log (String::compose ("Starting to make DCP on %1", buffer));
293 // log()->log (String::compose ("Content is %1; type %2", content_path(), (content_type() == STILL ? _("still") : _("video"))));
295 // log()->log (String::compose ("Content length %1", length().get()));
297 // log()->log (String::compose ("Content digest %1", content_digest()));
298 // log()->log (String::compose ("Content at %1 fps, DCP at %2 fps", source_frame_rate(), dcp_frame_rate()));
299 log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads()));
300 log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth()));
301 #ifdef DCPOMATIC_DEBUG
302 log()->log ("DCP-o-matic built in debug mode.");
304 log()->log ("DCP-o-matic built in optimised mode.");
307 log()->log ("libdcp built in debug mode.");
309 log()->log ("libdcp built in optimised mode.");
311 pair<string, int> const c = cpu_info ();
312 log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second));
315 throw MissingSettingError (_("format"));
318 if (_playlist->regions().empty ()) {
319 throw StringError (_("You must add some content to the DCP before creating it"));
322 if (dcp_content_type() == 0) {
323 throw MissingSettingError (_("content type"));
326 if (name().empty()) {
327 throw MissingSettingError (_("name"));
333 r = JobManager::instance()->add (shared_ptr<Job> (new ABTranscodeJob (shared_from_this())));
335 r = JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this())));
339 /** Start a job to analyse the audio in our Playlist */
341 Film::analyse_audio ()
343 if (_analyse_audio_job) {
347 _analyse_audio_job.reset (new AnalyseAudioJob (shared_from_this()));
348 _analyse_audio_job->Finished.connect (bind (&Film::analyse_audio_finished, this));
349 JobManager::instance()->add (_analyse_audio_job);
352 /** Start a job to examine a piece of content */
354 Film::examine_content (shared_ptr<Content> c)
356 shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c, trust_content_headers ()));
357 JobManager::instance()->add (j);
361 Film::analyse_audio_finished ()
365 if (_analyse_audio_job->finished_ok ()) {
366 AudioAnalysisSucceeded ();
369 _analyse_audio_job.reset ();
372 /** Start a job to send our DCP to the configured TMS */
374 Film::send_dcp_to_tms ()
376 shared_ptr<Job> j (new SCPDCPJob (shared_from_this()));
377 JobManager::instance()->add (j);
380 /** Count the number of frames that have been encoded for this film.
381 * @return frame count.
384 Film::encoded_frames () const
391 for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (info_dir ()); i != boost::filesystem::directory_iterator(); ++i) {
393 boost::this_thread::interruption_point ();
399 /** Write state to our `metadata' file */
401 Film::write_metadata () const
403 boost::mutex::scoped_lock lm (_state_mutex);
406 boost::filesystem::create_directories (directory());
409 xmlpp::Element* root = doc.create_root_node ("Metadata");
411 root->add_child("Version")->add_child_text (boost::lexical_cast<string> (state_version));
412 root->add_child("Name")->add_child_text (_name);
413 root->add_child("UseDCIName")->add_child_text (_use_dci_name ? "1" : "0");
414 root->add_child("TrustContentHeaders")->add_child_text (_trust_content_headers ? "1" : "0");
416 if (_dcp_content_type) {
417 root->add_child("DCPContentType")->add_child_text (_dcp_content_type->dci_name ());
421 root->add_child("Format")->add_child_text (_format->id ());
424 switch (_trim_type) {
426 root->add_child("TrimType")->add_child_text ("CPL");
429 root->add_child("TrimType")->add_child_text ("Encode");
432 root->add_child("LeftCrop")->add_child_text (boost::lexical_cast<string> (_crop.left));
433 root->add_child("RightCrop")->add_child_text (boost::lexical_cast<string> (_crop.right));
434 root->add_child("TopCrop")->add_child_text (boost::lexical_cast<string> (_crop.top));
435 root->add_child("BottomCrop")->add_child_text (boost::lexical_cast<string> (_crop.bottom));
437 for (vector<Filter const *>::const_iterator i = _filters.begin(); i != _filters.end(); ++i) {
438 root->add_child("Filter")->add_child_text ((*i)->id ());
441 root->add_child("Scaler")->add_child_text (_scaler->id ());
442 root->add_child("TrimStart")->add_child_text (boost::lexical_cast<string> (_trim_start));
443 root->add_child("TrimEnd")->add_child_text (boost::lexical_cast<string> (_trim_end));
444 root->add_child("AB")->add_child_text (_ab ? "1" : "0");
445 root->add_child("AudioGain")->add_child_text (boost::lexical_cast<string> (_audio_gain));
446 root->add_child("AudioDelay")->add_child_text (boost::lexical_cast<string> (_audio_delay));
447 root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0");
448 root->add_child("SubtitleOffset")->add_child_text (boost::lexical_cast<string> (_subtitle_offset));
449 root->add_child("SubtitleScale")->add_child_text (boost::lexical_cast<string> (_subtitle_scale));
450 root->add_child("ColourLUT")->add_child_text (boost::lexical_cast<string> (_colour_lut));
451 root->add_child("J2KBandwidth")->add_child_text (boost::lexical_cast<string> (_j2k_bandwidth));
452 _dci_metadata.as_xml (root->add_child ("DCIMetadata"));
453 root->add_child("DCPVideoFrameRate")->add_child_text (boost::lexical_cast<string> (_dcp_video_frame_rate));
454 root->add_child("DCIDate")->add_child_text (boost::gregorian::to_iso_string (_dci_date));
455 _playlist->as_xml (root->add_child ("Playlist"));
457 doc.write_to_file_formatted (file ("metadata.xml"));
462 /** Read state from our metadata file */
464 Film::read_metadata ()
466 boost::mutex::scoped_lock lm (_state_mutex);
469 if (boost::filesystem::exists (file ("metadata")) && !boost::filesystem::exists (file ("metadata.xml"))) {
470 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!"));
473 cxml::File f (file ("metadata.xml"), "Metadata");
475 _name = f.string_child ("Name");
476 _use_dci_name = f.bool_child ("UseDCIName");
477 _trust_content_headers = f.bool_child ("TrustContentHeaders");
480 optional<string> c = f.optional_string_child ("DCPContentType");
482 _dcp_content_type = DCPContentType::from_dci_name (c.get ());
487 optional<string> c = f.optional_string_child ("Format");
489 _format = Format::from_id (c.get ());
494 optional<string> c = f.optional_string_child ("TrimType");
495 if (!c || c.get() == "CPL") {
497 } else if (c && c.get() == "Encode") {
502 _crop.left = f.number_child<int> ("LeftCrop");
503 _crop.right = f.number_child<int> ("RightCrop");
504 _crop.top = f.number_child<int> ("TopCrop");
505 _crop.bottom = f.number_child<int> ("BottomCrop");
508 list<shared_ptr<cxml::Node> > c = f.node_children ("Filter");
509 for (list<shared_ptr<cxml::Node> >::iterator i = c.begin(); i != c.end(); ++i) {
510 _filters.push_back (Filter::from_id ((*i)->content ()));
514 _scaler = Scaler::from_id (f.string_child ("Scaler"));
515 _trim_start = f.number_child<int> ("TrimStart");
516 _trim_end = f.number_child<int> ("TrimEnd");
517 _ab = f.bool_child ("AB");
518 _audio_gain = f.number_child<float> ("AudioGain");
519 _audio_delay = f.number_child<int> ("AudioDelay");
520 _with_subtitles = f.bool_child ("WithSubtitles");
521 _subtitle_offset = f.number_child<float> ("SubtitleOffset");
522 _subtitle_scale = f.number_child<float> ("SubtitleScale");
523 _colour_lut = f.number_child<int> ("ColourLUT");
524 _j2k_bandwidth = f.number_child<int> ("J2KBandwidth");
525 _dci_metadata = DCIMetadata (f.node_child ("DCIMetadata"));
526 _dcp_video_frame_rate = f.number_child<int> ("DCPVideoFrameRate");
527 _dci_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate"));
529 _playlist->set_from_xml (f.node_child ("Playlist"));
535 Film::cropped_size (libdcp::Size s) const
537 boost::mutex::scoped_lock lm (_state_mutex);
538 s.width -= _crop.left + _crop.right;
539 s.height -= _crop.top + _crop.bottom;
543 /** Given a directory name, return its full path within the Film's directory.
544 * The directory (and its parents) will be created if they do not exist.
547 Film::dir (string d) const
549 boost::mutex::scoped_lock lm (_directory_mutex);
551 boost::filesystem::path p;
555 boost::filesystem::create_directories (p);
560 /** Given a file or directory name, return its full path within the Film's directory.
561 * _directory_mutex must not be locked on entry.
562 * Any required parent directories will be created.
565 Film::file (string f) const
567 boost::mutex::scoped_lock lm (_directory_mutex);
569 boost::filesystem::path p;
573 boost::filesystem::create_directories (p.parent_path ());
578 /** @return a DCI-compliant name for a DCP of this film */
580 Film::dci_name (bool if_created_now) const
584 string fixed_name = to_upper_copy (name());
585 for (size_t i = 0; i < fixed_name.length(); ++i) {
586 if (fixed_name[i] == ' ') {
591 /* Spec is that the name part should be maximum 14 characters, as I understand it */
592 if (fixed_name.length() > 14) {
593 fixed_name = fixed_name.substr (0, 14);
598 if (dcp_content_type()) {
599 d << "_" << dcp_content_type()->dci_name();
603 d << "_" << format()->dci_name();
606 DCIMetadata const dm = dci_metadata ();
608 if (!dm.audio_language.empty ()) {
609 d << "_" << dm.audio_language;
610 if (!dm.subtitle_language.empty()) {
611 d << "-" << dm.subtitle_language;
617 if (!dm.territory.empty ()) {
618 d << "_" << dm.territory;
619 if (!dm.rating.empty ()) {
620 d << "-" << dm.rating;
626 if (!dm.studio.empty ()) {
627 d << "_" << dm.studio;
630 if (if_created_now) {
631 d << "_" << boost::gregorian::to_iso_string (boost::gregorian::day_clock::local_day ());
633 d << "_" << boost::gregorian::to_iso_string (_dci_date);
636 if (!dm.facility.empty ()) {
637 d << "_" << dm.facility;
640 if (!dm.package_type.empty ()) {
641 d << "_" << dm.package_type;
647 /** @return name to give the DCP */
649 Film::dcp_name (bool if_created_now) const
651 if (use_dci_name()) {
652 return dci_name (if_created_now);
660 Film::set_directory (string d)
662 boost::mutex::scoped_lock lm (_state_mutex);
668 Film::set_name (string n)
671 boost::mutex::scoped_lock lm (_state_mutex);
674 signal_changed (NAME);
678 Film::set_use_dci_name (bool u)
681 boost::mutex::scoped_lock lm (_state_mutex);
684 signal_changed (USE_DCI_NAME);
688 Film::set_trust_content_headers (bool t)
691 boost::mutex::scoped_lock lm (_state_mutex);
692 _trust_content_headers = t;
695 signal_changed (TRUST_CONTENT_HEADERS);
698 Playlist::RegionList regions = _playlist->regions ();
699 if (!_trust_content_headers && !regions.empty()) {
700 /* We just said that we don't trust the content's header */
701 for (Playlist::RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
702 examine_content (i->content);
708 Film::set_dcp_content_type (DCPContentType const * t)
711 boost::mutex::scoped_lock lm (_state_mutex);
712 _dcp_content_type = t;
714 signal_changed (DCP_CONTENT_TYPE);
718 Film::set_format (Format const * f)
721 boost::mutex::scoped_lock lm (_state_mutex);
724 signal_changed (FORMAT);
728 Film::set_crop (Crop c)
731 boost::mutex::scoped_lock lm (_state_mutex);
734 signal_changed (CROP);
738 Film::set_left_crop (int c)
741 boost::mutex::scoped_lock lm (_state_mutex);
743 if (_crop.left == c) {
749 signal_changed (CROP);
753 Film::set_right_crop (int c)
756 boost::mutex::scoped_lock lm (_state_mutex);
757 if (_crop.right == c) {
763 signal_changed (CROP);
767 Film::set_top_crop (int c)
770 boost::mutex::scoped_lock lm (_state_mutex);
771 if (_crop.top == c) {
777 signal_changed (CROP);
781 Film::set_bottom_crop (int c)
784 boost::mutex::scoped_lock lm (_state_mutex);
785 if (_crop.bottom == c) {
791 signal_changed (CROP);
795 Film::set_filters (vector<Filter const *> f)
798 boost::mutex::scoped_lock lm (_state_mutex);
801 signal_changed (FILTERS);
805 Film::set_scaler (Scaler const * s)
808 boost::mutex::scoped_lock lm (_state_mutex);
811 signal_changed (SCALER);
815 Film::set_trim_start (int t)
818 boost::mutex::scoped_lock lm (_state_mutex);
821 signal_changed (TRIM_START);
825 Film::set_trim_end (int t)
828 boost::mutex::scoped_lock lm (_state_mutex);
831 signal_changed (TRIM_END);
835 Film::set_trim_type (TrimType t)
838 boost::mutex::scoped_lock lm (_state_mutex);
841 signal_changed (TRIM_TYPE);
845 Film::set_ab (bool a)
848 boost::mutex::scoped_lock lm (_state_mutex);
855 Film::set_audio_gain (float g)
858 boost::mutex::scoped_lock lm (_state_mutex);
861 signal_changed (AUDIO_GAIN);
865 Film::set_audio_delay (int d)
868 boost::mutex::scoped_lock lm (_state_mutex);
871 signal_changed (AUDIO_DELAY);
875 Film::set_with_subtitles (bool w)
878 boost::mutex::scoped_lock lm (_state_mutex);
881 signal_changed (WITH_SUBTITLES);
885 Film::set_subtitle_offset (int o)
888 boost::mutex::scoped_lock lm (_state_mutex);
889 _subtitle_offset = o;
891 signal_changed (SUBTITLE_OFFSET);
895 Film::set_subtitle_scale (float s)
898 boost::mutex::scoped_lock lm (_state_mutex);
901 signal_changed (SUBTITLE_SCALE);
905 Film::set_colour_lut (int i)
908 boost::mutex::scoped_lock lm (_state_mutex);
911 signal_changed (COLOUR_LUT);
915 Film::set_j2k_bandwidth (int b)
918 boost::mutex::scoped_lock lm (_state_mutex);
921 signal_changed (J2K_BANDWIDTH);
925 Film::set_dci_metadata (DCIMetadata m)
928 boost::mutex::scoped_lock lm (_state_mutex);
931 signal_changed (DCI_METADATA);
936 Film::set_dcp_video_frame_rate (int f)
939 boost::mutex::scoped_lock lm (_state_mutex);
940 _dcp_video_frame_rate = f;
942 signal_changed (DCP_VIDEO_FRAME_RATE);
946 Film::signal_changed (Property p)
949 boost::mutex::scoped_lock lm (_state_mutex);
955 set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ());
962 ui_signaller->emit (boost::bind (boost::ref (Changed), p));
967 Film::set_dci_date_today ()
969 _dci_date = boost::gregorian::day_clock::local_day ();
973 Film::info_path (int f) const
975 boost::filesystem::path p;
980 s << setfill('0') << f << ".md5";
984 /* info_dir() will already have added any initial bit of the path,
985 so don't call file() on this.
991 Film::j2c_path (int f, bool t) const
993 boost::filesystem::path p;
995 p /= video_state_identifier ();
999 s << setfill('0') << f << ".j2c";
1006 return file (p.string ());
1009 /** Make an educated guess as to whether we have a complete DCP
1011 * @return true if we do.
1015 Film::have_dcp () const
1018 libdcp::DCP dcp (dir (dcp_name()));
1028 Film::player () const
1030 boost::mutex::scoped_lock lm (_state_mutex);
1031 return shared_ptr<Player> (new Player (shared_from_this (), _playlist));
1034 shared_ptr<Playlist>
1035 Film::playlist () const
1037 boost::mutex::scoped_lock lm (_state_mutex);
1041 Playlist::RegionList
1042 Film::regions () const
1044 return _playlist->regions ();
1048 Film::add_content (shared_ptr<Content> c)
1051 examine_content (c);
1055 Film::remove_content (shared_ptr<Content> c)
1057 _playlist->remove (c);
1061 Film::length () const
1063 return _playlist->length (shared_from_this ());
1067 Film::has_subtitles () const
1069 return _playlist->has_subtitles ();
1073 Film::best_dcp_video_frame_rate () const
1075 return _playlist->best_dcp_frame_rate ();
1079 Film::playlist_content_changed (boost::weak_ptr<Content> c, int p)
1081 if (p == VideoContentProperty::VIDEO_FRAME_RATE) {
1082 set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ());
1086 ui_signaller->emit (boost::bind (boost::ref (ContentChanged), c, p));
1091 Film::playlist_changed ()
1093 signal_changed (CONTENT);
1099 return _playlist->loop ();
1103 Film::set_loop (int c)
1105 _playlist->set_loop (c);
1109 Film::time_to_audio_frames (Time t) const
1111 return t * dcp_audio_frame_rate () / TIME_HZ;
1115 Film::time_to_video_frames (Time t) const
1117 return t * dcp_video_frame_rate () / TIME_HZ;
1121 Film::audio_frames_to_time (OutputAudioFrame f) const
1123 return f * TIME_HZ / dcp_audio_frame_rate ();
1127 Film::video_frames_to_time (OutputVideoFrame f) const
1129 return f * TIME_HZ / dcp_video_frame_rate ();
1133 Film::dcp_audio_frame_rate () const