Open2

FFmpeg/avformat_find_stream_info関数の仕事

yohhoyyohhoy

https://github.com/FFmpeg/FFmpeg/blob/n4.4.1/libavformat/utils.c#L3602

AVFormatContext パラメータ:

  • probesize: Maximum number of bytes read from input in order to determine stream properties.
  • max_analyze_duration: Maximum duration (in AV_TIME_BASE units) of the data read from input. Can be set to 0 to let avformat choose using a heuristic.
  • fps_probe_size: The number of frames used for determining the framerate.
  • codec_whitelist: ',' separated list of allowed decoders. If NULL then all are allowed.

処理概要:

  • 全ストリーム(streams[])に対してデコーダオープン試行(avcodec_open2)
  • 全ストリームの先頭を解析してフレームレート推定(ff_rfps_calculate)
    • 解析範囲はprobesize[byte]またはmax_analyze_duration[unit]またはfps_probe_size[frame]で制限可能。
    • 映像フレームレート(AVStream::r_frame_rate,avg_frame_rate)、ストリーム配置情報(disposition)が設定される。
  • 全ストリームのパラメータ(AVStream::codecpar)をコーデックコンテキストをもとに更新。