]> git.sesse.net Git - nageru/blobdiff - nageru/kaeru.cpp
For FFmpeg inputs, add an option for playing as fast as possible.
[nageru] / nageru / kaeru.cpp
index 84bb7ad5692d8125a876f4e151e00684e5a6241f..843bd81b4293cbdc28f15c6387e9457aa550c049 100644 (file)
@@ -73,7 +73,7 @@ unique_ptr<Mux> create_mux(HTTPD *httpd, AVOutputFormat *oformat, X264Encoder *x
 
        unique_ptr<Mux> mux;
        mux.reset(new Mux(avctx, global_flags.width, global_flags.height, Mux::CODEC_H264, video_extradata, audio_encoder->get_codec_parameters().get(),
-               get_color_space(global_flags.ycbcr_rec709_coefficients), Mux::WITH_AUDIO, COARSE_TIMEBASE,
+               get_color_space(global_flags.ycbcr_rec709_coefficients), COARSE_TIMEBASE,
                /*write_callback=*/nullptr, Mux::WRITE_FOREGROUND, { &stream_mux_metrics }));
        stream_mux_metrics.init({{ "destination", "http" }});
        return mux;
@@ -209,7 +209,7 @@ int main(int argc, char *argv[])
        }
        video.configure_card();
        video.start_bm_capture();
-       video.change_rate(2.0);  // Be sure never to really fall behind, but also don't dump huge amounts of stuff onto x264.
+       video.change_rate(10.0);  // Play as fast as possible.
 
        BasicStats basic_stats(/*verbose=*/false, /*use_opengl=*/false);
        global_basic_stats = &basic_stats;
@@ -225,6 +225,7 @@ int main(int argc, char *argv[])
 
        video.stop_dequeue_thread();
        // Stop the x264 encoder before killing the mux it's writing to.
+       global_x264_encoder = nullptr;
        x264_encoder.reset();
        return 0;
 }