- quicksync_encoder.reset(new QuickSyncEncoder(filename, resource_pool, surface, va_display, width, height, oformat, x264_encoder.get()));
+ if (global_flags.x264_video_to_disk) {
+ x264_encoder.reset(new X264Encoder(oformat));
+ if (global_flags.x264_video_to_http) {
+ x264_encoder->add_mux(stream_mux.get());
+ }
+ if (overriding_bitrate != 0) {
+ x264_encoder->change_bitrate(overriding_bitrate);
+ }
+ }
+
+ quicksync_encoder.reset(new QuickSyncEncoder(filename, resource_pool, surface, va_display, width, height, oformat, x264_encoder.get(), disk_space_estimator));