Use av_log(.., AV_LOG_ERROR) instead of dprintf() for logging errors. This