提交 bf64a600 authored 作者: blu's avatar blu

init

上级 dc21689e
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace fs = std::filesystem; namespace fs = std::filesystem;
#endif #endif
#include <cstdlib> #include <cstdlib>
#include <opencv2/opencv.hpp>
#include "vendor/include/zmq.h" #include "vendor/include/zmq.h"
#include "tinythread.hpp" #include "tinythread.hpp"
#include "common.hpp" #include "common.hpp"
...@@ -39,6 +40,7 @@ private: ...@@ -39,6 +40,7 @@ private:
// load from db // load from db
vector<int> *sliceIdxToName = NULL; vector<int> *sliceIdxToName = NULL;
int *streamList = NULL; int *streamList = NULL;
int streamIdx = 0;
int init() int init()
{ {
...@@ -219,19 +221,18 @@ private: ...@@ -219,19 +221,18 @@ private:
//spdlog::info("evmlmotion {} {} numStreams: {:d}", sn, iid, pAVFormatInput->nb_streams); //spdlog::info("evmlmotion {} {} numStreams: {:d}", sn, iid, pAVFormatInput->nb_streams);
int streamIdx = 0;
// find all video & audio streams for remuxing // find all video & audio streams for remuxing
streamList = (int *)av_mallocz_array(pAVFormatInput->nb_streams, sizeof(*streamList)); streamList = (int *)av_mallocz_array(pAVFormatInput->nb_streams, sizeof(*streamList));
for (int i = 0; i < pAVFormatInput->nb_streams; i++) { for (int i = 0; i < pAVFormatInput->nb_streams; i++) {
AVStream *out_stream; AVStream *out_stream;
AVStream *in_stream = pAVFormatInput->streams[i]; AVStream *in_stream = pAVFormatInput->streams[i];
AVCodecParameters *in_codecpar = in_stream->codecpar; AVCodecParameters *in_codecpar = in_stream->codecpar;
if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO && if (in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
streamList[i] = -1; streamList[i] = -1;
continue; continue;
} }
streamList[i] = streamIdx++; streamList[i] = streamIdx++;
break;
} }
for(int i = 0; i < pAVFormatInput->nb_streams; i++ ) { for(int i = 0; i < pAVFormatInput->nb_streams; i++ ) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论