Hi. Can anyone tell if it's of a particular importance to have av_write_trailer () after the avcodec_close(), and not before? This first approach is taken in the output_example.c, but I'd prefer to write file trailer first to finalize the file before continuing with clean-up. Thanks, Stas.