From a8b447be656145c9ba2a2d8319a10ae8f726de1f Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期五, 09 十月 2020 18:20:46 +0800 Subject: [PATCH] h264 mp4 --- csrc/ffmpeg/format/FormatOut.hpp | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/csrc/ffmpeg/format/FormatOut.hpp b/csrc/ffmpeg/format/FormatOut.hpp index fc6fa1b..0d746fc 100644 --- a/csrc/ffmpeg/format/FormatOut.hpp +++ b/csrc/ffmpeg/format/FormatOut.hpp @@ -4,7 +4,6 @@ #include <stdlib.h> #include <memory> #include <string> -#include <vector> struct AVFormatContext; struct AVStream; @@ -35,18 +34,19 @@ int encode(AVPacket *pkt, AVFrame *frame); public: - bool copyCodecFromIn(AVFormatContext* in); + bool addStream(AVStream *s); + bool copyCodecFromIn(AVStream *v, AVStream *a); bool openResource(const char *filename, const int flags); bool closeResource(); - bool JustWriter(AVFormatContext* 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(); @@ -73,7 +73,8 @@ std::string format_name_; // rec - AVFormatContext *in_ctx_; + AVStream *in_v_stream_; + AVStream *in_a_stream_; }; } #endif \ No newline at end of file -- Gitblit v1.8.0