[Libav-user] Encoding .png images with h264 to a file on disk

Gonzalo Garramuño ggarra13 at gmail.com
Mon Feb 22 18:59:28 EET 2021


El 21/2/21 a las 09:44, laddoe escribió:
>      // Write media trailer
> //    if( m_formatCtx )
> //        ret = av_write_trailer( m_formatCtx );
>
>      /* flush the encoder */
>      ret = avcodec_send_frame(m_codecCtx, NULL);

This should be reversed, like:

while ( ret >= 0 )
     ret = avcodec_send_frame(m_codecCtx, NULL);

if( m_formatCtx )
      ret = av_write_trailer( m_formatCtx );



More information about the Libav-user mailing list