X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mixer.cpp;h=5b2d0da6324eb6e2485a8674afb182a44b75b575;hb=bc7862c72514f91de51c547b2efe26c90b9631f9;hp=69eebe07905196e024ae4bf0708fc53b2629d6b7;hpb=8c262d40bbad4c134b94f6b0e4f0971fc54e665d;p=nageru diff --git a/mixer.cpp b/mixer.cpp index 69eebe0..5b2d0da 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -41,6 +41,7 @@ #include "h264encode.h" #include "pbo_frame_allocator.h" #include "ref_counted_gl_sync.h" +#include "timebase.h" class QOpenGLContext; @@ -95,7 +96,7 @@ Mixer::Mixer(const QSurfaceFormat &format) display_chain->set_dither_bits(0); // Don't bother. display_chain->finalize(); - h264_encoder.reset(new H264Encoder(h264_encoder_surface, WIDTH, HEIGHT, "test.mkv")); + h264_encoder.reset(new H264Encoder(h264_encoder_surface, WIDTH, HEIGHT, "test.mp4")); for (int card_index = 0; card_index < NUM_CARDS; ++card_index) { printf("Configuring card %d...\n", card_index); @@ -321,7 +322,7 @@ void Mixer::thread_func() for (int card_index = 0; card_index < NUM_CARDS; ++card_index) { input_frames.push_back(bmusb_current_rendering_frame[card_index]); } - h264_encoder->end_frame(fence, move(samples_out), input_frames); + h264_encoder->end_frame(fence, frame * (TIMEBASE / 60), move(samples_out), input_frames); // The live frame just shows the RGBA texture we just rendered. // It owns rgba_tex now.