fftools/ffmpeg_filter: accept a caller-provided output name

Do not construct it from OutputStream manually.

Will allow decoupling filtering from encoding in future commits.
This commit is contained in:
Anton Khirnov
2024-04-02 11:40:41 +02:00
parent 82c7c21b18
commit da80e0b077
3 changed files with 26 additions and 17 deletions

View File

@@ -1381,8 +1381,10 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
if (ost->enc &&
(type == AVMEDIA_TYPE_VIDEO || type == AVMEDIA_TYPE_AUDIO)) {
char name[16];
OutputFilterOptions opts = {
.enc = enc,
.name = name,
.format = (type == AVMEDIA_TYPE_VIDEO) ?
ost->enc_ctx->pix_fmt : ost->enc_ctx->sample_fmt,
.width = ost->enc_ctx->width,
@@ -1396,6 +1398,8 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
.flags = OFILTER_FLAG_DISABLE_CONVERT * !!keep_pix_fmt,
};
snprintf(name, sizeof(name), "#%d:%d", mux->of.index, ost->index);
// MJPEG encoder exports a full list of supported pixel formats,
// but the full-range ones are experimental-only.
// Restrict the auto-conversion list unless -strict experimental