Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在尝试使用 FFMPEG 读取视频帧。格式为PIX_FMT_RGB24;对于每一帧,RGB 值都在 frame->data[0] 中组合在一起(其中 frame 是 AVFrame 类型)。
如何提取每个帧的单独 R、G 和 B 值?这是用于处理视频。我认为它的工作方式与从位图中提取 RGB 值的方式相同。谢谢!
我猜:
int p=x*3+y*frame->linesize[0]; r=frame->data[0][p]; g=frame->data[0][p+1]; b=frame->data[0][p+2];
我可能有 r、g 和 b 倒退。而且还有很大的加速空间。