-
-
Notifications
You must be signed in to change notification settings - Fork 556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] DNxHD support #1857
Draft
Quackdoc
wants to merge
16
commits into
olive-editor:master
Choose a base branch
from
Quackdoc:DNxHD
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[RFC] DNxHD support #1857
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
321116f
DNxHD gui reworked
Quackdoc b158b80
mxf support
Quackdoc 096193a
hide dnxhd profile
Quackdoc eef46ec
change default to dnxhr_sq, add tooltip
Quackdoc 37ec54e
Merge branch 'olive-editor:master' into DNxHD
Quackdoc 60350bc
Merge branch 'olive-editor:master' into DNxHD
Quackdoc a54ab7b
Merge branch 'olive-editor:master' into DNxHD
Quackdoc a85c44f
Merge branch 'olive-editor:master' into DNxHD
Quackdoc 8c0e608
Merge branch 'olive-editor:master' into DNxHD
Quackdoc 5ee6bb4
Merge branch 'olive-editor:master' into DNxHD
Quackdoc 30c8221
Merge branch 'olive-editor:master' into DNxHD
Quackdoc 2f41588
Merge branch 'olive-editor:master' into DNxHD
Quackdoc 6bbec44
Merge branch 'olive-editor:master' into DNxHD
Quackdoc d3cfd36
Merge branch 'olive-editor:master' into DNxHD
Quackdoc 3e3c324
Merge branch 'olive-editor:master' into DNxHD
Quackdoc fe9ec62
Merge branch 'olive-editor:master' into DNxHD
Quackdoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/*** | ||
Olive - Non-Linear Video Editor | ||
Copyright (C) 2021 Olive Team | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
***/ | ||
|
||
#include "dnxhdsection.h" | ||
|
||
#include <QGridLayout> | ||
#include <QLabel> | ||
|
||
namespace olive { | ||
|
||
DNxHDSection::DNxHDSection(QWidget *parent) : | ||
CodecSection(parent) | ||
{ | ||
QGridLayout *layout = new QGridLayout(this); | ||
|
||
layout->setMargin(0); | ||
|
||
int row = 0; | ||
|
||
layout->addWidget(new QLabel(tr("Profile:")), row, 0); | ||
|
||
preset_combobox_ = new QComboBox(); | ||
|
||
preset_combobox_->setToolTip(tr("While using DNxHD you may need to manually change pixel format. \n\n" | ||
"dnxhr_hqx profile will need you to manually specify pixel format `422p10le` in the advanced menu. \n\n" | ||
"dnxhr_444 profile will need you to manually specify pixel format `444p10le` or `gbrp10le` in the advanced menu.")); | ||
|
||
/* Correspond to the following indexes for FFmpeg | ||
* | ||
*-profile <int> E..V....... (from 0 to 5) (default dnxhd) | ||
* dnxhd 0 E..V....... | ||
* dnxhr_444 5 E..V....... | ||
* dnxhr_hqx 4 E..V....... | ||
* dnxhr_hq 3 E..V....... | ||
* dnxhr_sq 2 E..V....... | ||
* dnxhr_lb 1 E..V....... | ||
* | ||
*/ | ||
|
||
//preset_combobox_->addItem(tr("dnxhd")); | ||
preset_combobox_->addItem(tr("dnxhr_lb")); | ||
preset_combobox_->addItem(tr("dnxhr_sq")); | ||
preset_combobox_->addItem(tr("dnxhr_hq")); | ||
preset_combobox_->addItem(tr("dnxhr_hqx")); | ||
preset_combobox_->addItem(tr("dnxhr_444")); | ||
|
||
|
||
preset_combobox_->setCurrentIndex(1); | ||
|
||
layout->addWidget(preset_combobox_, row, 1); | ||
} | ||
|
||
void DNxHDSection::AddOpts(EncodingParams *params) | ||
{ | ||
params->set_video_option(QStringLiteral("profile"), QString::number(preset_combobox_->currentIndex() + 1)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*** | ||
Olive - Non-Linear Video Editor | ||
Copyright (C) 2021 Olive Team | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
***/ | ||
|
||
#ifndef DNXHDSECTION_H | ||
#define DNXHDSECTION_H | ||
|
||
#include <QComboBox> | ||
|
||
#include "codecsection.h" | ||
|
||
namespace olive { | ||
|
||
class DNxHDSection : public CodecSection | ||
{ | ||
Q_OBJECT | ||
public: | ||
DNxHDSection(QWidget *parent = nullptr); | ||
|
||
virtual void AddOpts(EncodingParams* params) override; | ||
|
||
private: | ||
QComboBox *preset_combobox_; | ||
|
||
}; | ||
|
||
} | ||
|
||
#endif // DNXHDSECTION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do? Is this to ensure a non-zero denominator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh no. That wasn't supposed to make it in, Ill change this back to draft.
but explaining what it is, and what we need it for, we tell the encoder what framerate to use but when writing to an mxf, it also needs to be explicitly told what time_base it's being told to use. this is so that it can ensure interoperability between applications. (one of the reasons people love mxf so much)
just setting
stream->time_base = codec_ctx->time_base
will make any non-supported framerates error out. which isn't a massive issue since nearly all the video framerates that are exposed by default work fine. with the exception of 10fps and 15fps. so this was never supposed to make it in.what WAS supposed to make it in, was a better error message explaining why the encode failed immediately instead of error that pops up now "failed to open file: failed to write format header: Invalid argument -22"
the {0, 1} was debugging crap that was supposed to be removed. but I pushed and old commit by accident. but I suppose this is a good time to ask, would it be better to just report why it failed, or find a way to just show the supported framerates?
I had done a fresh install since the time I worked on this so I lost the code either way. and while I don't think anybody who will export DNxHD will try to export 15 or 10 fps I'm not sure if the error message it currently serves is good enough or not.
EDIT: to be clear, the error gets reported to the terminal perfectly fine as
Unsupported frame rate 15/1. Set -strict option to 'unofficial' or lower in order to allow it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an error message should be sufficient, you can see a similar use case here to inform users that H.264 and H.265 require dimensions to be a multiple of 2: https://github.com/olive-editor/olive/blob/master/app/dialog/export/export.cpp#L357
I think using a similar approach for this limitation would be perfectly fine