Adds a header, if needed, for this container.
Call this AFTER you've added all streams you want to add, opened all IStreamCoders for those streams (with proper configuration) and before you write the first frame. If you attempt to write a header but haven't opened all codecs, this method will log a warning, and your output file will likely be corrupt.
If the current thread is interrupted while this blocking method is running the method will return with a negative value. To check if the method exited because of an interruption pass the return value to {@link IError#make(int)} and then check {@link IError#getType()} to see if it is {@link IError.Type#ERROR_INTERRUPTED}.
@return 0 if successful. < 0 if not. Always -1 if this is a READ container.