From 80694ad5475bc3586a86e718017009e556354424 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 21 Apr 2015 18:50:45 -0500 Subject: [PATCH] FS-7519: avformat tweaks for broadcast --- src/mod/formats/mod_avformat/mod_avformat.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/formats/mod_avformat/mod_avformat.c b/src/mod/formats/mod_avformat/mod_avformat.c index 3a397637f8..3b8c737602 100644 --- a/src/mod/formats/mod_avformat/mod_avformat.c +++ b/src/mod/formats/mod_avformat/mod_avformat.c @@ -231,6 +231,8 @@ static switch_status_t add_stream(OutputStream *ost, AVFormatContext *oc, AVCode /* Resolution must be a multiple of two. */ c->width = ost->width; c->height = ost->height; + ost->st->time_base.den = 1000; + ost->st->time_base.num = 1; c->time_base.den = 1000; c->time_base.num = 1; c->gop_size = 25; /* emit one intra frame every x frames at most */ @@ -238,6 +240,10 @@ static switch_status_t add_stream(OutputStream *ost, AVFormatContext *oc, AVCode c->thread_count = threads; c->rc_initial_buffer_occupancy = buffer_bytes * 8; + if (codec_id == AV_CODEC_ID_H264) { + c->ticks_per_frame = 2; + } + if (codec_id == AV_CODEC_ID_VP8) { av_set_options_string(c, "quality=realtime", "=", ":"); } @@ -1209,7 +1215,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa } fmt->audio_codec = AV_CODEC_ID_AAC; - + handle->samplerate = 44100; handle->mm.samplerate = 44100; handle->mm.ab = 128;