OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47c43ce
)
examples/encode_video: add log
author
Stefano Sabatini
<stefasab@gmail.com>
Tue, 23 May 2017 09:50:40 +0000
(11:50 +0200)
committer
Stefano Sabatini
<stefasab@gmail.com>
Wed, 31 May 2017 13:46:14 +0000
(15:46 +0200)
This helps to visualize how the send/receive API works.
doc/examples/encode_video.c
patch
|
blob
|
history
diff --git
a/doc/examples/encode_video.c
b/doc/examples/encode_video.c
index
d2075c1
..
107bea2
100644
(file)
--- a/
doc/examples/encode_video.c
+++ b/
doc/examples/encode_video.c
@@
-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);
}