This commit is contained in:
itsmattkc
2018-07-13 20:43:17 +01:00
parent 67944b4c2d
commit fdc9506eb3
4 changed files with 30 additions and 11 deletions
+25 -8
View File
@@ -435,6 +435,7 @@ void ExportDialog::on_pushButton_clicked()
break;
default:
qDebug() << "[ERROR] Invalid format - this is a bug, please inform the developers";
QMessageBox::critical(this, "Invalid format", "Couldn't determine output format. This is a bug, please contact the developers.", QMessageBox::Ok);
return;
}
QString filename = QFileDialog::getSaveFileName(this, "Export Media", "", format_strings[ui->formatCombobox->currentIndex()] + " (*." + ext + ")");
@@ -442,6 +443,18 @@ void ExportDialog::on_pushButton_clicked()
if (!filename.endsWith("." + ext, Qt::CaseInsensitive)) {
filename += "." + ext;
}
if (ui->formatCombobox->currentIndex() == FORMAT_IMG) {
int ext_location = filename.lastIndexOf('.');
if (ext_location > filename.lastIndexOf('/')) {
filename.insert(ext_location, 'd');
filename.insert(ext_location, '5');
filename.insert(ext_location, '0');
filename.insert(ext_location, '%');
}
}
et = new ExportThread();
et->surface.create();
@@ -460,15 +473,19 @@ void ExportDialog::on_pushButton_clicked()
et->filename = filename;
et->video_enabled = ui->videoGroupbox->isChecked();
et->video_codec = format_vcodecs.at(ui->vcodecCombobox->currentIndex());
et->video_width = ui->widthSpinbox->value();
et->video_height = ui->heightSpinbox->value();
et->video_frame_rate = ui->framerateSpinbox->value();
et->video_bitrate = ui->videobitrateSpinbox->value();
if (et->video_enabled) {
et->video_codec = format_vcodecs.at(ui->vcodecCombobox->currentIndex());
et->video_width = ui->widthSpinbox->value();
et->video_height = ui->heightSpinbox->value();
et->video_frame_rate = ui->framerateSpinbox->value();
et->video_bitrate = ui->videobitrateSpinbox->value();
}
et->audio_enabled = ui->audioGroupbox->isChecked();
et->audio_codec = format_acodecs.at(ui->acodecCombobox->currentIndex());
et->audio_sampling_rate = 48000;
et->audio_bitrate = ui->audiobitrateSpinbox->value();
if (et->audio_enabled) {
et->audio_codec = format_acodecs.at(ui->acodecCombobox->currentIndex());
et->audio_sampling_rate = 48000;
et->audio_bitrate = ui->audiobitrateSpinbox->value();
}
et->ed = this;
cancelled = false;
+2 -2
View File
@@ -158,7 +158,7 @@ void ExportThread::run() {
AV_PIX_FMT_RGBA,
video_width,
video_height,
AV_PIX_FMT_YUV420P,
vcodec_ctx->pix_fmt,
SWS_FAST_BILINEAR,
NULL,
NULL,
@@ -166,7 +166,7 @@ void ExportThread::run() {
);
sws_frame = av_frame_alloc();
sws_frame->format = AV_PIX_FMT_YUV420P;
sws_frame->format = vcodec_ctx->pix_fmt;
sws_frame->width = video_frame->width;
sws_frame->height = video_frame->height;
av_frame_get_buffer(sws_frame, 0);
+2
View File
@@ -359,6 +359,8 @@ void MainWindow::on_action_Open_Project_triggered()
void MainWindow::on_actionProject_triggered()
{
if (can_close_project()) {
project_url.clear();
project_changed = false;
panel_project->new_project();
}
}
+1 -1
View File
@@ -269,7 +269,7 @@ void Project::process_file_list(QStringList& files) {
// heuristic to determine whether file is part of an image sequence
int lastcharindex = file.lastIndexOf(".")-1;
if (lastcharindex == -2) {
if (lastcharindex == -2 || lastcharindex <= file.lastIndexOf('/')) {
lastcharindex = file.length() - 1;
}
if (file[lastcharindex].isDigit()) {