Skip to content

Instantly share code, notes, and snippets.

@prabindh
Created July 28, 2020 07:11
Show Gist options
  • Save prabindh/42217b1ba27135ade7b218ab0af03995 to your computer and use it in GitHub Desktop.
Save prabindh/42217b1ba27135ade7b218ab0af03995 to your computer and use it in GitHub Desktop.
FFMPEG logging
// av_log_set_callback(ffmpeg_avcodec_log);
static void ffmpeg_avcodec_log(void *ptr, int val, const char * msg, va_list
ap)
{
AVClass* avc = ptr ? *(AVClass**)ptr : NULL;
FILE *flog = fopen("stream-receiver.log", "a");
if (avc)
{
fprintf(flog, "[%s @ %p] ", avc->item_name(ptr), avc);
}
vfprintf(flog, msg, ap);
fclose(flog);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment