i was trying to solve ticket https://ffmpeg.org/trac/ffmpeg/ticket/2716, i need to know should i free those thngs in avformat_new_stream. or we should call av_codec_open and avcodec_close to do that Anshul