【发布时间】:2012-06-05 07:20:07
【问题描述】:
我正在尝试为使用 RGB24 格式初始化的 AVFrame 填充示例数据。 我使用以下代码 sn-p 填充 RGB 数据。 但是在编码的视频中,我只能看到仅覆盖视频帧 1/3 的灰度条。 此代码 sn-p 假设仅填充红色。 任何提示我在这里做错了什么?
AVFrame *targetFrame=.....
int height=imageHeight();
int width=imageWidth();
for(y=0;y<encoder.getVideoParams().height ;y++){
for(x=0;x< encoder.getVideoParams().width;x++){
targetFrame->data[0][(y* width)+x]=(x%255); //R
targetFrame->data[0][(y* width)+x+1]=0; //G
targetFrame->data[0][(y* width)+x+2]=0; //B
}
}
【问题讨论】:
标签: c image-processing ffmpeg libavcodec libav