- int ret = 1, got_packet = 0;
- if( fmt_ctx->oformat->flags & AVFMT_RAWPICTURE ) {
- /* a hack to avoid data copy with some raw video muxers */
- pkt->flags |= AV_PKT_FLAG_KEY;
- pkt->stream_index = fst->st->index;
- AVPicture *picture = (AVPicture *)frame;
- pkt->data = (uint8_t *)picture;
- pkt->size = sizeof(AVPicture);
- pkt->pts = pkt->dts = frame->pts;
- got_packet = 1;
- }
- else
- ret = fst->encode_frame(pkt, frame, got_packet);