cats-oss / android-gpuimage

Android filters based on OpenGL (idea from GPUImage for iOS)
8.98k stars 2.26k forks source link

尝试在视频上使用该项目,发现颜色展示不正常Try to apply to local video and find the color is not normal #488

Closed FjcD closed 2 years ago

FjcD commented 4 years ago

Future Task

What is the motivation?

What kind of solution can be considered?

What do you want to discuss?

Please add relevant labels


Bug Reporting

First of all, my English is very poor, I will use the software to translate a copy of English

我尝试给本地视频添加滤镜, I tried adding filters to the local video

使用MediaCodec解码本地视频,得到视频每一帧的byte[], Use MediaCodec to decode the local video and get the byte[] of each frame of the video,

然后使用GPUImageView.updatePreviewFrame来刷新视图, Then use the GPUImageView.updatePreviewFrame to refresh the view,

在使用默认的GPUImageFilter情况下,视频的颜色不正常。 When using the default GPUImageFilter, the video's color is not normal.

我查看了代码,发现GPUImageRenderer.onPreviewFrame默认使用了GPUImageNativeLibrary.YUVtoRBGA, I looked at the code, I found GPUImageRenderer.onPreviewFrame Use GPUImageNativeLibrary. YUVtoRBGA by default

我尝试使用YUVtoARBG转换byte[]并展示到视图中,颜色是正常的 I tried to use YUVtoARBG to convert the byte[] and show it to the view, and the color is normal

Steps to Reproduce

Actual Results (include screenshots)

很遗憾国内的网络无法支持我上传文件到github... I am sorry that the domestic network cannot support me to upload files to github

Expected Results (include screenshots)

URL

OS details

Please add relevant labels

FjcD commented 4 years ago

image