Browse Source

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
master
sam 15 years ago
parent
commit
d1fa1af3a1
2 changed files with 17 additions and 8 deletions
  1. +14
    -5
      examples/makemovie.c
  2. +3
    -3
      examples/storyboard.c

+ 14
- 5
examples/makemovie.c View File

@@ -18,8 +18,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>


#include <avformat.h>
#include <swscale.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>


#include <pipi.h> #include <pipi.h>


@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
pipi_image_t *image; pipi_image_t *image;
pipi_pixels_t *p; pipi_pixels_t *p;
uint8_t *buffer, *tmp; uint8_t *buffer, *tmp;
int len;
int f, len;


if(argc < 2) if(argc < 2)
return EXIT_FAILURE; return EXIT_FAILURE;
@@ -73,7 +73,12 @@ int main(int argc, char *argv[])
ctx->height = HEIGHT; ctx->height = HEIGHT;
ctx->sample_aspect_ratio.num = PAR_NUM; ctx->sample_aspect_ratio.num = PAR_NUM;
ctx->sample_aspect_ratio.den = PAR_DEN; 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->codec_type = CODEC_TYPE_VIDEO;
ctx->bit_rate = BITRATE; ctx->bit_rate = BITRATE;
ctx->time_base.num = 1; ctx->time_base.num = 1;
@@ -114,7 +119,7 @@ int main(int argc, char *argv[])


av_write_header(fmt); av_write_header(fmt);


for(;;)
for(f = 0; ; f++)
{ {
uint8_t *start; uint8_t *start;
int w = 0, h = 0, bytes, pitch; int w = 0, h = 0, bytes, pitch;
@@ -162,8 +167,12 @@ int main(int argc, char *argv[])
packet.size = bytes; packet.size = bytes;
if(av_interleaved_write_frame(fmt, &packet) < 0) if(av_interleaved_write_frame(fmt, &packet) < 0)
return EXIT_FAILURE; return EXIT_FAILURE;

fprintf(stderr, "frame %d\r", f);
} }


fprintf(stderr, "\n");

av_write_trailer(fmt); av_write_trailer(fmt);


avcodec_close(stream->codec); avcodec_close(stream->codec);


+ 3
- 3
examples/storyboard.c View File

@@ -18,9 +18,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>


#include <avcodec.h>
#include <avformat.h>
#include <swscale.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>


#include <pipi.h> #include <pipi.h>




Loading…
Cancel
Save