]> rtime.felk.cvut.cz Git - frescor/streamer.git/commitdiff
Attempt to fix unexpected video delays with 30 FPS
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 28 Nov 2009 20:25:04 +0000 (21:25 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 28 Nov 2009 20:25:04 +0000 (21:25 +0100)
vivi driver outputs frames at 30 FPS and ffplay plays the stream delayed.
This attempt to fix was unsuccessful.

output.c
output.h
streamer.c

index baa91832987178a4548cf484e518f95e63f09586..59185a96410203d899a802bc2699a9a68a5bf6e3 100644 (file)
--- a/output.c
+++ b/output.c
@@ -6,8 +6,7 @@
 #include <libavformat/avformat.h>
 #include "output.h"
 
-
-AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType codec_type)
+AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType codec_type, int fps)
 {
     AVFormatContext *s;
     static AVOutputFormat *rtp_format;
@@ -44,6 +43,10 @@ AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType co
     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->time_base.den = fps; */
+/*     s->streams[0]->codec->time_base.num = 1; */
+/*     st->codec->time_base.den = fps; */
+/*     st->codec->time_base.num = 1; */
     //s->streams[0]->codec->me_sub_cmp = 6;
     s->streams[0]->codec->trellis = 1;
 
index d035ef810ed04cf94caf410aaec2b5212e8f9621..b30f2e207c0beaf406d038d1fd3121d9929336a4 100644 (file)
--- a/output.h
+++ b/output.h
@@ -4,7 +4,7 @@
  *  This is free software; see GPL.txt
  */
 int pkt_send(AVFormatContext *ctx, AVPacket *pkt);
-AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType codec_type);
+AVFormatContext *open_output_stream(const char *dst, int port, enum CodecType codec_type, int fps);
 int close_output_stream(AVFormatContext *s);
 
 
index 28d5b7e1407802601161ae3df31333f49e22ee5e..7ec7f8a35cc8f90dbc05e04308f47efe4447a9d1 100644 (file)
@@ -251,7 +251,7 @@ int main(int argc, char *argv[])
     return -1;
   }
   codec_open(s);
-  os = open_output_stream(dst, dport, CODEC_TYPE_VIDEO);
+  os = open_output_stream(dst, dport, CODEC_TYPE_VIDEO, fps);
   if (os == NULL) {
     fprintf(stderr, "Cannot open output stream\n");