From a2118616fc80ea0f354f004d63e24ad521692374 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sat, 28 Nov 2009 21:25:04 +0100 Subject: [PATCH] Attempt to fix unexpected video delays with 30 FPS vivi driver outputs frames at 30 FPS and ffplay plays the stream delayed. This attempt to fix was unsuccessful. --- output.c | 7 +++++-- output.h | 2 +- streamer.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/output.c b/output.c index baa9183..59185a9 100644 --- a/output.c +++ b/output.c @@ -6,8 +6,7 @@ #include #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; diff --git a/output.h b/output.h index d035ef8..b30f2e2 100644 --- 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); diff --git a/streamer.c b/streamer.c index 28d5b7e..7ec7f8a 100644 --- a/streamer.c +++ b/streamer.c @@ -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"); -- 2.39.2