| | |
| | | #include <stdlib.h> |
| | | #include <memory> |
| | | #include <string> |
| | | #include <vector> |
| | | |
| | | struct AVFormatContext; |
| | | struct AVStream; |
| | |
| | | struct AVFrame; |
| | | struct AVPacket; |
| | | struct AVDictionary; |
| | | struct AVBSFContext; |
| | | |
| | | namespace ffwrapper{ |
| | | class VideoProp; |
| | |
| | | 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); |
| | |
| | | double fps_; |
| | | std::string format_name_; |
| | | |
| | | AVBSFContext *bsf_h264, *bsf_hevc; |
| | | // rec |
| | | AVFormatContext *in_ctx_; |
| | | AVStream *in_v_stream_; |
| | | AVStream *in_a_stream_; |
| | | }; |
| | | } |
| | | #endif |