priv->vcodec_ctx->gop_size = 30;
priv->vcodec_ctx->max_b_frames = 2;
priv->vcodec_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
- priv->vcodec_ctx->sample_aspect_ratio = (AVRational){16, 9};
+ priv->vcodec_ctx->sample_aspect_ratio = (AVRational){1, 1};
s->time_base = priv->vcodec_ctx->time_base;
if (priv->fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
f->error = ret;
goto error;
}
+#if 1
+ static int fd = -1;
+ if (-1 == fd)
+ fd = open("1.yuv", O_RDWR | O_CREAT | O_TRUNC, 0666);
+ if (fd > 0) {
+ int i;
+ for (i = 0; i < f->vframe->height; i++)
+ write(fd, f->vframe->data[0] + i * f->vframe->linesize[0], f->vframe->width);
+
+ for (i = 0; i < f->vframe->height / 2; i++)
+ write(fd, f->vframe->data[1] + i * f->vframe->linesize[1], f->vframe->width / 2);
+
+ for (i = 0; i < f->vframe->height / 2; i++)
+ write(fd, f->vframe->data[2] + i * f->vframe->linesize[2], f->vframe->width / 2);
+ }
+#endif
for (l = scf_list_head(&f->outputs); l != scf_list_sentinel(&f->outputs); l = scf_list_next(l)) {
io = scf_list_data(l, simp_avio_t, list);