Commit afa64651 by Alexandr

Changes to MP4Muxer for CodecJPEG

parent 8bcc2cdd
......@@ -15,6 +15,7 @@
#include "Extension/G711.h"
#include "Extension/H264.h"
#include "Extension/H265.h"
#include "Extension/JPEG.h"
#include "Common/config.h"
using namespace std;
......@@ -145,6 +146,7 @@ static uint8_t getObject(CodecId codecId) {
case CodecAAC : return MOV_OBJECT_AAC;
case CodecH264 : return MOV_OBJECT_H264;
case CodecH265 : return MOV_OBJECT_HEVC;
case CodecJPEG : return MOV_OBJECT_JPEG;
default : return 0;
}
}
......@@ -302,6 +304,28 @@ bool MP4MuxerInterface::addTrack(const Track::Ptr &track) {
break;
}
case CodecJPEG: {
auto jpeg_track = dynamic_pointer_cast<JPEGTrack>(track);
if (!jpeg_track) {
WarnL << "不是JPEG Track";
return false;
}
auto track_id = mp4_writer_add_video(_mov_writter.get(),
mp4_object,
jpeg_track->getVideoWidth(),
jpeg_track->getVideoHeight(),
nullptr,
0);
if (track_id < 0) {
WarnL << "添加JPEG Track失败:" << track_id;
return false;
}
_codec_to_trackid[track->getCodecId()].track_id = track_id;
_have_video = true;
break;
}
default: WarnL << "MP4录制不支持该编码格式:" << track->getCodecName(); return false;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论