Beginning on line 366 of output_example.c, there is the following:
if (oc->oformat->flags & AVFMT_RAWPICTURE) {
/* raw video case. The API will change slightly in the near
futur for that */
AVPacket pkt;
av_init_packet(&pkt);
pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index= st->index;
pkt.data= (uint8_t *)picture;
pkt.size= sizeof(AVPicture);
ret = av_interleaved_write_frame(oc, &pkt);
}
Why is pkt.size set to sizeof(AVPicture)? Shouldn't this be something like this:
pkt.size = avpicture_get_size(st->codec->pix_fmt, st->codec->width,
st->codec->height);
If use the code in my app unmodified, my output files are 3KB. If I
change the packet size to the length of the uncompressed frame, it
works normally. Am I missing something?
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user