-
Notifications
You must be signed in to change notification settings - Fork 370
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
Logging can't be disabled #711
Comments
Hey! I faced same issue, anyone know how to fix it? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Let's keep this issue alive, the logging framework is due for an overhaul. |
Are the logging levels flipped? I've been getting some ffmpeg logs that I wanted to silence to avoid spamming the console but I'm seeing some weird behavior.
|
Update on this for my tests:
|
I'd still love to see this fixed, though I'm not sure I'll have time to do it myself. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm trying to use PyAV to mux a lot of video, so I want to disable the log as below: x265 [info]: HEVC encoder version 3.5+1-f0c1022b6
x265 [info]: build info [Linux][GCC 10.2.1][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 16 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 4 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias : 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : ABR-1024 kbps / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing lslices=6 deblock sao
encoded 0 frames I have tried the methods in https://pyav.org/docs/develop/api/utils.html, but the log still exists. And I find this line in the doc:
I think this log may be produced by ffmpeg. How can I disable it? Thank you very much. |
same issue. mark |
I implemented a "dirty" workaround in PR #1133. It's obviously a proper solution, so if someone can figure out how to implement a proper fix, feel free to ignore my PR =) |
Another workaround is to close stderr, given that your application does not write other information to it. import os
import av
os.close(2)
av.logging.restore_default_callback() |
A slightly cleaner workaround is to pass arguments to ffmpeg itself to disable logging. This got rid of the chatty h265 encoder messages for me while leaving stderr untouched. For example:
|
If you're still looking for a workaround, updating the log level to a higher one worked for us More info here: https://pyav.org/docs/stable/api/utils.html logging.getLogger("libav").setLevel(logging.FATAL) Also they suggest to set this env variable to
|
You can disable logs now in master. In fact, it's the default behaviour now. import av
# turn off logs
av.logging.set_level(None)
# turn on logs
av.logging.set_level(av.logging.VERBOSE) |
@WyattBlue should I close this then? |
Overview
I want to shut up any logging from
av
and underlyingffmpeg
. I tried all of this:Btw, docs said there is
av.logging.QUIET
, but it missed.Expected behavior
No logs.
Actual behavior
I encode video frame by frame. I see tons of almost equal output like this:
Versions
pip installed
Research
I have done the following:
The text was updated successfully, but these errors were encountered: