proxy: per-footage presets, audio in proxies, configurable ffmpeg path

- Footage can store custom proxy parameters (width/height/crf/preset/
  extension/audio) that override the global settings; they are
  serialized with the project and used by every generation entry point
  via Footage::GetEffectiveProxyParams()
- Proxies now include the source audio streams (AAC) unless disabled;
  the proxy filename records the audio flag and offline audio rendering
  decodes from the proxy when present
- ProxyTask resolves ffmpeg from the new FFmpegPath config key first,
  then PATH, then common install locations (e.g. Homebrew on macOS),
  instead of relying on PATH only; the error message points at the
  preferences when no executable is found
- ProxyTask::BuildArguments() is extracted for testability
- Add ProxyIncludeAudio and FFmpegPath config defaults
- Add regression tests for the filename audio marker, config-backed
  params, ffmpeg resolution, argument building, and custom-param
  persistence
This commit is contained in:
2026-07-16 22:31:37 +08:00
parent 15525528c9
commit 6aaf37e2e5
11 changed files with 506 additions and 38 deletions
+22
View File
@@ -66,6 +66,7 @@ public:
QString extension = QStringLiteral("mp4");
int crf = 23;
QString preset = QStringLiteral("veryfast");
bool include_audio = true;
};
struct Proxy {
@@ -89,6 +90,27 @@ public:
static ProxyState ProxyStateFromString(const QString &state);
/**
* @brief Returns true if a proxy filename generated by GetProxyFilename()
* indicates the proxy contains audio streams
*/
static bool ProxyFilenameHasAudio(const QString &proxy_filename);
/**
* @brief Builds proxy parameters from the global application config
*/
static ProxyParams ProxyParamsFromConfig();
/**
* @brief Locates an ffmpeg executable for proxy generation
*
* Resolution order: the explicitly configured path (if non-empty and an
* existing executable file), then the system PATH, then common
* platform-specific install locations. Returns an empty string if no
* executable could be found.
*/
static QString FindFFmpegExecutable(const QString &configured_path);
Proxy GetOrStartProxy(const QString &cache_path,
const QString &source_filename, int stream_index,
const ProxyParams &params);