Hiding log from OpenCV (Missing reference price, default is 0 | decode_slice_header error)

My cv2 code is printing the terminal message to the Jupyter

Missing reference picture, default is 0 
decode_slice_header error

I understand that the problem might be because of the video file but I just want to hide this message so I can export the a clean output from Jupyter to my client
The log above seem not effect anything on my processing.

Sample of my code.

cap = cv2.VideoCapture(video_path)
cap.set(cv2.CAP_PROP_POS_FRAMES, frame_index)
ret, frame = cap.read()

I tried capture and redirect_stdout. But it seem to work with only print not the terminal.
Honestly, I am not sure where is message come from whether the cv2 print it? or ffmpeg print it? or Jupyter capture it from terminal. But what I want to now is just hiding it.

Can someone suggest me the best approach for this?

You can disable IPython’s capture of low-level FD output in your ipython_config.py:

# ipython_config.py
c.IPKernelApp.capture_fd_output = False

More information and workarounds in this issue.

You can also use wurlitzer, which captures low-level FD output, which can then be discarded:

from wurlitzer import pipes

with pipes() as _discarded:
    cv2....