I am using python OpenCV with FFMPEG to stream an RTSP video stream.
I want to view ffmpeg logging to see what is going on under the hood with ffmpeg.
How do I enable this logging?
Actually, the full set of environment variables to control logging of ffmpeg and the video-related parts of OpenCV is as follows:
#define AV_LOG_QUIET -8
#define AV_LOG_PANIC 0
#define AV_LOG_FATAL 8
#define AV_LOG_ERROR 16
#define AV_LOG_WARNING 24
#define AV_LOG_INFO 32
#define AV_LOG_VERBOSE 40
#define AV_LOG_DEBUG 48
#define AV_LOG_TRACE 56
So.. for the debug level you have to do something like:
export OPENCV_FFMPEG_LOGLEVEL=48
You'd probably want the following variables as well:
export OPENCV_VIDEOWRITER_DEBUG=1
export OPENCV_VIDEOCAPTURE_DEBUG=1
Sooo.. for maximum logging of OpenCV/videoio/ffmpeg:
export OPENCV_VIDEOIO_DEBUG=1
export OPENCV_FFMPEG_DEBUG=1
export OPENCV_LOG_LEVEL=VERBOSE
export OPENCV_FFMPEG_LOGLEVEL=56
but there are many more environment variables you can use to get a better picture of what is going on. the following are a collection of additional variables i use for debugging:
export OPENCV_OPENCL_RAISE_ERROR=1
export OPENCV_OPENCL_ABORT_ON_BUILD_ERROR=1
export OPENCV_DUMP_ERRORS=1
export OPENCV_DUMP_CONFIG=1
export OPENCV_TRACE=1
export OPENCV_TRACE_DEPTH_OPENCV=1
export OPENCV_TRACE_SYNC_OPENCL=1
Hello you can set those env variable:
export OPENCV_VIDEOIO_DEBUG=1
export OPENCV_FFMPEG_DEBUG=1
export OPENCV_LOG_LEVEL=DEBUG
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With