为什么YUV全为0的图像是绿色的
https://blog.csdn.net/nwpu053883/article/details/103733537
A: 图像中常见的颜色编码有两种方式。
1. YUV - 灰度(亮度) + 色差分量
2. RGB - 红绿蓝 三色分量
YUV和RGB的转换:
Y = 0.299 R + 0.587 G + 0.114 B
U = -0.1687 R - 0.3313 G + 0.5 B + 128
V = 0.5 R - 0.4187 G - 0.0813 B + 128
R = Y + 1.402 (V-128)
G= Y - 0.34414 (U-128) - 0.71414 (V-128)
B= Y + 1.772 (U-128)
将YUV全0带入公式2,
得出
R = 1.402 * (-128) = -126.598
G = -0.34414(-128) - 0.71414(-128) = 44.04992 + 91.40992 = 135.45984
B = 1.772 * (-128) = -126.228
ok, 差不多就是R = -126, G = 135, B = -126
其中RGB有取值范围, 都是[0, 255]
所以最后就是R=0, G=135, B=0
查看颜色表...
嗯, 是一种深绿色, 和电视和视频种经常会遇到的那种绿色一样!!
getKnownCodecList白名单
https://segmentfault.com/a/1190000038508817
https://blog.csdn.net/email_jade/article/details/82527278
Android平台使用ijkplayer播放mp4的时候出现了起播闪一下绿屏的现象,在github上寻找解决方案,很多答案都是说由于开启硬解并且视频第一帧不是关键帧导致的,如下:
https://github.com/Bilibili/ijkplayer/issues/3233
但是我的配置是软解,也出现了同样的现象。后来在用ijkplayer的自带example应用测试的时候发现它没有起播绿屏,比对代码发现是因为我设置的overlay-format是IjkMediaPlayer.SDL_FCC_YV12,将其改成SDL_FCC_RV32就不会出现绿屏的效果了
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "overlay-format", IjkMediaPlayer.SDL_FCC_RV32);
具体原因暂且不知道,等到以后一定要好好研究下这个问题,先记录一下。
https://blog.csdn.net/a940659387/article/details/104975877?ops_request_misc=&request_id=&biz_id=102&utm_term=%25E7%25BB%25BF%25E5%25B1%258F&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-2-104975877.first_rank_v2_pc_rank_v29
https://blog.csdn.net/leo_wdls/article/details/41820883?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.edu_weight&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.edu_weight
D/IJKMEDIA: Video: first frame decoded
D/IJKMEDIA: FFP_MSG_VIDEO_DECODED_START:
A/IJKMEDIA: No JPEG data found in image
A/IJKMEDIA: No JPEG data found in image
加上:
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-muxer=mpjpeg"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-demuxer=mpjpeg"
问题解决
add qcom to white list (solves green screen issue)
https://github.com/RetroJamo/xbmc/commit/f2b95b58f3287a9c0e6ca746ae945ea03adbec25
https://blog.csdn.net/quantum7/article/details/107119487?ops_request_misc=%25257B%252522request%25255Fid%252522%25253A%252522160871751916780277056741%252522%25252C%252522scm%252522%25253A%25252220140713.130102334.pc%25255Fall.%252522%25257D&request_id=160871751916780277056741&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_v2~rank_v29-27-107119487.first_rank_v2_pc_rank_v29&utm_term=%E7%BB%BF%E5%B1%8F