video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-09-20 be9c1d1f659b0ff31f656424c478e83a4f7c53b5
csrc/ffmpeg/format/FormatOut.hpp
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <memory>
#include <string>
#include <vector>
struct AVFormatContext;
struct AVStream;
@@ -26,7 +27,7 @@
      FormatOut(VideoProp &prop,
            const char *filename, char *format_name = NULL);
      FormatOut(AVStream *in, const char *format_name);
      FormatOut(const double fps, const char *format_name);
      void clear();
   public:
@@ -39,14 +40,15 @@
      int encode(std::shared_ptr<CodedData> &data,AVFrame *frame);
   public:
      bool copyCodecFromIn(AVStream *in);
      bool copyCodecFromIn(std::vector<AVStream*> in);
      bool openResource(const char *filename, const int flags);
      bool closeResource();
      bool JustWriter(AVStream *in, const char *filename);
      bool JustWriter(std::vector<AVStream*> in, const char *filename);
      bool EncodeWriter(const char *filename);
      bool writeFrame(AVPacket &pkt, const int64_t &frame_cnt, bool interleaved = true);
      void adjustPTS(AVPacket &pkt, const int64_t &frame_cnt);
      void adjustVideoPTS(AVPacket &pkt, const int64_t &frame_cnt);
      bool endWriter();
      bool writeHeader(AVDictionary **options = NULL);
@@ -75,6 +77,8 @@
      double                fps_;
      std::string          format_name_;
      // rec
      std::vector<AVStream*>   streams_;
   };
}
#endif