From be9c1d1f659b0ff31f656424c478e83a4f7c53b5 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期五, 20 九月 2019 11:44:19 +0800 Subject: [PATCH] update ffmpeg --- csrc/ffmpeg/format/FormatOut.hpp | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/csrc/ffmpeg/format/FormatOut.hpp b/csrc/ffmpeg/format/FormatOut.hpp index 35575d7..2fbe47b 100644 --- a/csrc/ffmpeg/format/FormatOut.hpp +++ b/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 \ No newline at end of file -- Gitblit v1.8.0