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

Can't convert JPG to AVIF on v1.1.1 using SVT-AV1-PSY with speed = 0 #84

Open
ru-bem opened this issue Jan 14, 2025 · 6 comments
Open
Labels
bug Something isn't working third-party issue An issue with third-party dependencies, not with the project itself

Comments

@ru-bem
Copy link

ru-bem commented Jan 14, 2025

Version

1.1.1

OS

Windows

Description

Can't convert JPG to AVIF using SVT-AV1-PSY with speed = 0
Everything is working fine when using AOM AV1

Steps to Reproduce

  • Any jpg image
  • AVIF bit depth: Any
  • AVIF Encoder: SVT-AV1-PSY
  • Format: AVIF
  • Speed: 0

Expected Result

The file should be converted at the end of the process.

Current Result

Exceptions Occured
ID: C3
Exception: avifenc.exe
Source: image.jpg

Input Formats

JPG

Output Format

AVIF

Additional Information (Optional)

image

@ru-bem ru-bem changed the title Can't convert JPG to AVIF on v1.1.1 using SVT-AV1-PSY with speed = 0 Can't convert JPG to AVIF on v1.1.1 using SVT-AV1-PSY with speed = 0 or 1 Jan 14, 2025
@ru-bem ru-bem changed the title Can't convert JPG to AVIF on v1.1.1 using SVT-AV1-PSY with speed = 0 or 1 Can't convert JPG to AVIF on v1.1.1 using SVT-AV1-PSY with speed = 0 Jan 14, 2025
@JacobDev1
Copy link
Owner

Does this occur with every JPEG image or just particular ones? Does it work correctly with other speed values?

I had no luck reproducing this bug.

@ru-bem
Copy link
Author

ru-bem commented Jan 14, 2025

This happens with any .jpg but it works normal when using any other extension like .jpeg .png...
Using speed 1 bugs sometimes. Using speed 2 or more works fine.

@JacobDev1
Copy link
Owner

Update: I was able to reproduce this bug.

Steps to reproduce:

  1. Launch the Windows version.
  2. Add a single JPEG image (no more).
  3. Set Threads to maximum.
  4. Keep pressing the Convert button until the bug occurs (it does not occur every time).

This seems like a bug in the encoder. The previous version seems fine. I wonder if it can be reproduced through avifenc alone.

As a temporary workaround, you can copy the encoder from the older version. The encoder is located in xl-converter/_internal/bin/win/libavif/.

@JacobDev1 JacobDev1 added bug Something isn't working third-party issue An issue with third-party dependencies, not with the project itself labels Jan 14, 2025
@JacobDev1
Copy link
Owner

I'm not able to reproduce it with just avifenc alone using identical options. The problem is the encoder crashes with no stderr.

Sometimes, binaries get unstable when run in subprocess.run in a QRunnable. One example is in #44 .

@Uranite
Copy link

Uranite commented Jan 15, 2025

svt-av1-psy v2.3.0-A has a bug where it crashes on at least preset 7 and lower on 8 bit: psy-ex/svt-av1-psy#115
We should downgrade svt-av1-psy to v2.3.0
Or alternatively, make 10 bit the default by adding -d 10 to libavif

@JacobDev1
Copy link
Owner

Hi @Uranite thanks for the info.

For me, it also happens with -d 10 and only at very low speed values. Lowering thread count by one is another workaround that makes it occur less often.

I tried writing a minimal reproducible example in PySide6, but could not get the encoder to behave similarly.

Debugging this issue will be difficult. The most reliable way of reproducing it is to setup this project. It's hard to say if this bug is related to psy-ex/svt-av1-psy#115 or an entirely separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working third-party issue An issue with third-party dependencies, not with the project itself
Projects
None yet
Development

No branches or pull requests

3 participants