Skip to content
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

Multiple options are ignored with --stdin ("Trailing options with update suffix has no effect") using --output #2572

Open
gitoss opened this issue Jan 15, 2025 · 3 comments · May be fixed by #2574

Comments

@gitoss
Copy link

gitoss commented Jan 15, 2025

This is an extension of #2504 - but as a newer ticket because the problem is much more broader.

I guess the cause of this is the change to "The following options can optionally have a :u (or :update) suffix like -q:u Q, to apply only to input files appearing after the option:"

As a result, all affected options (--qcolor, --qalpha, ... --advanced) are ignored when there is no input file at all - i.e. --stdin. To reproduce:

  1. Get some animated input file like https://jpegxl.info/images/anim-icos.gif

2a. ffmpeg -loglevel quiet -i anim-icos.gif -pix_fmt yuv444p -f yuv4mpegpipe anim-icos.y4m
2b. avifenc --codec aom --speed 4 --qcolor 90 --advanced deltaq-mode=4 anim-icos.y4m --output anim-icos.avif

Successfully loaded: anim-icos.y4m
AVIF to be written: (Lossy)
 * Resolution     : 128x128
 * Bit Depth      : 8
 * Format         : YUV444
 * Alpha          : Absent
 * Range          : Limited
 * Color Primaries: 1
 * Transfer Char. : 13
 * Matrix Coeffs. : 6
 * ICC Profile    : Absent
 * XMP Metadata   : Absent
 * Exif Metadata  : Absent
 * Transformations: None
 * Progressive    : Unavailable
 * Gain map       : Absent
Encoding with initial settings: codec 'aom' speed [4], color quality [90 (High)], alpha quality [90 (High)], tileRowsLog2 [0], tileColsLog2 [0], 12 worker thread(s), please wait...
 * Encoding frame 1 [1/20 ts] color quality [90 (High)], alpha quality [90 (High)]: anim-icos.y4m

=> please note: if you change to deltaq-mode=6 there's an error from aom

  1. ffmpeg -loglevel quiet -i anim-icos.gif -pix_fmt yuv444p -f yuv4mpegpipe - | avifenc --codec aom --qcolor 90 --advanced deltaq-mode=4 --stdin --output anim-icos.avif
**WARNING: Trailing options with update suffix has no effect. Place them before the input you intend to apply to.**
AVIF to be written: (Lossy)
 * Resolution     : 128x128
 * Bit Depth      : 8
 * Format         : YUV444
 * Alpha          : Absent
 * Range          : Limited
 * Color Primaries: 1
 * Transfer Char. : 13
 * Matrix Coeffs. : 6
 * ICC Profile    : Absent
 * XMP Metadata   : Absent
 * Exif Metadata  : Absent
 * Transformations: None
 * Progressive    : Unavailable
 * Gain map       : Absent
Encoding with initial settings: codec 'aom' speed [6], color quality [-1 (Low)], alpha quality [-1 (Low)], tileRowsLog2 [0], tileColsLog2 [0], 12 worker thread(s), please wait...
 * Encoding frame 0 [1/20 ts] color quality [-1 (Low)], alpha quality [-1 (Low)]: (stdin)

=> please note: if you change to deltaq-mode=6 there's NO error because --advanced are ignored!

I've tried putting --stdin at different positions or (not) using --output, but to no avail - the cause is using --stdin at all.

@gitoss gitoss changed the title Multiple options are ignored with --stdin ("Trailing options with update suffix has no effect") Multiple options are ignored with --stdin ("Trailing options with update suffix has no effect") => piping is nearly broken Jan 15, 2025
@y-guyon
Copy link
Collaborator

y-guyon commented Jan 16, 2025

I can reproduce the issue. Omitting --output before anim-icos.avif seems to fix this specific pattern:

avifenc --codec aom --speed 9 --qcolor 90 --advanced deltaq-mode=4 --stdin anim-icos.avif
# ERROR: Failed to encode image: Invalid codec-specific option

@gitoss
Copy link
Author

gitoss commented Jan 16, 2025

I can reproduce the issue. Omitting --output before anim-icos.avif seems to fix this specific pattern:

This seems to work, but even without using --output I'm stil getting the "WARNING: Trailing options with update suffix has no effect. Place them before the input you intend to apply to." - is this just cosmetic?

If it's only about using the optonal --output or -o that would explain why it seems so few users have seen this bug yet.

@gitoss gitoss changed the title Multiple options are ignored with --stdin ("Trailing options with update suffix has no effect") => piping is nearly broken Multiple options are ignored with --stdin ("Trailing options with update suffix has no effect") using --output Jan 16, 2025
@y-guyon
Copy link
Collaborator

y-guyon commented Jan 16, 2025

even without using --output I'm stil getting the "WARNING: Trailing options with update suffix has no effect. Place them before the input you intend to apply to." - is this just cosmetic?

Maybe. There is a deeper issue with how --stdin is implemented anyway.

I am drafting a PR to treat --stdin as a regular file name input.

@y-guyon y-guyon linked a pull request Jan 17, 2025 that will close this issue
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 a pull request may close this issue.

2 participants