From d1fa1af3a15cbab902df5e4332bfa8574279533b Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 25 May 2009 00:16:20 +0000 Subject: [PATCH] Fix the FFmpeg headers location in example programs. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3516 92316355-f0b4-4df1-b90c-862c8a59935f --- examples/makemovie.c | 19 ++++++++++++++----- examples/storyboard.c | 6 +++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/examples/makemovie.c b/examples/makemovie.c index e5f5975..2b048ac 100644 --- a/examples/makemovie.c +++ b/examples/makemovie.c @@ -18,8 +18,8 @@ #include #include -#include -#include +#include +#include #include @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) pipi_image_t *image; pipi_pixels_t *p; uint8_t *buffer, *tmp; - int len; + int f, len; if(argc < 2) return EXIT_FAILURE; @@ -73,7 +73,12 @@ int main(int argc, char *argv[]) ctx->height = HEIGHT; ctx->sample_aspect_ratio.num = PAR_NUM; ctx->sample_aspect_ratio.den = PAR_DEN; - ctx->codec_id = fmt->oformat->video_codec; + //ctx->codec_id = fmt->oformat->video_codec; + //ctx->codec_id = CODEC_ID_FFV1; + //ctx->codec_id = CODEC_ID_THEORA; + //ctx->codec_id = CODEC_ID_SNOW; + //ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; /* Snow */ + ctx->codec_id = CODEC_ID_MJPEG; ctx->codec_type = CODEC_TYPE_VIDEO; ctx->bit_rate = BITRATE; ctx->time_base.num = 1; @@ -114,7 +119,7 @@ int main(int argc, char *argv[]) av_write_header(fmt); - for(;;) + for(f = 0; ; f++) { uint8_t *start; int w = 0, h = 0, bytes, pitch; @@ -162,8 +167,12 @@ int main(int argc, char *argv[]) packet.size = bytes; if(av_interleaved_write_frame(fmt, &packet) < 0) return EXIT_FAILURE; + + fprintf(stderr, "frame %d\r", f); } + fprintf(stderr, "\n"); + av_write_trailer(fmt); avcodec_close(stream->codec); diff --git a/examples/storyboard.c b/examples/storyboard.c index 8f7fc68..03f0785 100644 --- a/examples/storyboard.c +++ b/examples/storyboard.c @@ -18,9 +18,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include