av_guess_format(NULL, out_file, NULL);
av_guess_format This is a function that determines the encapsulation method when the video is output. There are three parameters in it. Writing any parameter will automatically match the corresponding encapsulation method.