summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-03-30 14:02:38 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-03-30 14:02:38 -0400
commit236360d8ffab9f095fcda9e09b159b2a47feb6af (patch)
tree28213beeb3945a7a86278b9a8f878733207019e1
parentb691d4bf04b46059c09e144e34fc58504926ef06 (diff)
parentdeaceb4727effced797ecac67fa55e5eef75b003 (diff)
Merge branch 'master' of git.ardour.org:ardour/ardour
-rw-r--r--gtk2_ardour/add_video_dialog.cc4
-rw-r--r--gtk2_ardour/transcode_ffmpeg.cc26
-rw-r--r--gtk2_ardour/transcode_video_dialog.cc5
3 files changed, 24 insertions, 11 deletions
diff --git a/gtk2_ardour/add_video_dialog.cc b/gtk2_ardour/add_video_dialog.cc
index 7e3c3e853c..7ee43974ca 100644
--- a/gtk2_ardour/add_video_dialog.cc
+++ b/gtk2_ardour/add_video_dialog.cc
@@ -188,10 +188,10 @@ AddVideoDialog::AddVideoDialog (Session* s)
Gtk::Alignment *al = manage(new Gtk::Alignment());
al->set_size_request(-1, 20);
- previewpane->pack_start (*al, false, false);
- previewpane->pack_start (*hbox, true, true, 6);
previewpane->pack_start (*preview_image, false, false);
previewpane->pack_start (seek_slider, false, false);
+ previewpane->pack_start (*al, false, false);
+ previewpane->pack_start (*hbox, true, true, 6);
/* Overall layout */
hbox = manage (new HBox);
diff --git a/gtk2_ardour/transcode_ffmpeg.cc b/gtk2_ardour/transcode_ffmpeg.cc
index e886c64f64..aeabd87a00 100644
--- a/gtk2_ardour/transcode_ffmpeg.cc
+++ b/gtk2_ardour/transcode_ffmpeg.cc
@@ -253,8 +253,8 @@ TranscodeFfmpeg::default_encoder_settings ()
ffs.clear();
ffs["-vcodec"] = "mpeg4";
ffs["-acodec"] = "ac3";
- ffs["-b"] = "5000k";
- ffs["-ab"] = "160k";
+ ffs["-b:v"] = "5000k";
+ ffs["-b:a"] = "160k";
return ffs;
}
@@ -422,7 +422,7 @@ TranscodeFfmpeg::transcode (std::string outfile, const int outw, const int outh,
argp[0] = strdup(ffmpeg_exe.c_str());
argp[1] = strdup("-i");
argp[2] = strdup(infile.c_str());
- argp[3] = strdup("-b");
+ argp[3] = strdup("-b:v");
argp[4] = (char*) calloc(7,sizeof(char)); snprintf(argp[4], 7, "%i0k", bitrate);
argp[5] = strdup("-s");
argp[6] = (char*) calloc(10,sizeof(char)); snprintf(argp[6], 10, "%ix%i", width, height);
@@ -484,10 +484,24 @@ void
TranscodeFfmpeg::ffmpegparse_a (std::string d, size_t /* s */)
{
const char *t;
+ int h,m,s; char f[7];
+ ARDOUR::framecnt_t p = -1;
+
if (!(t=strstr(d.c_str(), "time="))) { return; }
- ARDOUR::framecnt_t f = (ARDOUR::framecnt_t) floorf (atof(t+5) * m_fps);
- if (f > m_duration ) { f = m_duration; }
- Progress(f, m_duration); /* EMIT SIGNAL */
+
+ if (sscanf(t+5, "%d:%d:%d.%s",&h,&m,&s,f) == 4) {
+ p = (ARDOUR::framecnt_t) floor( 100.0 * (
+ h * 3600.0
+ + m * 60.0
+ + s * 1.0
+ + atoi(f) / pow(10, strlen(f))
+ ));
+ p = p * m_fps / 100.0;
+ if (p > m_duration ) { p = m_duration; }
+ Progress(p, m_duration); /* EMIT SIGNAL */
+ } else {
+ Progress(0, 0); /* EMIT SIGNAL */
+ }
}
void
diff --git a/gtk2_ardour/transcode_video_dialog.cc b/gtk2_ardour/transcode_video_dialog.cc
index 8c68b5bca8..5a29d129ae 100644
--- a/gtk2_ardour/transcode_video_dialog.cc
+++ b/gtk2_ardour/transcode_video_dialog.cc
@@ -106,11 +106,10 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
std::string dstfn = video_dest_file(dstdir, infile);
path_entry.set_text (dstfn);
- l = manage (new Label (_("<b>Info</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
+ l = manage (new Label (_("<b>File Information</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_use_markup ();
options_box->pack_start (*l, false, true, 4);
-
bool ffok = false;
if (!transcoder->ffexec_ok()) {
l = manage (new Label (_("No ffprobe or ffmpeg executables could be found on this system. Video Import is not possible until you install those tools. See the Log widow for more information."), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
@@ -176,7 +175,7 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
t->attach (*l, 1, 2, 1, 2);
}
- l = manage (new Label (_("<b>Video</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
+ l = manage (new Label (_("<b>Import Settings</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_use_markup ();
options_box->pack_start (*l, false, true, 4);