Int size2 = avpicture_get_size(PIX_FMT_RGB24, ccontext->width, ccontext->height) Uint8_t* picture_buf = (uint8_t*)(av_malloc(size)) Int size = avpicture_get_size(PIX_FMT_YUV420P, ccontext->width, ccontext->height) PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL) If (avcodec_open(ccontext, codec) width, ccontext->height, ccontext->pix_fmt, ccontext->width, ccontext->height, start reading packets from stream and write them to fileĬodec = avcodec_find_decoder(CODEC_ID_H264) Īvcodec_get_context_defaults3(ccontext, codec) Īvcodec_copy_context(ccontext,context->streams->codec) avio_open2(&oc->pb, "test.mp4", AVIO_FLAG_WRITE,NULL,NULL) AVOutputFormat* fmt = av_guess_format(NULL,"test2.mp4",NULL) ĪVFormatContext* oc = avformat_alloc_context() If(context->streams->codec->codec_type = AVMEDIA_TYPE_VIDEO) Vsnprintf_s(message, sizeof(message), fmt, vargs) Void log_callback(void *ptr, int level, const char *fmt, va_list vargs) For rtsp streams the following is anycodings_rtsp working for me (after receiving frames i anycodings_rtsp save the result to a ppm file): #include
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |