mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
ts or ps muxer not support mjpeg video codec ignore it (#2593)
This commit is contained in:
parent
2ad44bc773
commit
d5bf99a27b
@ -40,7 +40,7 @@ typedef enum {
|
||||
XX(CodecVP8, TrackVideo, 7, "VP8", PSI_STREAM_VP8) \
|
||||
XX(CodecVP9, TrackVideo, 8, "VP9", PSI_STREAM_VP9) \
|
||||
XX(CodecAV1, TrackVideo, 9, "AV1", PSI_STREAM_AV1) \
|
||||
XX(CodecJPEG, TrackVideo, 10, "JPEG", PSI_STREAM_JPEG_2000)
|
||||
XX(CodecJPEG, TrackVideo, 10, "JPEG", PSI_STREAM_RESERVED)
|
||||
|
||||
typedef enum {
|
||||
CodecInvalid = -1,
|
||||
|
@ -30,19 +30,18 @@ MpegMuxer::~MpegMuxer() {
|
||||
releaseContext();
|
||||
}
|
||||
|
||||
#define XX(name, type, value, str, mpeg_id) \
|
||||
case name : { \
|
||||
if (mpeg_id == PSI_STREAM_RESERVED) { \
|
||||
break; \
|
||||
} \
|
||||
_codec_to_trackid[track->getCodecId()] = mpeg_muxer_add_stream((::mpeg_muxer_t *)_context, mpeg_id, nullptr, 0); \
|
||||
return true; \
|
||||
#define XX(name, type, value, str, mpeg_id) \
|
||||
case name: { \
|
||||
if (mpeg_id == PSI_STREAM_RESERVED) { \
|
||||
break; \
|
||||
} \
|
||||
if (track->getTrackType() == TrackVideo) { \
|
||||
_have_video = true; \
|
||||
} \
|
||||
_codec_to_trackid[track->getCodecId()] = mpeg_muxer_add_stream((::mpeg_muxer_t *)_context, mpeg_id, nullptr, 0); \
|
||||
return true; \
|
||||
}
|
||||
|
||||
bool MpegMuxer::addTrack(const Track::Ptr &track) {
|
||||
if (track->getTrackType() == TrackVideo) {
|
||||
_have_video = true;
|
||||
}
|
||||
switch (track->getCodecId()) {
|
||||
CODEC_MAP(XX)
|
||||
default: break;
|
||||
@ -85,6 +84,11 @@ bool MpegMuxer::inputFrame(const Frame::Ptr &frame) {
|
||||
//没有视频时,才以音频时间戳为TS的时间戳
|
||||
_timestamp = frame->dts();
|
||||
}
|
||||
|
||||
if(frame->getTrackType() == TrackType::TrackVideo){
|
||||
_key_pos = frame->keyFrame();
|
||||
_timestamp = frame->dts();
|
||||
}
|
||||
_max_cache_size = 512 + 1.2 * frame->size();
|
||||
mpeg_muxer_input((::mpeg_muxer_t *)_context, track_id, frame->keyFrame() ? 0x0001 : 0, frame->pts() * 90LL, frame->dts() * 90LL, frame->data(), frame->size());
|
||||
flushCache();
|
||||
|
Loading…
Reference in New Issue
Block a user