Skip to content

Instantly share code, notes, and snippets.

View prabindh's full-sized avatar
💭
I may be slow to respond.

Prabindh Sundareson prabindh

💭
I may be slow to respond.
View GitHub Profile
@prabindh
prabindh / save_packet_to_disk
Created May 5, 2020 08:09 — forked from sunjun/save_packet_to_disk
save AVPacket from mem to disk and then read back
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
static FILE *open_file_write(const char *file);
static FILE *open_file_read(const char *file);
static size_t write_packt_to_file(AVPacket *packet, FILE *file);
static size_t read_packt_from_file(AVPacket *packet, FILE *file);
static void close_file(FILE *file);
static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, const char *tag)