title: Deal with resolution changed while decoding?
body: <p>I'm using FFMPEG with C++ to read frames and decode them from RTSP Stream on IP Camera.</p>
  
  <p>Anything is ok, but while decoding, I try to change stream resolution config on IP Camera (ex: change from 1280x720 to 1920x1080). </p>
  
  <p>The result is <code>av_read_frame()</code> in while loop still read successful next frames (with new resolution) without error. So I can not detect that change to reinit buffer or reconnect stream to update other stream's information.</p>
  
  <p><code>av_read_frame()</code> will read an AVPacket, If I can read resolution info in the AVPacket, then I can detect that change and reinit buffer. But I can't see any resolution info in AVPacket struct.</p>
  
  <p>Someone can help me, how to detect resolution change while reading and decoding stream?</p>
  
  <p>UPDATE</p>
  
  <p>I'm using many codecs as H264 and H265/H265+. This case happened with all 3 codecs above.</p>
  
  <p>In many cases I also store the AVPacket for later playback, so there's no need for decode. I need to detect the resolution change immediately to be able to properly build header information to store on the HDD.</p>
  
  <p>Thank you very much!</p>