mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2025-03-07 12:17:53 +00:00
examples/encode_video: add log
This helps to visualize how the send/receive API works.
This commit is contained in:
parent
47c43ce36f
commit
002dbc5a1f
@ -42,6 +42,9 @@ static void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt,
|
||||
int ret;
|
||||
|
||||
/* send the frame to the encoder */
|
||||
if (frame)
|
||||
printf("Send frame %3"PRId64"\n", frame->pts);
|
||||
|
||||
ret = avcodec_send_frame(enc_ctx, frame);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error sending a frame for encoding\n");
|
||||
@ -57,7 +60,7 @@ static void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt,
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("Write frame %3"PRId64" (size=%5d)\n", pkt->pts, pkt->size);
|
||||
printf("Write packet %3"PRId64" (size=%5d)\n", pkt->pts, pkt->size);
|
||||
fwrite(pkt->data, 1, pkt->size, outfile);
|
||||
av_packet_unref(pkt);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user