Fix issue when using multiple video encoders

- Fix an issue that could occur when using more than one video encoder.
   Audio/video would not sync up correctly because they were expected to
   be paired with a particular encoder.  This simply adds a little
   helper variable to encoder packets that specifies the system time in
   microseconds.  We then use that system time to sync

 - Fix an issue with x264 with fractional FPS rates (29.97 and 59.94
   particularly) where it would create ridiculously large stream
   outputs.  The problem was that you shouldn't set the timebase_*
   variables in the x264 params manually, let x264 handle the default
   values for it and leave them at 0.

 - Make x264 use CFR output, because there's no reason to ever use VFR
   in this case.
This commit is contained in:
jp9000
2014-04-10 11:59:42 -07:00
parent 92522d1886
commit 519c4f4118
6 changed files with 47 additions and 46 deletions

View File

@@ -21,10 +21,11 @@
#include "obs-output-ver.h"
#include "rtmp-helpers.h"
/* FIXME: this is currently hard-coded to h264 and aac! ..not that we'll
/* TODO: FIXME: this is currently hard-coded to h264 and aac! ..not that we'll
* use anything else for a long time. */
// #define DEBUG_TIMESTAMPS
//#define DEBUG_TIMESTAMPS
//#define WRITE_FLV_HEADER
#define VIDEO_HEADER_SIZE 5
#define MILLISECOND_DEN 1000
@@ -94,11 +95,13 @@ void flv_meta_data(obs_output_t context, uint8_t **output, size_t *size)
build_flv_meta_data(context, &meta_data, &meta_data_size);
/* s_write(&s, "FLV", 3);
#ifdef WRITE_FLV_HEADER
s_write(&s, "FLV", 3);
s_w8(&s, 1);
s_w8(&s, 5);
s_wb32(&s, 9);
s_wb32(&s, 0); */
s_wb32(&s, 0);
#endif
start_pos = serializer_get_pos(&s);