@@ -72,7 +72,7 @@ VideoStore::VideoStore(
7272 next_dts(nullptr ),
7373 audio_next_pts(0 ),
7474 max_stream_index(-1 ),
75- reorder_queue_size(0 ) {
75+ reorder_queue_size(1 ) {
7676 FFMPEGInit ();
7777 swscale.init ();
7878 opkt = av_packet_ptr{av_packet_alloc ()};
@@ -301,15 +301,20 @@ bool VideoStore::open() {
301301 const AVDictionaryEntry *opts_level = av_dict_get (opts, " level" , nullptr , AV_DICT_MATCH_CASE);
302302 if (opts_level) {
303303 video_out_ctx->level = std::stoul (opts_level->value );
304- } else {
304+ } else if (!video_out_ctx-> level ) {
305305 video_out_ctx->level = 32 ;
306306 }
307307 const AVDictionaryEntry *opts_gop_size = av_dict_get (opts, " gop_size" , nullptr , AV_DICT_MATCH_CASE);
308308 if (opts_gop_size) {
309309 video_out_ctx->gop_size = std::stoul (opts_gop_size->value );
310- } else {
310+ } else if (!video_out_ctx-> gop_size ) {
311311 video_out_ctx->gop_size = 12 ;
312312 }
313+ zm_dump_codec (video_out_ctx);
314+ if (!video_out_ctx->bit_rate ) {
315+ video_out_ctx->bit_rate = monitor->get_capture_bitrate ();
316+ }
317+ zm_dump_codec (video_out_ctx);
313318
314319 // Don't have an input stream, so need to tell it what we are sending it, or are transcoding
315320 video_out_ctx->width = monitor->Width ();
@@ -363,6 +368,7 @@ bool VideoStore::open() {
363368 av_dict_free (&opts);
364369
365370 if (video_out_codec) {
371+ zm_dump_codec (video_out_ctx);
366372 break ;
367373 }
368374 // We allocate and copy in newer ffmpeg, so need to free it
@@ -384,6 +390,7 @@ bool VideoStore::open() {
384390 Error (" Could not initialize stream parameters" );
385391 return false ;
386392 }
393+ zm_dump_stream (video_out_stream);
387394 } // end if copying or transcoding
388395 } // end if video_in_stream
389396
0 commit comments