summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-03-31 17:02:07 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-03-31 17:02:07 -0400
commitb27a89d1dc4585c3c39196e25dc7948034a37e7d (patch)
treea68a3bdc26884189810abbb604228a86c8c90777 /gtk2_ardour
parent41708d39b9eceb68d27e017291f6eb7c4956c0b3 (diff)
parentb9d22839f12cbac94ddfd5f2ce438d375a3bcdc0 (diff)
Merge branch 'master' of git.ardour.org:ardour/ardour
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/add_video_dialog.cc46
-rw-r--r--gtk2_ardour/export_video_dialog.cc34
-rw-r--r--gtk2_ardour/transcode_ffmpeg.cc54
-rw-r--r--gtk2_ardour/video_timeline.cc9
4 files changed, 92 insertions, 51 deletions
diff --git a/gtk2_ardour/add_video_dialog.cc b/gtk2_ardour/add_video_dialog.cc
index 92e105a870..a7de9d2c33 100644
--- a/gtk2_ardour/add_video_dialog.cc
+++ b/gtk2_ardour/add_video_dialog.cc
@@ -581,57 +581,71 @@ AddVideoDialog::request_preview(std::string u)
const int arc = rint(video_aspect_ratio*100);
switch (arc) {
+ case 100:
+ pi_aspect.set_text(X_(" 1:1")); // square (large format stills)
+ break;
+ case 125:
+ pi_aspect.set_text(X_(" 5:4"));
+ break;
case 133:
- pi_aspect.set_text("4:3");
+ pi_aspect.set_text(X_(" 4:3"));
break;
case 134:
- pi_aspect.set_text("47:35"); // 752x560
+ pi_aspect.set_text(X_(" 47:35")); // 752x560, Super8-scans
+ break;
+ case 137:
+ case 138:
+ pi_aspect.set_text(X_(" 1.37:1")); // 'Academy ratio' <= 1953
break;
case 141:
- pi_aspect.set_text("1.41:1"); // Lichtenberg ratio
+ pi_aspect.set_text(X_(" 1.41:1")); // Lichtenberg ratio
break;
case 150:
- pi_aspect.set_text("3:2"); // classic 35mm
+ pi_aspect.set_text(X_(" 3:2")); // classic 35mm
break;
case 160:
- pi_aspect.set_text("8:5"); // credit-card size
+ pi_aspect.set_text(X_(" 8:5")); // credit-card size
break;
case 162:
- pi_aspect.set_text("16:10"); // golden ratio 1.61803..
+ pi_aspect.set_text(X_(" 16:10")); // golden ratio 1.61803..
break;
case 166:
case 167:
- pi_aspect.set_text("5:3");
+ pi_aspect.set_text(X_(" 5:3")); // Super16, EU-widescreen
break;
case 177:
case 178:
- pi_aspect.set_text("16:9"); // HD video
+ pi_aspect.set_text(X_(" 16:9")); // HD video
break;
case 180:
- pi_aspect.set_text("9:5");
+ pi_aspect.set_text(X_(" 9:5"));
break;
case 185:
- pi_aspect.set_text("1.85:1"); // US widescreen cinema
+ pi_aspect.set_text(X_(" 1.85:1")); // US widescreen cinema
break;
case 200:
- pi_aspect.set_text("2:1");
+ pi_aspect.set_text(X_(" 2:1"));
break;
case 239:
case 240:
- pi_aspect.set_text("2.39:1"); // Anamorphic
+ pi_aspect.set_text(X_(" 2.40:1")); // Anamorphic
+ break;
+ case 266:
+ case 267:
+ pi_aspect.set_text(X_(" 2.66:1")); // CinemaScope
break;
case 275:
- pi_aspect.set_text("2.75:1"); // Ultra Panavision
+ pi_aspect.set_text(X_(" 2.75:1")); // Ultra Panavision
break;
case 400:
- pi_aspect.set_text("4.00:1"); // three 35mm 1.33:1 polyvision
+ pi_aspect.set_text(X_(" 4.00:1")); // three 35mm 1.33:1 polyvision
break;
default:
- pi_aspect.set_text(string_compose("%1:1", video_aspect_ratio));
+ pi_aspect.set_text(string_compose(X_(" %1:1"), video_aspect_ratio));
break;
}
- pi_fps.set_text(string_compose(_("%1 fps"), video_file_fps));
+ pi_fps.set_text(string_compose(_(" %1 fps"), video_file_fps));
clip_xoff = (PREVIEW_WIDTH - clip_width)/2;
clip_yoff = (PREVIEW_HEIGHT - clip_height)/2;
diff --git a/gtk2_ardour/export_video_dialog.cc b/gtk2_ardour/export_video_dialog.cc
index 104a1c5c6d..7491640e39 100644
--- a/gtk2_ardour/export_video_dialog.cc
+++ b/gtk2_ardour/export_video_dialog.cc
@@ -229,7 +229,7 @@ ExportVideoDialog::ExportVideoDialog (PublicEditor& ed, Session* s)
audio_codec_combo.set_name ("PaddedButton");
audio_codec_combo.append_text("ac3");
- audio_codec_combo.append_text("libfaac");
+ audio_codec_combo.append_text("aac");
audio_codec_combo.append_text("libmp3lame");
audio_codec_combo.append_text("libvorbis");
audio_codec_combo.append_text("mp2");
@@ -242,8 +242,9 @@ ExportVideoDialog::ExportVideoDialog (PublicEditor& ed, Session* s)
video_codec_combo.append_text("mjpeg");
video_codec_combo.append_text("mpeg2video");
video_codec_combo.append_text("mpeg4");
- video_codec_combo.append_text("x264 (default)");
+ video_codec_combo.append_text("x264 (baseline)");
video_codec_combo.append_text("x264 (hq)");
+ video_codec_combo.append_text("vpx (webm)");
video_codec_combo.append_text("copy");
video_codec_combo.set_active(4);
@@ -566,19 +567,27 @@ ExportVideoDialog::encode_pass (int pass)
ffs["-b:v"] = video_bitrate_combo.get_active_text();
}
ffs["-b:a"] = audio_bitrate_combo.get_active_text();
+
+ if (audio_codec_combo.get_active_text() == "aac" ) {
+ ffs["-strict"] = "-2";
+ }
+
if (video_codec_combo.get_active_text() == "x264 (hq)" ) {
ffs["-vcodec"] = "libx264";
- ffs["-vpre"] = "slow";
+ ffs["-vprofile"] = "high";
}
- else if (video_codec_combo.get_active_text() == "x264 (default)" ) {
+ else if (video_codec_combo.get_active_text() == "x264 (baseline)" ) {
ffs["-vcodec"] = "libx264";
- ffs["-vpre"] = "medium";
+ ffs["-vpre"] = "baseline";
+ }
+ else if (video_codec_combo.get_active_text() == "vpx (webm)" ) {
+ ffs["-vcodec"] = "libvpx";
+ ffs["-g"] = "120";
+ ffs["-qmin"] = "11";
+ ffs["-qmax"] = "51";
}
if (optimizations_checkbox.get_active()) {
- /* TODO: define these smartly in a header-file so that they can be
- * merged for printing as label and used here easyly
- */
if (video_codec_combo.get_active_text() == "mpeg2video") {
ffs["-mbd"] = "rd";
ffs["-trellis"] = "2";
@@ -587,7 +596,7 @@ ExportVideoDialog::encode_pass (int pass)
}
else if (video_codec_combo.get_active_text() == "mpeg4") {
ffs["-mbd"] = "rd";
- ffs["-flags"] = "+4mv+aic";
+ ffs["-flags"] = "+mv4+aic";
ffs["-trellis"] = "2";
ffs["-cmp"] = "2";
ffs["-subcmp"] = "2";
@@ -603,7 +612,10 @@ ExportVideoDialog::encode_pass (int pass)
}
}
- if (bframes_checkbox.get_active()) {
+ if (bframes_checkbox.get_active() && (
+ video_codec_combo.get_active_text() == "mpeg2video"
+ || video_codec_combo.get_active_text() == "mpeg4"
+ )) {
ffs["-bf"] = "2";
}
@@ -757,7 +769,7 @@ ExportVideoDialog::video_codec_combo_changed ()
if (video_codec_combo.get_active_text() == "mpeg2video") {
optimizations_label.set_text("-mbd rd -trellis 2 -cmp 2 -subcmp 2"); // mpeg2
} else if (video_codec_combo.get_active_text() == "mpeg4") {
- optimizations_label.set_text("-mbd rd -flags +4mv+aic -trellis 2 -cmp 2 -subcmp 2 -g 300"); // mpeg4
+ optimizations_label.set_text("-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300"); // mpeg4
} else {
optimizations_label.set_text("-mbd 2 -cmp 2 -subcmp 2 -trellis 2 -flags +aic+mv0+mv4 -g 160"); // flv
}
diff --git a/gtk2_ardour/transcode_ffmpeg.cc b/gtk2_ardour/transcode_ffmpeg.cc
index aeabd87a00..5ae9ae1c20 100644
--- a/gtk2_ardour/transcode_ffmpeg.cc
+++ b/gtk2_ardour/transcode_ffmpeg.cc
@@ -117,19 +117,20 @@ TranscodeFfmpeg::probe ()
std::vector<std::vector<std::string> > lines;
ParseCSV(ffoutput, lines);
+ double timebase = 0;
m_width = m_height = 0;
m_fps = m_aspect = 0;
m_duration = 0;
m_codec.clear();
m_audio.clear();
-#define PARSE_FRACTIONAL_FPS \
+#define PARSE_FRACTIONAL_FPS(VAR) \
{ \
std::string::size_type pos; \
- m_fps = atof(value.c_str()); \
+ VAR = atof(value.c_str()); \
pos = value.find_first_of('/'); \
if (pos != std::string::npos) { \
- m_fps = atof(value.substr(0, pos).c_str()) / atof(value.substr(pos+1).c_str()); \
+ VAR = atof(value.substr(0, pos).c_str()) / atof(value.substr(pos+1).c_str()); \
} \
}
@@ -160,9 +161,11 @@ TranscodeFfmpeg::probe ()
if (!m_codec.empty()) m_codec += " ";
m_codec += "(" + value + ")";
} else if (key == X_("r_frame_rate")) {
- PARSE_FRACTIONAL_FPS
- } else if (key == X_("time_base") && m_fps == 0) {
- PARSE_FRACTIONAL_FPS
+ PARSE_FRACTIONAL_FPS(m_fps)
+ } else if (key == X_("avg_frame_rate") && m_fps == 0) {
+ PARSE_FRACTIONAL_FPS(m_fps)
+ } else if (key == X_("time_base")) {
+ PARSE_FRACTIONAL_FPS(timebase)
} else if (key == X_("timecode") && m_duration == 0) {
int h,m,s; char f[7];
if (sscanf(i->at(16).c_str(), "%d:%d:%d:%s",&h,&m,&s,f) == 4) {
@@ -173,9 +176,9 @@ TranscodeFfmpeg::probe ()
+ atoi(f) / pow(10, strlen(f))
));
}
- } else if (key == X_("duration_ts")) {
- m_duration = atof(value.c_str());
- } else if (key == X_("duration") && m_duration == 0 && m_fps != 0) {
+ } else if (key == X_("duration_ts") && m_fps == 0 && timebase !=0 ) {
+ m_duration = atof(value.c_str()) * m_fps * timebase;
+ } else if (key == X_("duration") && m_fps != 0 && m_duration == 0) {
m_duration = atof(value.c_str()) * m_fps;
} else if (key == X_("display_aspect_ratio")) {
std::string::size_type pos;
@@ -357,23 +360,26 @@ TranscodeFfmpeg::extract_audio (std::string outfile, ARDOUR::framecnt_t samplera
if (stream >= m_audio.size()) return false;
char **argp;
+ int i = 0;
argp=(char**) calloc(15,sizeof(char*));
- argp[0] = strdup(ffmpeg_exe.c_str());
- argp[1] = strdup("-i");
- argp[2] = strdup(infile.c_str());
- argp[3] = strdup("-ar");
- argp[4] = (char*) calloc(7,sizeof(char)); snprintf(argp[4], 7, "%"PRId64, samplerate);
- argp[5] = strdup("-ac");
- argp[6] = (char*) calloc(3,sizeof(char)); snprintf(argp[6], 3, "%i", m_audio.at(stream).channels);
- argp[7] = strdup("-map");
- argp[8] = (char*) calloc(8,sizeof(char)); snprintf(argp[8], 8, "0:%s", m_audio.at(stream).stream_id.c_str());
- argp[9] = strdup("-vn");
- argp[10] = strdup("-acodec");
- argp[11] = strdup("pcm_f32le");
- argp[12] = strdup("-y");
- argp[13] = strdup(outfile.c_str());
- argp[14] = (char *)0;
+ argp[i++] = strdup(ffmpeg_exe.c_str());
+ argp[i++] = strdup("-i");
+ argp[i++] = strdup(infile.c_str());
+#if 0 // native samplerate -- use a3/SRC
+ argp[i++] = strdup("-ar");
+ argp[i] = (char*) calloc(7,sizeof(char)); snprintf(argp[i++], 7, "%"PRId64, samplerate);
+#endif
+ argp[i++] = strdup("-ac");
+ argp[i] = (char*) calloc(3,sizeof(char)); snprintf(argp[i++], 3, "%i", m_audio.at(stream).channels);
+ argp[i++] = strdup("-map");
+ argp[i] = (char*) calloc(8,sizeof(char)); snprintf(argp[i++], 8, "0:%s", m_audio.at(stream).stream_id.c_str());
+ argp[i++] = strdup("-vn");
+ argp[i++] = strdup("-acodec");
+ argp[i++] = strdup("pcm_f32le");
+ argp[i++] = strdup("-y");
+ argp[i++] = strdup(outfile.c_str());
+ argp[i++] = (char *)0;
/* Note: argp is free()d in ~SystemExec */
#if 1 /* DEBUG */
if (debug_enable) { /* tentative debug mode */
diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc
index 9460632e6c..24d8f8ebcc 100644
--- a/gtk2_ardour/video_timeline.cc
+++ b/gtk2_ardour/video_timeline.cc
@@ -163,6 +163,10 @@ VideoTimeLine::close_session ()
video_filename = "";
video_duration = 0;
GuiUpdate("set-xjadeo-sensitive-off");
+ if (open_video_monitor_dialog) {
+ delete open_video_monitor_dialog;
+ }
+ open_video_monitor_dialog = 0;
}
/** load settings from session */
@@ -216,6 +220,11 @@ VideoTimeLine::set_session (ARDOUR::Session *s)
video_file_info(propf->value(), local_file);
}
+ if (open_video_monitor_dialog) {
+ delete open_video_monitor_dialog;
+ }
+ open_video_monitor_dialog = 0;
+
node = _session->extra_xml (X_("Videomonitor"));
if (node) {
const XMLProperty* prop = node->property (X_("active"));