Globotix / usb_cam

(ARCHIVED) A ROS Driver for V4L USB Cameras
http://wiki.ros.org/usb_cam
Other
0 stars 0 forks source link

[swscaler @ 0x55f15523c700] deprecated pixel format used, make sure you did set range correctly #3

Closed LKSeng closed 2 years ago

LKSeng commented 2 years ago

Using the newly implemented mjpeg_yuvj420p mode added in #2 causes the warning in title to be printed.

LKSeng commented 2 years ago

Use of AV_PIX_FMT_YUVJ420P is deprecated. While this warning does not seem to affect the color with our webcam, it might be wise to heed the call of this warning.

Implemented with changes mentioned in swscaler-warning-deprecated-pixel-format-used.

In addition, had to temporarily store the AVPixelFormat as one of the function calls, presumably avcodec_decode_video2() or avcodec_decode_video() changes the AVPixelFormat back to AV_PIX_FMT_YUVJ420P even if it was previously set to AV_PIX_FMT_YUV420P, hence when sws_getColorspaceDetails() is called with AV_PIX_FMT_YUVJ420P, a deprecation warning is thrown.