]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7519: avformat tweaks for broadcast
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 21 Apr 2015 23:50:45 +0000 (18:50 -0500)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:23 +0000 (12:47 -0500)
src/mod/formats/mod_avformat/mod_avformat.c

index 3a397637f894c93bb1acda1838941fb2cd7c8b2e..3b8c737602c35af970e32b3fa368c483525634eb 100644 (file)
@@ -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;