FFMPEG Dummy Picture Pattern
2016-06-12 09:44
465 查看
From ffmpeg/doc/examples/muxing.c
/* Prepare a dummy image. */
static void fill_yuv_image(AVFrame *pict, int frame_index,
int width, int height)
{
int x, y, i, ret;
/* when we pass a frame to the encoder, it may keep a reference to it
* internally;
* make sure we do not overwrite it here
*/
ret = av_frame_make_writable(pict);
if (ret < 0)
exit(1);
i = frame_index;
/* Y */
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;
/* Cb and Cr */
for (y = 0; y < height / 2; y++) {
for (x = 0; x < width / 2; x++) {
pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;
pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;
}
}
}
/* Prepare a dummy image. */
static void fill_yuv_image(AVFrame *pict, int frame_index,
int width, int height)
{
int x, y, i, ret;
/* when we pass a frame to the encoder, it may keep a reference to it
* internally;
* make sure we do not overwrite it here
*/
ret = av_frame_make_writable(pict);
if (ret < 0)
exit(1);
i = frame_index;
/* Y */
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;
/* Cb and Cr */
for (y = 0; y < height / 2; y++) {
for (x = 0; x < width / 2; x++) {
pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;
pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;
}
}
}
相关文章推荐
- c++11 + SDL2 + ffmpeg +OpenAL + java = Android播放器
- Managed Media Aggregation using Rtsp and Rtp
- [总结]FFMPEG视音频编解码零基础学习方法
- 利用Ffmpeg获得flv视频缩略图和视频时间的代码
- codeigniter教程之上传视频并使用ffmpeg转flv示例
- PHP使用ffmpeg给视频增加字幕显示的方法
- PHP+FFMPEG实现将视频自动转码成H264标准Mp4文件
- 快速解决Android平台移植ffmpeg的一些问题
- java调用ffmpeg实现视频转换的方法
- python+ffmpeg视频并发直播压力测试
- php使用ffmpeg向视频中添加文字字幕的实现方法
- [总结]FFMPEG视音频编解码零基础学习方法
- ffmpeg的headers设置
- ffmpeg从rtsp抓流存flv[c# NReco.VideoConverter flv]
- FFMPEG 从rtsp抓取流,转存为flv文件。C语言代码方式.
- CentOs 下安装 ffmpeg 以及添加 ogg 音频支持
- 每周总结20130814——Android NDK环境的搭建和使用,YUV420SP格式图像的处理
- Linux 下ffmpeg视频转码实战一安装
- php使用ffmpeg向视频中添加文字字幕的实现方法
- php使用ffmpeg获取视频信息并截图的实现方法