X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mux.h;h=e6193e0a36c92ec0258f3680df597a37f15ce26f;hb=ffd68fbfb90242069af957f2a28908f0559f8348;hp=5bf3e413014e7f0de6caf1e992e2747dc573fe98;hpb=f932301ce7f23ef4c14dd0d4f52dee662d0b4ef6;p=nageru diff --git a/mux.h b/mux.h index 5bf3e41..e6193e0 100644 --- a/mux.h +++ b/mux.h @@ -18,6 +18,8 @@ extern "C" { #include #include +#include "timebase.h" + struct MuxMetrics { // “written” will usually be equal video + audio + mux overhead, // except that there could be buffered packets that count in audio or video @@ -60,7 +62,7 @@ public: // will be added to. Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const std::string &video_extradata, const AVCodecParameters *audio_codecpar, int time_base, std::function write_callback, WriteStrategy write_strategy, const std::vector &metrics); ~Mux(); - void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts); + void add_packet(const AVPacket &pkt, int64_t pts, int64_t dts, AVRational timebase = { 1, TIMEBASE }); // As long as the mux is plugged, it will not actually write anything to disk, // just queue the packets. Once it is unplugged, the packets are reordered by pts