Segmentation fault while avcodec_encode_video2
问题 I have some problems while trying to encode a AVFrame to a packet. Before reading the whole code, the input stuff is working, I tested it. The output stuff is from an example here. I think there is the problem. But the segmentation fault occurs in the loop near the end. Here is my reduced code: void nmain() { // input stuff AVFormatContext *formatCtxIn=0; AVInputFormat *formatIn=0; AVCodecContext *codecCtxIn=0; AVCodec *codecIn; AVPacket *pktIn; av_register_all(); avdevice_register_all();