新增支持enhanced-rtmp h265 推流 (#2694)

This commit is contained in:
夏楚 2023-07-22 17:31:39 +08:00 committed by GitHub
parent b44ca8fd6f
commit 47add54465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 325 additions and 111 deletions

View File

@ -211,7 +211,7 @@ static CodecId getVideoCodecIdByAmf(const AMFValue &val){
return CodecInvalid; return CodecInvalid;
} }
Track::Ptr getTrackByCodecId(CodecId codecId, int sample_rate = 0, int channels = 0, int sample_bit = 0) { Track::Ptr Factory::getTrackByCodecId(CodecId codecId, int sample_rate, int channels, int sample_bit) {
switch (codecId){ switch (codecId){
case CodecH264 : return std::make_shared<H264Track>(); case CodecH264 : return std::make_shared<H264Track>();
case CodecH265 : return std::make_shared<H265Track>(); case CodecH265 : return std::make_shared<H265Track>();

View File

@ -21,6 +21,16 @@ namespace mediakit{
class Factory { class Factory {
public: public:
/**
* codec_id track
* @param codecId id
* @param sample_rate 90000
* @param channels
* @param sample_bit
*/
static Track::Ptr getTrackByCodecId(CodecId codecId, int sample_rate = 0, int channels = 0, int sample_bit = 0);
////////////////////////////////rtsp相关////////////////////////////////// ////////////////////////////////rtsp相关//////////////////////////////////
/** /**
* sdp生成Track对象 * sdp生成Track对象

View File

@ -164,12 +164,8 @@ bool H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
//not config //not config
_rtmp_packet->buffer[1] = true; _rtmp_packet->buffer[1] = true;
int32_t cts = pts - dts; int32_t cts = pts - dts;
if (cts < 0) {
cts = 0;
}
//cts //cts
set_be24(&_rtmp_packet->buffer[2], cts); set_be24(&_rtmp_packet->buffer[2], cts);
_rtmp_packet->time_stamp = dts; _rtmp_packet->time_stamp = dts;
_rtmp_packet->body_size = _rtmp_packet->buffer.size(); _rtmp_packet->body_size = _rtmp_packet->buffer.size();
_rtmp_packet->chunk_id = CHUNK_VIDEO; _rtmp_packet->chunk_id = CHUNK_VIDEO;

View File

@ -30,25 +30,8 @@ H265Frame::Ptr H265RtmpDecoder::obtainFrame() {
} }
#ifdef ENABLE_MP4 #ifdef ENABLE_MP4
/**
* 0x00 00 00 01sps
* @return
*/
static bool getH265ConfigFrame(const RtmpPacket &thiz,string &frame) {
if (thiz.getMediaType() != FLV_CODEC_H265) {
return false;
}
if (!thiz.isCfgFrame()) {
return false;
}
if (thiz.buffer.size() < 6) {
WarnL << "bad H265 cfg!";
return false;
}
auto extra = thiz.buffer.data() + 5;
auto bytes = thiz.buffer.size() - 5;
static bool decode_HEVCDecoderConfigurationRecord(uint8_t *extra, size_t bytes, string &frame) {
struct mpeg4_hevc_t hevc; struct mpeg4_hevc_t hevc;
memset(&hevc, 0, sizeof(hevc)); memset(&hevc, 0, sizeof(hevc));
if (mpeg4_hevc_decoder_configuration_record_load((uint8_t *)extra, bytes, &hevc) > 0) { if (mpeg4_hevc_decoder_configuration_record_load((uint8_t *)extra, bytes, &hevc) > 0) {
@ -62,9 +45,88 @@ static bool getH265ConfigFrame(const RtmpPacket &thiz,string &frame) {
} }
return false; return false;
} }
/**
* 0x00 00 00 01sps
*/
static bool getH265ConfigFrame(const RtmpPacket &thiz, string &frame) {
if (thiz.getMediaType() != FLV_CODEC_H265) {
return false;
}
if (!thiz.isCfgFrame()) {
return false;
}
if (thiz.buffer.size() < 6) {
WarnL << "bad H265 cfg!";
return false;
}
return decode_HEVCDecoderConfigurationRecord((uint8_t *)thiz.buffer.data() + 5, thiz.buffer.size() - 5, frame);
}
#endif #endif
void H265RtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) { void H265RtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) {
if (_info.codec == CodecInvalid) {
// 先判断是否为增强型rtmp
parseVideoRtmpPacket((uint8_t *)pkt->data(), pkt->size(), &_info);
}
if (_info.is_enhanced) {
// 增强型rtmp
parseVideoRtmpPacket((uint8_t *)pkt->data(), pkt->size(), &_info);
if (!_info.is_enhanced || _info.codec != CodecH265) {
throw std::invalid_argument("Invalid enhanced-rtmp hevc packet!");
}
auto data = (uint8_t *)pkt->data() + 5;
auto size = pkt->size() - 5;
switch (_info.video.pkt_type) {
case RtmpPacketType::PacketTypeSequenceStart: {
#ifdef ENABLE_MP4
string config;
if (decode_HEVCDecoderConfigurationRecord(data, size, config)) {
onGetH265(config.data(), config.size(), pkt->time_stamp, pkt->time_stamp);
}
#else
WarnL << "请开启MP4相关功能并使能\"ENABLE_MP4\",否则对H265-RTMP支持不完善";
#endif
break;
}
case RtmpPacketType::PacketTypeCodedFramesX:
case RtmpPacketType::PacketTypeCodedFrames: {
auto pts = pkt->time_stamp;
if (RtmpPacketType::PacketTypeCodedFrames == _info.video.pkt_type) {
// SI24 = [CompositionTime Offset]
CHECK(size > 7);
int32_t cts = (((data[0] << 16) | (data[1] << 8) | (data[2])) + 0xff800000) ^ 0xff800000;
pts += cts;
data += 3;
size -= 3;
}
splitFrame(data, size, pkt->time_stamp, pts);
break;
}
case RtmpPacketType::PacketTypeMetadata: {
// The body does not contain video data. The body is an AMF encoded metadata.
// The metadata will be represented by a series of [name, value] pairs.
// For now the only defined [name, value] pair is [“colorInfo”, Object]
// See Metadata Frame section for more details of this object.
//
// For a deeper understanding of the encoding please see description
// of SCRIPTDATA and SSCRIPTDATAVALUE in the FLV file spec.
// DATA = [“colorInfo”, Object]
break;
}
case RtmpPacketType::PacketTypeSequenceEnd: {
// signals end of sequence
break;
}
default: break;
}
return;
}
// 国内扩展(12) H265 rtmp
if (pkt->isCfgFrame()) { if (pkt->isCfgFrame()) {
#ifdef ENABLE_MP4 #ifdef ENABLE_MP4
string config; string config;
@ -78,41 +140,42 @@ void H265RtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) {
} }
if (pkt->buffer.size() > 9) { if (pkt->buffer.size() > 9) {
auto total_len = pkt->buffer.size();
size_t offset = 5;
uint8_t *cts_ptr = (uint8_t *)(pkt->buffer.data() + 2); uint8_t *cts_ptr = (uint8_t *)(pkt->buffer.data() + 2);
int32_t cts = (((cts_ptr[0] << 16) | (cts_ptr[1] << 8) | (cts_ptr[2])) + 0xff800000) ^ 0xff800000; int32_t cts = (((cts_ptr[0] << 16) | (cts_ptr[1] << 8) | (cts_ptr[2])) + 0xff800000) ^ 0xff800000;
auto pts = pkt->time_stamp + cts; auto pts = pkt->time_stamp + cts;
while (offset + 4 < total_len) { splitFrame((uint8_t *)pkt->data() + 5, pkt->size() - 5, pkt->time_stamp, pts);
uint32_t frame_len;
memcpy(&frame_len, pkt->buffer.data() + offset, 4);
frame_len = ntohl(frame_len);
offset += 4;
if (frame_len + offset > total_len) {
break;
}
onGetH265(pkt->buffer.data() + offset, frame_len, pkt->time_stamp, pts);
offset += frame_len;
}
} }
} }
inline void H265RtmpDecoder::onGetH265(const char* pcData, size_t iLen, uint32_t dts,uint32_t pts) { void H265RtmpDecoder::splitFrame(const uint8_t *data, size_t size, uint32_t dts, uint32_t pts) {
if(iLen == 0){ auto end = data + size;
while (data + 4 < end) {
uint32_t frame_len = load_be32(data);
data += 4;
if (data + frame_len > end) {
break;
}
onGetH265((const char *)data, frame_len, dts, pts);
data += frame_len;
}
}
inline void H265RtmpDecoder::onGetH265(const char *data, size_t size, uint32_t dts, uint32_t pts) {
if (size == 0) {
return; return;
} }
#if 1 #if 1
_h265frame->_dts = dts; _h265frame->_dts = dts;
_h265frame->_pts = pts; _h265frame->_pts = pts;
_h265frame->_buffer.assign("\x00\x00\x00\x01", 4); // 添加265头 _h265frame->_buffer.assign("\x00\x00\x00\x01", 4); // 添加265头
_h265frame->_buffer.append(pcData, iLen); _h265frame->_buffer.append(data, size);
// 写入环形缓存 // 写入环形缓存
RtmpCodec::inputFrame(_h265frame); RtmpCodec::inputFrame(_h265frame);
_h265frame = obtainFrame(); _h265frame = obtainFrame();
#else #else
// 防止内存拷贝这样产生的265帧不会有0x00 00 01头 // 防止内存拷贝这样产生的265帧不会有0x00 00 01头
auto frame = std::make_shared<H265FrameNoCacheAble>((char *)pcData,iLen,dts,pts,0); auto frame = std::make_shared<H265FrameNoCacheAble>((char *)data, size, dts, pts, 0);
RtmpCodec::inputFrame(frame); RtmpCodec::inputFrame(frame);
#endif #endif
} }
@ -185,9 +248,6 @@ bool H265RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
// not config // not config
_rtmp_packet->buffer[1] = true; _rtmp_packet->buffer[1] = true;
int32_t cts = pts - dts; int32_t cts = pts - dts;
if (cts < 0) {
cts = 0;
}
// cts // cts
set_be24(&_rtmp_packet->buffer[2], cts); set_be24(&_rtmp_packet->buffer[2], cts);
@ -207,18 +267,16 @@ void H265RtmpEncoder::makeVideoConfigPkt() {
int8_t flags = FLV_CODEC_H265; int8_t flags = FLV_CODEC_H265;
flags |= (FLV_KEY_FRAME << 4); flags |= (FLV_KEY_FRAME << 4);
bool is_config = true; bool is_config = true;
auto rtmpPkt = RtmpPacket::create(); auto pkt = RtmpPacket::create();
// header // header
rtmpPkt->buffer.push_back(flags); pkt->buffer.push_back(flags);
rtmpPkt->buffer.push_back(!is_config); pkt->buffer.push_back(!is_config);
// cts // cts
rtmpPkt->buffer.append("\x0\x0\x0", 3); pkt->buffer.append("\x0\x0\x0", 3);
struct mpeg4_hevc_t hevc; struct mpeg4_hevc_t hevc;
memset(&hevc, 0, sizeof(hevc)); memset(&hevc, 0, sizeof(hevc));
string vps_sps_pps = string("\x00\x00\x00\x01", 4) + _vps + string vps_sps_pps = string("\x00\x00\x00\x01", 4) + _vps + string("\x00\x00\x00\x01", 4) + _sps + string("\x00\x00\x00\x01", 4) + _pps;
string("\x00\x00\x00\x01", 4) + _sps +
string("\x00\x00\x00\x01", 4) + _pps;
h265_annexbtomp4(&hevc, vps_sps_pps.data(), (int)vps_sps_pps.size(), NULL, 0, NULL, NULL); h265_annexbtomp4(&hevc, vps_sps_pps.data(), (int)vps_sps_pps.size(), NULL, 0, NULL, NULL);
uint8_t extra_data[1024]; uint8_t extra_data[1024];
int extra_data_size = mpeg4_hevc_decoder_configuration_record_save(&hevc, extra_data, sizeof(extra_data)); int extra_data_size = mpeg4_hevc_decoder_configuration_record_save(&hevc, extra_data, sizeof(extra_data));
@ -227,13 +285,13 @@ void H265RtmpEncoder::makeVideoConfigPkt() {
return; return;
} }
// HEVCDecoderConfigurationRecord // HEVCDecoderConfigurationRecord
rtmpPkt->buffer.append((char *)extra_data, extra_data_size); pkt->buffer.append((char *)extra_data, extra_data_size);
rtmpPkt->body_size = rtmpPkt->buffer.size(); pkt->body_size = pkt->buffer.size();
rtmpPkt->chunk_id = CHUNK_VIDEO; pkt->chunk_id = CHUNK_VIDEO;
rtmpPkt->stream_index = STREAM_MEDIA; pkt->stream_index = STREAM_MEDIA;
rtmpPkt->time_stamp = 0; pkt->time_stamp = 0;
rtmpPkt->type_id = MSG_VIDEO; pkt->type_id = MSG_VIDEO;
RtmpCodec::inputRtmp(rtmpPkt); RtmpCodec::inputRtmp(pkt);
#else #else
WarnL << "请开启MP4相关功能并使能\"ENABLE_MP4\",否则对H265-RTMP支持不完善"; WarnL << "请开启MP4相关功能并使能\"ENABLE_MP4\",否则对H265-RTMP支持不完善";
#endif #endif

View File

@ -25,7 +25,7 @@ public:
using Ptr = std::shared_ptr<H265RtmpDecoder>; using Ptr = std::shared_ptr<H265RtmpDecoder>;
H265RtmpDecoder(); H265RtmpDecoder();
~H265RtmpDecoder() {} ~H265RtmpDecoder() = default;
/** /**
* 265 Rtmp包 * 265 Rtmp包
@ -33,15 +33,16 @@ public:
*/ */
void inputRtmp(const RtmpPacket::Ptr &rtmp) override; void inputRtmp(const RtmpPacket::Ptr &rtmp) override;
CodecId getCodecId() const override{ CodecId getCodecId() const override { return CodecH265; }
return CodecH265;
}
protected: protected:
void onGetH265(const char *pcData, size_t iLen, uint32_t dts,uint32_t pts);
H265Frame::Ptr obtainFrame(); H265Frame::Ptr obtainFrame();
void onGetH265(const char *data, size_t size, uint32_t dts, uint32_t pts);
void splitFrame(const uint8_t *data, size_t size, uint32_t dts, uint32_t pts);
protected: protected:
RtmpPacketInfo _info;
H265Frame::Ptr _h265frame; H265Frame::Ptr _h265frame;
}; };

View File

@ -258,6 +258,55 @@ void RtmpHandshake::random_generate(char *bytes, int size)
} }
} }
CodecId parseVideoRtmpPacket(const uint8_t *data, size_t size, RtmpPacketInfo *info) {
RtmpPacketInfo save;
info = info ? info : &save;
info->codec = CodecInvalid;
CHECK(size > 0);
if (data[0] >> 7 == 1) {
// IsExHeader == 1
CHECK(size >= 5, "Invalid rtmp buffer size: ", size);
info->is_enhanced = true;
info->video.frame_type = (RtmpFrameType)((data[0] >> 4) & 0x07);
info->video.pkt_type = (RtmpPacketType)(data[0] & 0x0f);
if (memcmp(data + 1, "av01", 4) == 0) {
// AV1
info->codec = CodecAV1;
} else if (memcmp(data + 1, "vp09", 4) == 0) {
// VP9
info->codec = CodecVP9;
} else if (memcmp(data + 1, "hvc1", 4) == 0) {
// HEVC(H265)
info->codec = CodecH265;
} else {
WarnL << "Rtmp video codec not supported: " << std::string((char *)data + 1, 4);
}
} else {
// IsExHeader == 0
info->is_enhanced = false;
info->video.frame_type = (RtmpFrameType)(data[0] >> 4);
info->video.rtmp_codec = (RtmpVideoCodec)(data[0] & 0x0f);
switch (info->video.rtmp_codec) {
case RtmpVideoCodec::h264: {
CHECK(size >= 1, "Invalid rtmp buffer size: ", size);
info->codec = CodecH264;
info->video.h264_pkt_type = (RtmpH264PacketType)data[1];
break;
}
case RtmpVideoCodec::h265: {
CHECK(size >= 1, "Invalid rtmp buffer size: ", size);
info->codec = CodecH265;
info->video.h264_pkt_type = (RtmpH264PacketType)data[1];
break;
}
default: WarnL << "Rtmp video codec not supported: " << (int)info->video.rtmp_codec; break;
}
}
return info->codec;
}
}//namespace mediakit }//namespace mediakit
namespace toolkit { namespace toolkit {

View File

@ -269,5 +269,72 @@ private:
//根据音频track获取flags //根据音频track获取flags
uint8_t getAudioRtmpFlags(const Track::Ptr &track); uint8_t getAudioRtmpFlags(const Track::Ptr &track);
enum class RtmpFrameType : uint8_t {
reserved = 0,
key_frame = 1, // key frame (for AVC, a seekable frame)
inter_frame = 2, // inter frame (for AVC, a non-seekable frame)
disposable_inter_frame = 3, // disposable inter frame (H.263 only)
generated_key_frame = 4, // generated key frame (reserved for server use only)
video_info_frame = 5, // video info/command frame
};
enum class RtmpVideoCodec : uint8_t {
h263 = 2, // Sorenson H.263
screen_video = 3, // Screen video
vp6 = 4, // On2 VP6
vp6_alpha = 5, // On2 VP6 with alpha channel
screen_video2 = 6, // Screen video version 2
h264 = 7, // avc
h265 = 12, // 国内扩展
};
enum class RtmpH264PacketType : uint8_t {
h264_config_header = 0, // AVC sequence header(sps/pps)
h264_nalu = 1, // AVC NALU
h264_end_seq = 2, // AVC end of sequence (lower level NALU sequence ender is not REQUIRED or supported)
};
enum class RtmpPacketType : uint8_t {
PacketTypeSequenceStart = 0,
PacketTypeCodedFrames = 1,
PacketTypeSequenceEnd = 2,
// CompositionTime Offset is implied to equal zero. This is
// an optimization to save putting SI24 composition time value of zero on
// the wire. See pseudo code below in the VideoTagBody section
PacketTypeCodedFramesX = 3,
// VideoTagBody does not contain video data. VideoTagBody
// instead contains an AMF encoded metadata. See Metadata Frame
// section for an illustration of its usage. As an example, the metadata
// can be HDR information. This is a good way to signal HDR
// information. This also opens up future ways to express additional
// metadata that is meant for the next video sequence.
//
// note: presence of PacketTypeMetadata means that FrameType
// flags at the top of this table should be ignored
PacketTypeMetadata = 4,
// Carriage of bitstream in MPEG-2 TS format
// note: PacketTypeSequenceStart and PacketTypeMPEG2TSSequenceStart
// are mutually exclusive
PacketTypeMPEG2TSSequenceStart = 5,
};
struct RtmpPacketInfo {
CodecId codec = CodecInvalid;
bool is_enhanced;
union {
struct {
RtmpFrameType frame_type;
RtmpVideoCodec rtmp_codec;
RtmpPacketType pkt_type;
RtmpH264PacketType h264_pkt_type;
} video;
};
};
// https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf
CodecId parseVideoRtmpPacket(const uint8_t *data, size_t size, RtmpPacketInfo *info = nullptr);
}//namespace mediakit }//namespace mediakit
#endif//__rtmp_h #endif//__rtmp_h

View File

@ -75,14 +75,20 @@ bool RtmpDemuxer::loadMetaData(const AMFValue &val){
} }
if (key == "videodatarate") { if (key == "videodatarate") {
videodatarate = val.as_integer(); videodatarate = val.as_integer();
_videodatarate = videodatarate * 1024;
return; return;
} }
}); });
if (videocodecid) { if (videocodecid) {
// 有视频 // 有视频
ret = true; ret = true;
if (videocodecid->type() == AMF_NUMBER && videocodecid->as_integer() == (int)RtmpVideoCodec::h264) {
// https://github.com/veovera/enhanced-rtmp/issues/8
_complete_delay = true;
} else {
makeVideoTrack(*videocodecid, videodatarate * 1024); makeVideoTrack(*videocodecid, videodatarate * 1024);
} }
}
if (audiocodecid) { if (audiocodecid) {
// 有音频 // 有音频
ret = true; ret = true;
@ -92,7 +98,7 @@ bool RtmpDemuxer::loadMetaData(const AMFValue &val){
WarnL << ex.what(); WarnL << ex.what();
} }
if (ret) { if (ret && !_complete_delay) {
// metadata中存在track相关的描述那么我们根据metadata判断有多少个track // metadata中存在track相关的描述那么我们根据metadata判断有多少个track
addTrackCompleted(); addTrackCompleted();
} }
@ -108,8 +114,14 @@ void RtmpDemuxer::inputRtmp(const RtmpPacket::Ptr &pkt) {
case MSG_VIDEO: { case MSG_VIDEO: {
if (!_try_get_video_track) { if (!_try_get_video_track) {
_try_get_video_track = true; _try_get_video_track = true;
auto codec = AMFValue(pkt->getMediaType()); RtmpPacketInfo info;
makeVideoTrack(codec, 0); auto codec_id = parseVideoRtmpPacket((uint8_t *)pkt->data(), pkt->size(), &info);
if (codec_id != CodecInvalid) {
makeVideoTrack(Factory::getTrackByCodecId(codec_id), _videodatarate);
if (_complete_delay) {
addTrackCompleted();
}
}
} }
if (_video_rtmp_decoder) { if (_video_rtmp_decoder) {
_video_rtmp_decoder->inputRtmp(pkt); _video_rtmp_decoder->inputRtmp(pkt);
@ -133,11 +145,15 @@ void RtmpDemuxer::inputRtmp(const RtmpPacket::Ptr &pkt) {
} }
void RtmpDemuxer::makeVideoTrack(const AMFValue &videoCodec, int bit_rate) { void RtmpDemuxer::makeVideoTrack(const AMFValue &videoCodec, int bit_rate) {
makeVideoTrack(Factory::getVideoTrackByAmf(videoCodec), bit_rate);
}
void RtmpDemuxer::makeVideoTrack(const Track::Ptr &track, int bit_rate) {
if (_video_rtmp_decoder) { if (_video_rtmp_decoder) {
return; return;
} }
// 生成Track对象 // 生成Track对象
_video_track = dynamic_pointer_cast<VideoTrack>(Factory::getVideoTrackByAmf(videoCodec)); _video_track = dynamic_pointer_cast<VideoTrack>(track);
if (!_video_track) { if (!_video_track) {
return; return;
} }

View File

@ -45,12 +45,15 @@ public:
private: private:
void makeVideoTrack(const AMFValue &val, int bit_rate); void makeVideoTrack(const AMFValue &val, int bit_rate);
void makeVideoTrack(const Track::Ptr &val, int bit_rate);
void makeAudioTrack(const AMFValue &val, int sample_rate, int channels, int sample_bit, int bit_rate); void makeAudioTrack(const AMFValue &val, int sample_rate, int channels, int sample_bit, int bit_rate);
private: private:
bool _try_get_video_track = false; bool _try_get_video_track = false;
bool _try_get_audio_track = false; bool _try_get_audio_track = false;
bool _complete_delay = false;
float _duration = 0; float _duration = 0;
int _videodatarate = 0;
AudioTrack::Ptr _audio_track; AudioTrack::Ptr _audio_track;
VideoTrack::Ptr _video_track; VideoTrack::Ptr _video_track;
RtmpCodec::Ptr _audio_rtmp_decoder; RtmpCodec::Ptr _audio_rtmp_decoder;

View File

@ -191,6 +191,13 @@ void RtmpPlayer::send_connect() {
obj.set("audioCodecs", (double) (0x0400)); obj.set("audioCodecs", (double) (0x0400));
//只支持H264 //只支持H264
obj.set("videoCodecs", (double) (0x0080)); obj.set("videoCodecs", (double) (0x0080));
AMFValue fourCcList(AMF_STRICT_ARRAY);
fourCcList.add("av01");
fourCcList.add("vp09");
fourCcList.add("hvc1");
obj.set("fourCcList", fourCcList);
sendInvoke("connect", obj); sendInvoke("connect", obj);
addOnResultCB([this](AMFDecoder &dec) { addOnResultCB([this](AMFDecoder &dec) {
//TraceL << "connect result"; //TraceL << "connect result";

View File

@ -135,6 +135,13 @@ void RtmpPusher::send_connect() {
obj.set("type", "nonprivate"); obj.set("type", "nonprivate");
obj.set("tcUrl", _tc_url); obj.set("tcUrl", _tc_url);
obj.set("swfUrl", _tc_url); obj.set("swfUrl", _tc_url);
AMFValue fourCcList(AMF_STRICT_ARRAY);
fourCcList.add("av01");
fourCcList.add("vp09");
fourCcList.add("hvc1");
obj.set("fourCcList", fourCcList);
sendInvoke("connect", obj); sendInvoke("connect", obj);
addOnResultCB([this](AMFDecoder &dec) { addOnResultCB([this](AMFDecoder &dec) {
//TraceL << "connect result"; //TraceL << "connect result";