mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
VTL: refine video-export UI (tooltips, error dialog, etc)
This commit is contained in:
parent
72d5fd248a
commit
1237a4f3bb
1 changed files with 38 additions and 6 deletions
|
|
@ -48,6 +48,7 @@
|
||||||
#include "ardour/session_metadata.h"
|
#include "ardour/session_metadata.h"
|
||||||
|
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/utils.h"
|
||||||
|
#include "widgets/tooltips.h"
|
||||||
|
|
||||||
#include "ardour_message.h"
|
#include "ardour_message.h"
|
||||||
#include "export_video_dialog.h"
|
#include "export_video_dialog.h"
|
||||||
|
|
@ -59,6 +60,7 @@ using namespace Gtk;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
using namespace ArdourWidgets;
|
||||||
using namespace VideoUtils;
|
using namespace VideoUtils;
|
||||||
|
|
||||||
ExportVideoDialog::ExportVideoDialog ()
|
ExportVideoDialog::ExportVideoDialog ()
|
||||||
|
|
@ -74,9 +76,9 @@ ExportVideoDialog::ExportVideoDialog ()
|
||||||
, transcode_button (_("Export"))
|
, transcode_button (_("Export"))
|
||||||
, abort_button (_("Abort"))
|
, abort_button (_("Abort"))
|
||||||
, progress_box (0)
|
, progress_box (0)
|
||||||
, normalize_checkbox (_("Normalize Audio"))
|
, normalize_checkbox (_("Normalize audio"))
|
||||||
, copy_video_codec_checkbox (_("Copy Video Codec"))
|
, copy_video_codec_checkbox (_("Mux only - copy video codec"))
|
||||||
, meta_checkbox (_("Include Session Metadata"))
|
, meta_checkbox (_("Include session metadata"))
|
||||||
, debug_checkbox (_("Debug Mode: Print ffmpeg command and output to stdout."))
|
, debug_checkbox (_("Debug Mode: Print ffmpeg command and output to stdout."))
|
||||||
{
|
{
|
||||||
set_name ("ExportVideoDialog");
|
set_name ("ExportVideoDialog");
|
||||||
|
|
@ -159,7 +161,7 @@ ExportVideoDialog::ExportVideoDialog ()
|
||||||
t->attach (insnd_combo, 1, 2, ty, ty + 1);
|
t->attach (insnd_combo, 1, 2, ty, ty + 1);
|
||||||
ty++;
|
ty++;
|
||||||
|
|
||||||
l = manage (new Label (_("Audio Rate:"), ALIGN_START, ALIGN_CENTER, false));
|
l = manage (new Label (_("Sample rate:"), ALIGN_START, ALIGN_CENTER, false));
|
||||||
t->attach (*l, 0, 1, ty, ty + 1);
|
t->attach (*l, 0, 1, ty, ty + 1);
|
||||||
t->attach (audio_sample_rate_combo, 1, 2, ty, ty + 1);
|
t->attach (audio_sample_rate_combo, 1, 2, ty, ty + 1);
|
||||||
ty++;
|
ty++;
|
||||||
|
|
@ -189,6 +191,12 @@ ExportVideoDialog::ExportVideoDialog ()
|
||||||
progress_box->pack_start (abort_button, false, false);
|
progress_box->pack_start (abort_button, false, false);
|
||||||
get_vbox ()->pack_start (*progress_box, false, false);
|
get_vbox ()->pack_start (*progress_box, false, false);
|
||||||
|
|
||||||
|
set_tooltip (normalize_checkbox, _("<b>When enabled</b>, the audio is normalized to 0dBFS during export."));
|
||||||
|
set_tooltip (copy_video_codec_checkbox, _("<b>When enabled</b>, the video is not re-encoded, but the original video codec is reused. In some cases this can lead to audio/video synchronization issues. This also only works if the exported range is not longer than the video. Adding black space at the start or end requires encoding.\n<b>When disabled</b>, the video is re-encoded, this may lead to quality loss, but this is the safer option and generally preferable."));
|
||||||
|
set_tooltip (meta_checkbox, _("<b>When enabled</b>, information from Menu > Session > Metadata is included in the video file."));
|
||||||
|
set_tooltip (audio_sample_rate_combo, _("Select the sample rate of the audio track. Prefer 48kHz."));
|
||||||
|
set_tooltip (audio_sample_rate_combo, _("Select the bitrate of the audio track in kbit/sec. Higher values result in better quality."));
|
||||||
|
|
||||||
outfn_browse_button.signal_clicked ().connect (sigc::mem_fun (*this, &ExportVideoDialog::open_outfn_dialog));
|
outfn_browse_button.signal_clicked ().connect (sigc::mem_fun (*this, &ExportVideoDialog::open_outfn_dialog));
|
||||||
invid_browse_button.signal_clicked ().connect (sigc::mem_fun (*this, &ExportVideoDialog::open_invid_dialog));
|
invid_browse_button.signal_clicked ().connect (sigc::mem_fun (*this, &ExportVideoDialog::open_invid_dialog));
|
||||||
transcode_button.signal_clicked ().connect (sigc::mem_fun (*this, &ExportVideoDialog::launch_export));
|
transcode_button.signal_clicked ().connect (sigc::mem_fun (*this, &ExportVideoDialog::launch_export));
|
||||||
|
|
@ -484,6 +492,7 @@ ExportVideoDialog::launch_export ()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* clang-format off */
|
||||||
tree.read_buffer (std::string (
|
tree.read_buffer (std::string (
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
"<ExportFormatSpecification name=\"VTL-WAV-16\" id=\"3094591e-ccb9-4385-a93f-c9955ffeb1f0\">"
|
"<ExportFormatSpecification name=\"VTL-WAV-16\" id=\"3094591e-ccb9-4385-a93f-c9955ffeb1f0\">"
|
||||||
|
|
@ -516,6 +525,7 @@ ExportVideoDialog::launch_export ()
|
||||||
" </Processing>"
|
" </Processing>"
|
||||||
"</ExportFormatSpecification>")
|
"</ExportFormatSpecification>")
|
||||||
.c_str ());
|
.c_str ());
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
boost::shared_ptr<ExportFormatSpecification> fmp = _session->get_export_handler ()->add_format (*tree.root ());
|
boost::shared_ptr<ExportFormatSpecification> fmp = _session->get_export_handler ()->add_format (*tree.root ());
|
||||||
|
|
||||||
|
|
@ -559,12 +569,34 @@ ExportVideoDialog::launch_export ()
|
||||||
const sampleoffset_t vend = vstart + ARDOUR_UI::instance ()->video_timeline->get_duration ();
|
const sampleoffset_t vend = vstart + ARDOUR_UI::instance ()->video_timeline->get_duration ();
|
||||||
|
|
||||||
if ((start >= end) || (end < vstart) || (start > vend)) {
|
if ((start >= end) || (end < vstart) || (start > vend)) {
|
||||||
warning << _("Export Video: export-range does not include video.") << endmsg;
|
delete _transcoder;
|
||||||
|
_transcoder = 0;
|
||||||
|
ArdourMessageDialog msg (_("Export Video: The export-range does not include video."));
|
||||||
|
msg.run ();
|
||||||
|
Gtk::Dialog::response (RESPONSE_CANCEL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((start < vstart || end > vend) && copy_video_codec_checkbox.get_active ()) {
|
||||||
|
ArdourMessageDialog msg (
|
||||||
|
_("The export-range is longer than the video file. "
|
||||||
|
"To add black frames the video has to be encoded. "
|
||||||
|
"Copying the codec may fail or not produce the intended result.\n"
|
||||||
|
"Continue anyway?"),
|
||||||
|
false,
|
||||||
|
Gtk::MESSAGE_INFO,
|
||||||
|
Gtk::BUTTONS_YES_NO,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
msg.set_default_response (Gtk::RESPONSE_YES);
|
||||||
|
|
||||||
|
if (msg.run() != Gtk::RESPONSE_YES) {
|
||||||
delete _transcoder;
|
delete _transcoder;
|
||||||
_transcoder = 0;
|
_transcoder = 0;
|
||||||
Gtk::Dialog::response (RESPONSE_CANCEL);
|
Gtk::Dialog::response (RESPONSE_CANCEL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tsp->set_range (start, end);
|
tsp->set_range (start, end);
|
||||||
tsp->set_name ("mysession");
|
tsp->set_name ("mysession");
|
||||||
|
|
@ -734,7 +766,7 @@ ExportVideoDialog::encode_video ()
|
||||||
ffs["-codec:v"] = "copy";
|
ffs["-codec:v"] = "copy";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (audio_bitrate_combo.get_active_text () != _("(default)")) {
|
if (audio_bitrate_combo.get_active_row_number () > 0) {
|
||||||
ffs["-b:a"] = audio_bitrate_combo.get_active_text ();
|
ffs["-b:a"] = audio_bitrate_combo.get_active_text ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue