kokorin / Jaffree

______ Stop the War in Ukraine! _______ Java ffmpeg and ffprobe command-line wrapper
Apache License 2.0
471 stars 80 forks source link

MacOS builds fail on FFmpegTest.testSizeLimit() #357

Closed marklassau closed 1 year ago

marklassau commented 1 year ago

Describe the issue Currently the FFmpegTest.testSizeLimit() test is failing on MacOS eg https://github.com/kokorin/Jaffree/actions/runs/6115449761/job/16598997719?pr=356

To Reproduce Steps to reproduce the behavior:

  1. Run FFmpegTest.testSizeLimit() on MacOS with ffmpeg v 6.0

Logs

Error: -07 22:41:52,366 ERROR c.g.k.j.p.BaseStdReader@[StdErr] - [out#0/mp4 @ 0x7fd840115c80] [error] Error muxing a packet
...
2023-09-07 22:41:52,369 INFO  c.g.k.j.p.ProcessHandler@[main] - Process has finished with status: 187
...
com.github.kokorin.jaffree.process.JaffreeAbnormalExitException: Process execution has ended with non-zero status: 187. Check logs for detailed error message.
    at com.github.kokorin.jaffree.process.ProcessHandler.interactWithProcess(ProcessHandler.java:218)
    at com.github.kokorin.jaffree.process.ProcessHandler.execute(ProcessHandler.java:160)
    at com.github.kokorin.jaffree.ffmpeg.FFmpeg.execute(FFmpeg.java:415)
    at com.github.kokorin.jaffree.ffmpeg.FFmpegTest.testSizeLimit(FFmpegTest.java:389)

Additional context This is not a bug in Jaffree - this is a bug in ffmpeg v6.0 as installed by brew install ffmpeg in the tests.

AFAICT the bug is reported and fixed in ffmpeg: https://trac.ffmpeg.org/ticket/10327

But the version installed during the MacOS tests by brew install ffmpeg is currently broken.

I can get all tests to run successfully if I downgrade ffmpeg to v5.1.3 using brew install ffmpeg@5

Suggested Fix This problem should eventually go away once homebrew exposes a newer version of ffmpeg with the fix included. Given that it was fixed 5 months ago, and we haven't seen an update yet suggests it might be a long wait :(

However, if we want the tests to go green in the meantime there are a couple of approaches we could take:

1) Temporarily run the MacOS tests against ffmpeg v5.x 2) Put some logic into the failing test to detect the ffmpeg error message and in this case set the test to Ignored

marklassau commented 1 year ago

FYI if you follow the link from https://ffmpeg.org/download.html#build-mac to https://evermeet.cx/ffmpeg/

You will find a snapshot version built on 2023-09-05 that works fine and "6.0" version built on 2023-02-28 that is broken.

marklassau commented 1 year ago

I put up a PR that uses approach 2) to skip the test if it detects the ffmpeg bug: https://github.com/kokorin/Jaffree/pull/358