string
TranscodeJob::name () const
{
- stringstream s;
- s << "Transcode " << _fs->name;
- return s.str ();
+ return String::compose ("Transcode %1", _fs->name);
}
void
} catch (std::exception& e) {
- stringstream s;
set_progress (1);
set_state (FINISHED_ERROR);
-
- s << "Transcode job failed (" << e.what() << ")";
- _log->log (s.str ());
+ _log->log (String::compose ("Transcode job failed (%1)", e.what()));
throw;
-
}
}
if (!_encoder) {
return "0%";
}
+
+ if (_encoder->skipping () && !finished ()) {
+ return "skipping already-encoded frames";
+ }
+
float const fps = _encoder->current_frames_per_second ();
if (fps == 0) {
return Job::status ();
}
-
+
stringstream s;
- s << Job::status () << "; about " << fixed << setprecision (1) << fps << " frames per second.";
+
+ s << Job::status () << "; " << fixed << setprecision (1) << fps << " frames per second";
return s.str ();
}
+
+int
+TranscodeJob::remaining_time () const
+{
+ float fps = _encoder->current_frames_per_second ();
+ if (fps == 0) {
+ return 0;
+ }
+
+ return ((_fs->dcp_length() - _encoder->last_frame()) / fps);
+}