avformatcloseinput
avformat_close_input is a function from FFmpeg’s libavformat library used to close an input format context that was previously opened with avformat_open_input or related calls. Its canonical name is avformat_close_input and its signature is void avformat_close_input(AVFormatContext **ps). The function takes the address of a pointer to an AVFormatContext and is responsible for freeing all resources associated with that input and for setting the pointer to NULL.
When invoked, avformat_close_input closes the underlying input (including any network or file IO), frees internal data
Usage generally follows opening the input, performing demuxing or stream analysis, and then cleaning up. A typical
Notes: avformat_close_input handles null and already-closed pointers gracefully; if ps or *ps is NULL, the function