video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2023-12-26 18a05d269516a5e33d8460291c2f93e73d95adce
csrc/ffmpeg/format/FormatOut.hpp
@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <memory>
#include <string>
#include <vector>
struct AVFormatContext;
struct AVStream;
@@ -12,6 +11,7 @@
struct AVFrame;
struct AVPacket;
struct AVDictionary;
struct AVBSFContext;
namespace ffwrapper{
   class VideoProp;
@@ -35,18 +35,19 @@
      int encode(AVPacket *pkt, AVFrame *frame);
   public:
      bool copyCodecFromIn(std::vector<AVStream*> in);
      bool addStream(AVStream *s);
      bool copyCodecFromIn(AVStream *v, AVStream *a);
      bool openResource(const char *filename, const int flags);
      bool closeResource();
      bool JustWriter(std::vector<AVStream*> in, const char *filename);
      bool JustWriter(AVStream *v, AVStream *a, 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);
      bool endWriter();
      bool writeHeader(AVDictionary **options = NULL);
      bool writeFrame2(AVPacket *pkt, bool interleaved);
      bool writeFrameInternal(AVPacket *pkt, bool interleaved);
      bool writeTrailer();
   public:
      AVStream *getStream();
@@ -65,6 +66,8 @@
      int                a_idx_;
      AVCodecContext          *enc_ctx_;
        AVBSFContext            *bsf_h264, *bsf_hevc;
      int64_t                sync_opts_;
      bool                record_;
@@ -73,7 +76,8 @@
      std::string          format_name_;
      // rec
      std::vector<AVStream*>  in_streams_;
      AVStream              *in_v_stream_;
      AVStream              *in_a_stream_;
   };
}
#endif