void CMFCApplication1Dlg::Initffmpeg() { av_register_all(); avdevice_register_all(); if(iformat == NULL) iformat = av_find_input_format("dshow"); if(!iformat) { MessageBox(_T("錯誤!找不到設備!"), _T("錯誤")); return; } if(pFormatCtx == NULL) { pFormatCtx = avformat_alloc_context(); pFormatCtx->iformat = iformat; char buf[1024]; int err_code; if( err_code=avformat_open_input(&pFormatCtx, filenameSrc, NULL, NULL) ) { av_strerror( err_code , buf, 1024); CString strMEss; strMEss.Format(_T("Couldn't open file %s: %d(%s)\r\n"), err_code , buf); MessageBox(strMEss, _T("錯誤")); return; } if(avformat_find_stream_info(pFormatCtx, NULL) < 0) { MessageBox(_T("錯誤!stream_info error!"), _T("錯誤")); return; } } } void CMFCApplication1Dlg::OnStartThred() { bStop = FALSE; videoStream = -1; for(i=0; i<pFormatCtx->nb_streams; i++) { if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { videoStream=i; break; } } if(videoStream==-1) { MessageBox(_T("Can't Find Video Stream"), _T("錯誤")); return; } pCodecCtx = pFormatCtx->streams[videoStream]->codec; pCodec = avcodec_find_decoder(pCodecCtx->codec_id); if(pCodec == NULL) { MessageBox(_T("Unsupported codec!\n"), _T("錯誤")); return; } if(avcodec_open2(pCodecCtx, pCodec, &optionsDict) < 0) { MessageBox(_T("Could not open codec!\n"), _T("錯誤")); return; } /////////////////////////////////////// pFrame = av_frame_alloc(); pFrameRGB = av_frame_alloc(); numBytes=avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); sws_ctx = sws_getContext ( pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height, AV_PIX_FMT_YUV420P, SWS_BILINEAR, NULL, NULL, NULL ); avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); codec = avcodec_find_encoder(AV_CODEC_ID_H264); if (!codec) { MessageBox(_T("Could not open codec H264!"), _T("錯誤")); return; } codeccontext = avcodec_alloc_context3(codec); if (!codeccontext) { MessageBox(_T("Could not allocate video codec context"), _T("錯誤")); return; } codeccontext->bit_rate = 400000; codeccontext->width = pCodecCtx->width; codeccontext->height = pCodecCtx->height; codeccontext->time_base.num=1; codeccontext->time_base.den=30; codeccontext->gop_size = 10; codeccontext->max_b_frames = 1; codeccontext->pix_fmt = AV_PIX_FMT_YUV420P; codeccontext->flags |= CODEC_FLAG_GLOBAL_HEADER ; av_opt_set(codeccontext->priv_data, "tune", "zerolatency", 0); if (avcodec_open2(codeccontext, codec, NULL) < 0) { MessageBox(_T("Could not open codec codeccontext"), _T("錯誤")); return; } frame = av_frame_alloc(); if (!frame) { MessageBox(_T("Could not allocate video frame"), _T("錯誤")); return; } frame->format = codeccontext->pix_fmt; frame->width = codeccontext->width; frame->height = codeccontext->height; if (avformat_alloc_output_context2(&pFormatFile, NULL, "mp4", outfile) < 0) { MessageBox(_T("alloc file Error!"), _T("錯誤")); return; } avformat_alloc_output_context2(&pFormatURL, NULL, "flv", url); pFormatFile->flags |= CODEC_FLAG_GLOBAL_HEADER; pFormatURL->flags |= CODEC_FLAG_GLOBAL_HEADER; //// AVStream * outStream = GetStream(pFormatFile); AVStream *pURLStream = GetStream(pFormatURL); avio_open(&pFormatFile->pb, outfile, AVIO_FLAG_WRITE); avio_open2(&pFormatURL->pb, url, AVIO_FLAG_WRITE, &pFormatURL->interrupt_callback, NULL); av_dict_set(&optionsDict,"list_devices","true",0); avformat_write_header(pFormatFile, NULL); avformat_write_header(pFormatURL, NULL); last_pts = 0; AVPacket pkt2; int k = 0; while(av_read_frame(pFormatCtx, &packet)>=0) { if(packet.stream_index==videoStream) { avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); if(frameFinished) { sws_scale ( sws_ctx, (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize ); pFrameRGB->pts++; if(!bStop) { av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; av_init_packet(&pkt2); pkt2.data = NULL; pkt2.size = 0; avcodec_encode_video2(outStream->codec, &pkt, pFrameRGB, &got_output); if (got_output) { DoFile(&pkt, outStream); } avcodec_encode_video2(pURLStream->codec, &pkt2, pFrameRGB, &got_output); if (got_output) { Dourl(&pkt2, pURLStream); } delete pkt.data; av_free_packet(&pkt); delete pkt2.data; av_free_packet(&pkt2); } else { break; } } } av_free_packet(&packet); } av_write_trailer(pFormatFile); avcodec_close(outStream->codec) ; av_freep(outStream->codec); av_freep(outStream); avcodec_close(pURLStream->codec) ; av_freep(pURLStream->codec); av_freep(pURLStream); outStream = NULL; pURLStream = NULL; avio_close(pFormatFile->pb); avio_close(pFormatURL->pb); sws_freeContext (sws_ctx); avformat_free_context(pFormatFile); avformat_free_context(pFormatURL); av_free(buffer); av_frame_free(&pFrameRGB); av_frame_free(&frame); av_frame_free(&pFrame); avcodec_close(pCodecCtx); avcodec_close(codeccontext); for (int k = 0; k < pFormatCtx->nb_streams; k++) { avcodec_close(pFormatCtx->streams[k]->codec) ; av_freep(pFormatCtx->streams[k]->codec); av_freep(pFormatCtx->streams[k]); } avio_close(pFormatCtx->pb); pFormatCtx = NULL; avformat_close_input(&pFormatCtx); _CrtDumpMemoryLeaks(); } AVStream * CMFCApplication1Dlg::GetStream(AVFormatContext *pFormatCtx) { AVStream * outStream = avformat_new_stream(pFormatCtx, codec); avcodec_get_context_defaults3(outStream->codec, codec); outStream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; outStream->codec->coder_type = AVMEDIA_TYPE_VIDEO; outStream->codec->pix_fmt = AV_PIX_FMT_YUV420P; outStream->codec->width = pCodecCtx->width; outStream->codec->height = pCodecCtx->height; outStream->codec->codec_id = codec->id; outStream->codec->bit_rate = 500000; outStream->codec->time_base.den = 29; outStream->codec->time_base.num = 1; outStream->codec->gop_size = 50; // Keyframe interval(=GOP length). Determines maximum distance distance between I-frames outStream->codec->keyint_min = 25; // minimum GOP size outStream->codec->max_b_frames = 3;//16; // maximum number of B-frames between non-B-frames outStream->codec->b_frame_strategy = 1; // decides the best number of B-frames to use. Default mode in x264. outStream->codec->scenechange_threshold = 40; outStream->codec->refs = 6; // abillity to reference frames other than the one immediately prior to the current frame. specify how many references can be used. outStream->codec->qmin = 0;//10; outStream->codec->qmax = 69;//51; outStream->codec->qcompress = 0.6; outStream->codec->max_qdiff = 4; outStream->codec->i_quant_factor = 1.4;//0.71; outStream->codec->refs=1;//3; outStream->codec->chromaoffset = -2; outStream->codec->thread_count = 1; outStream->codec->trellis = 1; outStream->codec->me_range = 16; outStream->codec->me_method = ME_HEX; //hex outStream->codec->flags2 |= CODEC_FLAG2_FAST; outStream->codec->coder_type = 1; av_opt_set(outStream->codec->priv_data, "tune", "zerolatency", 0); avcodec_open2(outStream->codec, codec, NULL); return outStream; } void CMFCApplication1Dlg::DoFile(AVPacket *sourcepkt, AVStream *outStream) { if (outStream->codec->coded_frame->key_frame) sourcepkt->flags |= AV_PKT_FLAG_KEY; sourcepkt->stream_index = outStream->index; if (sourcepkt->pts != AV_NOPTS_VALUE) sourcepkt->pts = av_rescale_q(sourcepkt->pts, outStream->codec->time_base, outStream->time_base); if (sourcepkt->dts != AV_NOPTS_VALUE) sourcepkt->dts = av_rescale_q(sourcepkt->dts, outStream->codec->time_base, outStream->time_base); if(av_interleaved_write_frame(pFormatFile, sourcepkt) < 0) {} } void CMFCApplication1Dlg::Dourl(AVPacket *sourcepkt, AVStream *outStream) { if (outStream->codec->coded_frame->key_frame) sourcepkt->flags |= AV_PKT_FLAG_KEY; sourcepkt->stream_index = outStream->index; if (sourcepkt->pts != AV_NOPTS_VALUE) sourcepkt->pts = av_rescale_q(sourcepkt->pts, outStream->codec->time_base, outStream->time_base); if (sourcepkt->dts != AV_NOPTS_VALUE) sourcepkt->dts = av_rescale_q(sourcepkt->dts, outStream->codec->time_base, outStream->time_base); if(av_interleaved_write_frame(pFormatURL, sourcepkt) < 0) {} double time_ms = 0; AVStream* stream = pFormatURL->streams[sourcepkt->stream_index]; if(stream->time_base.den > 0) { time_ms = (sourcepkt->pts - last_pts) * stream->time_base.num * 1000 / stream->time_base.den; } if(time_ms > 500) { av_usleep(time_ms * 1000); last_pts = sourcepkt->pts; } }
Standard input is empty
prog.cpp:1:6: error: ‘CMFCApplication1Dlg’ has not been declared void CMFCApplication1Dlg::Initffmpeg() ^ prog.cpp: In function ‘void Initffmpeg()’: prog.cpp:3:18: error: ‘av_register_all’ was not declared in this scope av_register_all(); ^ prog.cpp:4:24: error: ‘avdevice_register_all’ was not declared in this scope avdevice_register_all(); ^ prog.cpp:5:5: error: ‘iformat’ was not declared in this scope if(iformat == NULL) ^ prog.cpp:5:16: error: ‘NULL’ was not declared in this scope if(iformat == NULL) ^ prog.cpp:6:41: error: ‘av_find_input_format’ was not declared in this scope iformat = av_find_input_format("dshow"); ^ prog.cpp:8:6: error: ‘iformat’ was not declared in this scope if(!iformat) ^ prog.cpp:10:46: error: ‘_T’ was not declared in this scope MessageBox(_T("錯誤!找不到設備!"), _T("錯誤")); ^ prog.cpp:10:61: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("錯誤!找不到設備!"), _T("錯誤")); ^ prog.cpp:14:5: error: ‘pFormatCtx’ was not declared in this scope if(pFormatCtx == NULL) ^ prog.cpp:14:19: error: ‘NULL’ was not declared in this scope if(pFormatCtx == NULL) ^ prog.cpp:16:39: error: ‘avformat_alloc_context’ was not declared in this scope pFormatCtx = avformat_alloc_context(); ^ prog.cpp:17:25: error: ‘iformat’ was not declared in this scope pFormatCtx->iformat = iformat; ^ prog.cpp:20:49: error: ‘filenameSrc’ was not declared in this scope if( err_code=avformat_open_input(&pFormatCtx, filenameSrc, NULL, NULL) ) ^ prog.cpp:20:72: error: ‘avformat_open_input’ was not declared in this scope if( err_code=avformat_open_input(&pFormatCtx, filenameSrc, NULL, NULL) ) ^ prog.cpp:22:37: error: ‘av_strerror’ was not declared in this scope av_strerror( err_code , buf, 1024); ^ prog.cpp:23:4: error: ‘CString’ was not declared in this scope CString strMEss; ^ prog.cpp:23:12: error: expected ‘;’ before ‘strMEss’ CString strMEss; ^ prog.cpp:24:4: error: ‘strMEss’ was not declared in this scope strMEss.Format(_T("Couldn't open file %s: %d(%s)\r\n"), err_code , buf); ^ prog.cpp:24:57: error: ‘_T’ was not declared in this scope strMEss.Format(_T("Couldn't open file %s: %d(%s)\r\n"), err_code , buf); ^ prog.cpp:25:36: error: ‘MessageBox’ was not declared in this scope MessageBox(strMEss, _T("錯誤")); ^ prog.cpp:29:48: error: ‘avformat_find_stream_info’ was not declared in this scope if(avformat_find_stream_info(pFormatCtx, NULL) < 0) ^ prog.cpp:31:49: error: ‘_T’ was not declared in this scope MessageBox(_T("錯誤!stream_info error!"), _T("錯誤")); ^ prog.cpp:31:64: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("錯誤!stream_info error!"), _T("錯誤")); ^ prog.cpp: At global scope: prog.cpp:37:6: error: ‘CMFCApplication1Dlg’ has not been declared void CMFCApplication1Dlg::OnStartThred() ^ prog.cpp: In function ‘void OnStartThred()’: prog.cpp:39:2: error: ‘bStop’ was not declared in this scope bStop = FALSE; ^ prog.cpp:39:10: error: ‘FALSE’ was not declared in this scope bStop = FALSE; ^ prog.cpp:40:2: error: ‘videoStream’ was not declared in this scope videoStream = -1; ^ prog.cpp:41:6: error: ‘i’ was not declared in this scope for(i=0; i<pFormatCtx->nb_streams; i++) ^ prog.cpp:41:13: error: ‘pFormatCtx’ was not declared in this scope for(i=0; i<pFormatCtx->nb_streams; i++) ^ prog.cpp:43:49: error: ‘AVMEDIA_TYPE_VIDEO’ was not declared in this scope if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) ^ prog.cpp:52:42: error: ‘_T’ was not declared in this scope MessageBox(_T("Can't Find Video Stream"), _T("錯誤")); ^ prog.cpp:52:57: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("Can't Find Video Stream"), _T("錯誤")); ^ prog.cpp:56:2: error: ‘pCodecCtx’ was not declared in this scope pCodecCtx = pFormatCtx->streams[videoStream]->codec; ^ prog.cpp:56:14: error: ‘pFormatCtx’ was not declared in this scope pCodecCtx = pFormatCtx->streams[videoStream]->codec; ^ prog.cpp:57:2: error: ‘pCodec’ was not declared in this scope pCodec = avcodec_find_decoder(pCodecCtx->codec_id); ^ prog.cpp:57:51: error: ‘avcodec_find_decoder’ was not declared in this scope pCodec = avcodec_find_decoder(pCodecCtx->codec_id); ^ prog.cpp:58:15: error: ‘NULL’ was not declared in this scope if(pCodec == NULL) ^ prog.cpp:60:39: error: ‘_T’ was not declared in this scope MessageBox(_T("Unsupported codec!\n"), _T("錯誤")); ^ prog.cpp:60:54: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("Unsupported codec!\n"), _T("錯誤")); ^ prog.cpp:64:39: error: ‘optionsDict’ was not declared in this scope if(avcodec_open2(pCodecCtx, pCodec, &optionsDict) < 0) ^ prog.cpp:64:50: error: ‘avcodec_open2’ was not declared in this scope if(avcodec_open2(pCodecCtx, pCodec, &optionsDict) < 0) ^ prog.cpp:66:42: error: ‘_T’ was not declared in this scope MessageBox(_T("Could not open codec!\n"), _T("錯誤")); ^ prog.cpp:66:57: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("Could not open codec!\n"), _T("錯誤")); ^ prog.cpp:71:2: error: ‘pFrame’ was not declared in this scope pFrame = av_frame_alloc(); ^ prog.cpp:71:26: error: ‘av_frame_alloc’ was not declared in this scope pFrame = av_frame_alloc(); ^ prog.cpp:72:2: error: ‘pFrameRGB’ was not declared in this scope pFrameRGB = av_frame_alloc(); ^ prog.cpp:73:2: error: ‘numBytes’ was not declared in this scope numBytes=avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); ^ prog.cpp:73:30: error: ‘AV_PIX_FMT_YUV420P’ was not declared in this scope numBytes=avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); ^ prog.cpp:73:85: error: ‘avpicture_get_size’ was not declared in this scope numBytes=avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); ^ prog.cpp:74:2: error: ‘buffer’ was not declared in this scope buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); ^ prog.cpp:74:10: error: ‘uint8_t’ was not declared in this scope buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); ^ prog.cpp:74:19: error: expected primary-expression before ‘)’ token buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); ^ prog.cpp:74:20: error: expected ‘;’ before ‘av_malloc’ buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); ^ prog.cpp:76:2: error: ‘sws_ctx’ was not declared in this scope sws_ctx = ^ prog.cpp:85:9: error: ‘SWS_BILINEAR’ was not declared in this scope SWS_BILINEAR, ^ prog.cpp:86:9: error: ‘NULL’ was not declared in this scope NULL, ^ prog.cpp:89:5: error: ‘sws_getContext’ was not declared in this scope ); ^ prog.cpp:91:18: error: ‘AVPicture’ was not declared in this scope avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); ^ prog.cpp:91:29: error: expected primary-expression before ‘)’ token avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); ^ prog.cpp:91:104: error: ‘avpicture_fill’ was not declared in this scope avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); ^ prog.cpp:92:2: error: ‘codec’ was not declared in this scope codec = avcodec_find_encoder(AV_CODEC_ID_H264); ^ prog.cpp:92:31: error: ‘AV_CODEC_ID_H264’ was not declared in this scope codec = avcodec_find_encoder(AV_CODEC_ID_H264); ^ prog.cpp:92:47: error: ‘avcodec_find_encoder’ was not declared in this scope codec = avcodec_find_encoder(AV_CODEC_ID_H264); ^ prog.cpp:95:45: error: ‘_T’ was not declared in this scope MessageBox(_T("Could not open codec H264!"), _T("錯誤")); ^ prog.cpp:95:60: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("Could not open codec H264!"), _T("錯誤")); ^ prog.cpp:99:2: error: ‘codeccontext’ was not declared in this scope codeccontext = avcodec_alloc_context3(codec); ^ prog.cpp:99:45: error: ‘avcodec_alloc_context3’ was not declared in this scope codeccontext = avcodec_alloc_context3(codec); ^ prog.cpp:102:57: error: ‘_T’ was not declared in this scope MessageBox(_T("Could not allocate video codec context"), _T("錯誤")); ^ prog.cpp:102:72: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("Could not allocate video codec context"), _T("錯誤")); ^ prog.cpp:114:25: error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope codeccontext->flags |= CODEC_FLAG_GLOBAL_HEADER ; ^ prog.cpp:116:65: error: ‘av_opt_set’ was not declared in this scope av_opt_set(codeccontext->priv_data, "tune", "zerolatency", 0); ^ prog.cpp:118:45: error: ‘avcodec_open2’ was not declared in this scope if (avcodec_open2(codeccontext, codec, NULL) < 0) ^ prog.cpp:120:52: error: ‘_T’ was not declared in this scope MessageBox(_T("Could not open codec codeccontext"), _T("錯誤")); ^ prog.cpp:120:67: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("Could not open codec codeccontext"), _T("錯誤")); ^ prog.cpp:124:2: error: ‘frame’ was not declared in this scope frame = av_frame_alloc(); ^ prog.cpp:127:49: error: ‘_T’ was not declared in this scope MessageBox(_T("Could not allocate video frame"), _T("錯誤")); ^ prog.cpp:127:64: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("Could not allocate video frame"), _T("錯誤")); ^ prog.cpp:135:38: error: ‘pFormatFile’ was not declared in this scope if (avformat_alloc_output_context2(&pFormatFile, NULL, "mp4", outfile) < 0) ^ prog.cpp:135:64: error: ‘outfile’ was not declared in this scope if (avformat_alloc_output_context2(&pFormatFile, NULL, "mp4", outfile) < 0) ^ prog.cpp:135:71: error: ‘avformat_alloc_output_context2’ was not declared in this scope if (avformat_alloc_output_context2(&pFormatFile, NULL, "mp4", outfile) < 0) ^ prog.cpp:137:36: error: ‘_T’ was not declared in this scope MessageBox(_T("alloc file Error!"), _T("錯誤")); ^ prog.cpp:137:51: error: ‘MessageBox’ was not declared in this scope MessageBox(_T("alloc file Error!"), _T("錯誤")); ^ prog.cpp:141:34: error: ‘pFormatURL’ was not declared in this scope avformat_alloc_output_context2(&pFormatURL, NULL, "flv", url); ^ prog.cpp:141:59: error: ‘url’ was not declared in this scope avformat_alloc_output_context2(&pFormatURL, NULL, "flv", url); ^ prog.cpp:141:62: error: ‘avformat_alloc_output_context2’ was not declared in this scope avformat_alloc_output_context2(&pFormatURL, NULL, "flv", url); ^ prog.cpp:143:2: error: ‘pFormatFile’ was not declared in this scope pFormatFile->flags |= CODEC_FLAG_GLOBAL_HEADER; ^ prog.cpp:147:2: error: ‘AVStream’ was not declared in this scope AVStream * outStream = GetStream(pFormatFile); ^ prog.cpp:147:13: error: ‘outStream’ was not declared in this scope AVStream * outStream = GetStream(pFormatFile); ^ prog.cpp:147:46: error: ‘GetStream’ was not declared in this scope AVStream * outStream = GetStream(pFormatFile); ^ prog.cpp:148:12: error: ‘pURLStream’ was not declared in this scope AVStream *pURLStream = GetStream(pFormatURL); ^ prog.cpp:150:30: error: ‘outfile’ was not declared in this scope avio_open(&pFormatFile->pb, outfile, AVIO_FLAG_WRITE); ^ prog.cpp:150:39: error: ‘AVIO_FLAG_WRITE’ was not declared in this scope avio_open(&pFormatFile->pb, outfile, AVIO_FLAG_WRITE); ^ prog.cpp:150:54: error: ‘avio_open’ was not declared in this scope avio_open(&pFormatFile->pb, outfile, AVIO_FLAG_WRITE); ^ prog.cpp:151:89: error: ‘avio_open2’ was not declared in this scope avio_open2(&pFormatURL->pb, url, AVIO_FLAG_WRITE, &pFormatURL->interrupt_callback, NULL); ^ prog.cpp:153:15: error: ‘optionsDict’ was not declared in this scope av_dict_set(&optionsDict,"list_devices","true",0); ^ prog.cpp:153:50: error: ‘av_dict_set’ was not declared in this scope av_dict_set(&optionsDict,"list_devices","true",0); ^ prog.cpp:155:41: error: ‘avformat_write_header’ was not declared in this scope avformat_write_header(pFormatFile, NULL); ^ prog.cpp:158:2: error: ‘last_pts’ was not declared in this scope last_pts = 0; ^ prog.cpp:159:2: error: ‘AVPacket’ was not declared in this scope AVPacket pkt2; ^ prog.cpp:159:11: error: expected ‘;’ before ‘pkt2’ AVPacket pkt2; ^ prog.cpp:161:35: error: ‘packet’ was not declared in this scope while(av_read_frame(pFormatCtx, &packet)>=0) ^ prog.cpp:161:41: error: ‘av_read_frame’ was not declared in this scope while(av_read_frame(pFormatCtx, &packet)>=0) ^ prog.cpp:166:46: error: ‘frameFinished’ was not declared in this scope avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); ^ prog.cpp:166:69: error: ‘avcodec_decode_video2’ was not declared in this scope avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); ^ prog.cpp:174:15: error: expected ‘)’ before ‘const’ (uint8_t const * const *)pFrame->data, ^ prog.cpp:180:6: error: expected ‘)’ before ‘;’ token ); ^ prog.cpp:185:22: error: ‘pkt’ was not declared in this scope av_init_packet(&pkt); ^ prog.cpp:185:25: error: ‘av_init_packet’ was not declared in this scope av_init_packet(&pkt); ^ prog.cpp:188:22: error: ‘pkt2’ was not declared in this scope av_init_packet(&pkt2); ^ prog.cpp:191:64: error: ‘got_output’ was not declared in this scope avcodec_encode_video2(outStream->codec, &pkt, pFrameRGB, &got_output); ^ prog.cpp:191:74: error: ‘avcodec_encode_video2’ was not declared in this scope avcodec_encode_video2(outStream->codec, &pkt, pFrameRGB, &got_output); ^ prog.cpp:194:29: error: ‘DoFile’ was not declared in this scope DoFile(&pkt, outStream); ^ prog.cpp:200:30: error: ‘Dourl’ was not declared in this scope Dourl(&pkt2, pURLStream); ^ prog.cpp:204:25: error: ‘av_free_packet’ was not declared in this scope av_free_packet(&pkt); ^ prog.cpp:214:25: error: ‘av_free_packet’ was not declared in this scope av_free_packet(&packet); ^ prog.cpp:216:30: error: ‘av_write_trailer’ was not declared in this scope av_write_trailer(pFormatFile); ^ prog.cpp:218:32: error: ‘avcodec_close’ was not declared in this scope avcodec_close(outStream->codec) ; ^ prog.cpp:219:27: error: ‘av_freep’ was not declared in this scope av_freep(outStream->codec); ^ prog.cpp:227:28: error: ‘avio_close’ was not declared in this scope avio_close(pFormatFile->pb); ^ prog.cpp:230:26: error: ‘sws_freeContext’ was not declared in this scope sws_freeContext (sws_ctx); ^ prog.cpp:231:35: error: ‘avformat_free_context’ was not declared in this scope avformat_free_context(pFormatFile); ^ prog.cpp:234:16: error: ‘av_free’ was not declared in this scope av_free(buffer); ^ prog.cpp:235:26: error: ‘av_frame_free’ was not declared in this scope av_frame_free(&pFrameRGB); ^ prog.cpp:250:34: error: ‘avformat_close_input’ was not declared in this scope avformat_close_input(&pFormatCtx); ^ prog.cpp:252:22: error: ‘_CrtDumpMemoryLeaks’ was not declared in this scope _CrtDumpMemoryLeaks(); ^ prog.cpp:160:6: warning: unused variable ‘k’ [-Wunused-variable] int k = 0; ^ prog.cpp: At global scope: prog.cpp:255:1: error: ‘AVStream’ does not name a type AVStream * CMFCApplication1Dlg::GetStream(AVFormatContext *pFormatCtx) ^ prog.cpp:295:6: error: ‘CMFCApplication1Dlg’ has not been declared void CMFCApplication1Dlg::DoFile(AVPacket *sourcepkt, AVStream *outStream) ^ prog.cpp:295:34: error: variable or field ‘DoFile’ declared void void CMFCApplication1Dlg::DoFile(AVPacket *sourcepkt, AVStream *outStream) ^ prog.cpp:295:34: error: ‘AVPacket’ was not declared in this scope prog.cpp:295:44: error: ‘sourcepkt’ was not declared in this scope void CMFCApplication1Dlg::DoFile(AVPacket *sourcepkt, AVStream *outStream) ^ prog.cpp:295:55: error: ‘AVStream’ was not declared in this scope void CMFCApplication1Dlg::DoFile(AVPacket *sourcepkt, AVStream *outStream) ^ prog.cpp:295:65: error: ‘outStream’ was not declared in this scope void CMFCApplication1Dlg::DoFile(AVPacket *sourcepkt, AVStream *outStream) ^
Standard output is empty