fixed #118
This commit is contained in:
@@ -329,8 +329,12 @@ void ExportDialog::prep_ui_for_render(bool rendering) {
|
||||
ui->renderCancel->setEnabled(rendering);
|
||||
}
|
||||
|
||||
void ExportDialog::on_pushButton_clicked()
|
||||
{
|
||||
void ExportDialog::on_pushButton_clicked() {
|
||||
if (ui->widthSpinbox->value()%2 == 1 || ui->heightSpinbox->value()%2 == 1) {
|
||||
QMessageBox::critical(this, "Invalid dimensions", "Export width and height must both be even numbers/divisible by 2.", QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
QString ext;
|
||||
switch (ui->formatCombobox->currentIndex()) {
|
||||
case FORMAT_3GPP:
|
||||
|
||||
+2
-1
@@ -139,6 +139,7 @@ bool ExportThread::setupVideo() {
|
||||
video_frame->width = sequence->width;
|
||||
video_frame->height = sequence->height;
|
||||
av_frame_get_buffer(video_frame, 0);
|
||||
qDebug() << video_frame->linesize[0] << video_frame->linesize[1] << video_frame->linesize[2];
|
||||
|
||||
av_init_packet(&video_pkt);
|
||||
|
||||
@@ -331,7 +332,7 @@ void ExportThread::run() {
|
||||
double timecode_secs = (double) (panel_timeline->playhead-start_frame) / sequence->frame_rate;
|
||||
if (video_enabled) {
|
||||
// get image from opengl
|
||||
glReadPixels(0, 0, sequence->width, sequence->height, GL_RGBA, GL_UNSIGNED_BYTE, video_frame->data[0]);
|
||||
glReadPixels(0, 0, video_frame->linesize[0]/4, sequence->height, GL_RGBA, GL_UNSIGNED_BYTE, video_frame->data[0]);
|
||||
|
||||
// change pixel format
|
||||
sws_scale(sws_ctx, video_frame->data, video_frame->linesize, 0, video_frame->height, sws_frame->data, sws_frame->linesize);
|
||||
|
||||
+2
-2
@@ -332,7 +332,7 @@ void open_clip_worker(Clip* clip) {
|
||||
if (av_frame_get_buffer(clip->cache_A.frames[i], 0)) {
|
||||
qDebug() << "[ERROR] Could not allocate buffer for sws_frame";
|
||||
}
|
||||
clip->cache_A.frames[i]->linesize[0] = dstW*4;
|
||||
// clip->cache_A.frames[i]->linesize[0] = dstW*4;
|
||||
|
||||
clip->cache_B.frames[i] = av_frame_alloc();
|
||||
av_frame_make_writable(clip->cache_B.frames[i]);
|
||||
@@ -342,7 +342,7 @@ void open_clip_worker(Clip* clip) {
|
||||
if (av_frame_get_buffer(clip->cache_B.frames[i], 0)) {
|
||||
qDebug() << "[ERROR] Could not allocate buffer for sws_frame";
|
||||
}
|
||||
clip->cache_B.frames[i]->linesize[0] = dstW*4;
|
||||
// clip->cache_B.frames[i]->linesize[0] = dstW*4;
|
||||
}
|
||||
} else if (clip->stream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
// if FFmpeg can't pick up the channel layout (usually WAV), assume
|
||||
|
||||
@@ -190,7 +190,9 @@ bool get_clip_frame(Clip* c, long playhead) {
|
||||
c->texture->allocateStorage(QOpenGLTexture::RGBA, QOpenGLTexture::UInt8);
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, current_frame->linesize[0]/4);
|
||||
c->texture->setData(0, QOpenGLTexture::RGBA, QOpenGLTexture::UInt8, current_frame->data[0]);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
c->texture_frame = clip_time;
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ GLuint ViewerWidget::compose_sequence(Clip* nest, bool render_audio) {
|
||||
coords.vertexTopRightX = coords.vertexBottomRightX = video_width/2;
|
||||
coords.vertexBottomLeftY = coords.vertexBottomRightY = video_height/2;
|
||||
coords.textureTopLeftY = coords.textureTopRightY = coords.textureTopLeftX = coords.textureBottomLeftX = 0;
|
||||
coords.textureBottomLeftY = coords.textureBottomRightY = coords.textureTopRightX = coords.textureBottomRightX = 1.0;
|
||||
coords.textureBottomLeftY = coords.textureBottomRightY = coords.textureTopRightX = coords.textureBottomRightX = 1.0;
|
||||
|
||||
// EFFECT CODE START
|
||||
for (int j=0;j<c->effects.size();j++) {
|
||||
|
||||
Reference in New Issue
Block a user