cainmagi / FFmpeg-Encoder-Decoder-for-Python

This is a C++ based FFmpeg Encoder/Decoder for Python 3.6+ & numpy 1.19+. Both Linux & Win versions are provided. Theoretically you do not need to install FFmpeg for using this library.
https://cainmagi.github.io/FFmpeg-Encoder-Decoder-for-Python/
GNU General Public License v3.0
35 stars 7 forks source link

[Feature] Loglevel silent everything #8

Open jhd-old opened 1 year ago

jhd-old commented 1 year ago

Get started

Problem

First of all, thank you very much for this amazing library!

Everything works great, but my console will be flooded at every start of the stream with following errors: [h264 @ 000001e5995c6340] no frame! [h264 @ 000001e5995c6340] non-existing PPS 0 referenced

After a few seconds everything works fine. But it would be fine to be able to dump every log (including the errors).

Required feature

My suggestion would be to add another dumplevel:

This value could be -1 (show nothing), 0 (only show errors), 1 (show basic logs), 2 (show detailed logs).

Which should correspond to ffmpegs parameter: loglevel="silent"

Alternative solution

No response

mpegCoder version

3.2.4

Additional context

No response

cainmagi commented 1 year ago

Hello!

I appreciate your message for reminding me that I still need to maintain this project!

However, to my knowledge, it is not easy to control all running logs because some of them are not directly controlled by FFMpeg. For example, here, h264 is an independent library. If we want to suppress this information, we may have to try to find a way to configure h264 rather than FFMpeg.

I will try to do this in the next version, but I cannot guarantee that I can successfully do it.

Sincerely, Yuchen