0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

Merge pull request #3142 from NodeBoy2/bugfix/flvmetadata

obs-outputs: Use FLV codec IDs for videocodecid/audiocodecid
This commit is contained in:
Jim 2020-07-12 15:45:10 -07:00 committed by GitHub
commit fb587d0205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,8 @@
//#define WRITE_FLV_HEADER //#define WRITE_FLV_HEADER
#define VIDEO_HEADER_SIZE 5 #define VIDEO_HEADER_SIZE 5
#define VIDEODATA_AVCVIDEOPACKET 7.0
#define AUDIODATA_AAC 10.0
static inline double encoder_bitrate(obs_encoder_t *encoder) static inline double encoder_bitrate(obs_encoder_t *encoder)
{ {
@ -85,14 +87,15 @@ static bool build_flv_meta_data(obs_output_t *context, uint8_t **output,
enc_num_val(&enc, end, "height", enc_num_val(&enc, end, "height",
(double)obs_encoder_get_height(vencoder)); (double)obs_encoder_get_height(vencoder));
enc_str_val(&enc, end, "videocodecid", "avc1"); enc_num_val(&enc, end, "videocodecid",
VIDEODATA_AVCVIDEOPACKET);
enc_num_val(&enc, end, "videodatarate", enc_num_val(&enc, end, "videodatarate",
encoder_bitrate(vencoder)); encoder_bitrate(vencoder));
enc_num_val(&enc, end, "framerate", enc_num_val(&enc, end, "framerate",
video_output_get_frame_rate(video)); video_output_get_frame_rate(video));
} }
enc_str_val(&enc, end, "audiocodecid", "mp4a"); enc_num_val(&enc, end, "audiocodecid", AUDIODATA_AAC);
enc_num_val(&enc, end, "audiodatarate", encoder_bitrate(aencoder)); enc_num_val(&enc, end, "audiodatarate", encoder_bitrate(aencoder));
enc_num_val(&enc, end, "audiosamplerate", enc_num_val(&enc, end, "audiosamplerate",
(double)obs_encoder_get_sample_rate(aencoder)); (double)obs_encoder_get_sample_rate(aencoder));