]> rtime.felk.cvut.cz Git - frescor/streamer.git/blobdiff - output.c
Contract parameters are based on encoding bitrate
[frescor/streamer.git] / output.c
index 939be997898f9ff0c26a2639fae0662eb9bb7b50..b5d60e64216f082e0586fc6552a405da2e8df8dc 100644 (file)
--- a/output.c
+++ b/output.c
@@ -1,4 +1,9 @@
-#include "libavformat/avformat.h"
+/*
+ *  Copyright (c) 2008 Luca Abeni
+ *
+ *  This is free software; see GPL.txt
+ */
+#include <libavformat/avformat.h>
 
 
 AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType codec_type)
@@ -36,10 +41,20 @@ AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType co
     s->streams[0]->codec->codec_id = av_guess_codec(s->oformat, NULL, s->filename, NULL, codec_type);
     s->streams[0]->codec->codec_id = CODEC_ID_MPEG4;
     s->streams[0]->codec->pix_fmt  = PIX_FMT_YUV420P;
+    s->streams[0]->codec->mb_decision = 2;
+    s->streams[0]->codec->me_cmp = 2;
+    //s->streams[0]->codec->me_sub_cmp = 6;
+    s->streams[0]->codec->trellis = 1;
 
     return s;
 }
 
+int close_output_stream(AVFormatContext *s)
+{
+  url_fclose(s->pb);
+  return 0;
+}
+
 int pkt_send(AVFormatContext *ctx, AVPacket *pkt)
 {
   static int inited;           /* FIXME: HACK! */