Skip to content

Conversation

grliszas14
Copy link
Contributor

Resolves: #9174

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

@grliszas14 grliszas14 force-pushed the custom_ffmpeg_dialog branch from 3991b0c to 0f9f891 Compare August 20, 2025 11:45
@grliszas14 grliszas14 marked this pull request as ready for review August 20, 2025 11:48
Copy link
Contributor

@saintmatthieu saintmatthieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A mixture of more or less important comments. (I haven't reviewed the QML part, which @kryksyh is reviewing, so please wait for both approvals before proceeding.)

The thing that we have to clarify is about this modularity. Au3's FFMPEG is a module, meaning we can build Au3 without it, and the app will otherwise function normally.
Here it is not the case: I verified that, setting AU_USE_FFMPEG to OFF yields successful compilation but the export dialog cannot be loaded anymore.

Maybe we don't need modularity for FFMPEG, in which case this PR could be simplified. If we do, however, I recommend that we put it in place now: postponing it can only make it more work later.


bool ExportPreferencesModel::customFFmpegOptionsVisible()
{
return currentFormat() == "Custom FFmpeg Export";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better would be to iterate through ExportFFmpegOptions::fmts to find the one with fmtid == FFmpegExposedFormat::FMT_OTHER.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well... it would but there's the catch: exportpreferencesmodel doesn't know a thing about AU3 code (and we don't want it to) so we cannot just include ExportFFmpegOptions and iterate throught fmts as it's only available within the ExportFFmpegOptions.cpp/h internally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in AU3, this is a translatable string

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.
Could IExporter have a isCustomFfmpegExportFormat(const std::string& format) const method? Au3Exporter would then do the dirty job.

@saintmatthieu
Copy link
Contributor

As discussed in our daily: we do not care that FFMPEG support can be removed from the Audacity 4 binary (the important thing for FFMPEG being that the absence of FFMPEG dynamic libraries should not get Audacity to misbehave). Hence @grliszas14 the #ifdefs can be removed. In the unlikely event that we need this kind of modularity, we'll have to do it properly then.


bool ExportPreferencesModel::customFFmpegOptionsVisible()
{
return currentFormat() == "Custom FFmpeg Export";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in AU3, this is a translatable string

CustomFFmpegPreferencesModel::CustomFFmpegPreferencesModel(QObject* parent)
: QObject(parent)
{
init();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticing this now, sorry: @Eism once warned me that init method (with all the onNotify and onReceived subscriptions) should be called from Component.onCompleted, that these ctor inits caused problems in the past in MSS, can't remember which.
It's also called from the ctor in exportpreferencesmodel.cpp (but it was already like that).
If you want to keep it in the ctor, since I can't remember why it's bad ( :D ) I'll be okay with it, but then the init method doesn't need to be Q_INVOKABLE anymore and could be private.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, fixed for both models

@grliszas14 grliszas14 merged commit 479b936 into audacity:master Sep 3, 2025
5 checks passed
@grliszas14 grliszas14 deleted the custom_ffmpeg_dialog branch September 3, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement custom FFmpeg export
3 participants