def write_metadata_tag(stream, metadata):
 SCRIPT_TAG = '\x12'
 FLV_TAG_HEADER_LEN = 11
 if metadata:
  stream.write(SCRIPT_TAG)
  write_unsigned_int_24(stream, len(metadata))
  stream.write('\x00\x00\x00\x00\x00\x00\x00')
  stream.write(metadata)
  write_unsigned_int(stream, (FLV_TAG_HEADER_LEN + len(metadata)))

def write_metadata_tag ( stream , metadata ) : SCRIPT_TAG = '\x12' FLV_TAG_HEADER_LEN = 11 if metadata : stream . write ( SCRIPT_TAG ) write_unsigned_int_24 ( stream , len ( metadata ) ) stream . write ( '\x00\x00\x00\x00\x00\x00\x00' ) stream . write ( metadata ) write_unsigned_int ( stream , ( FLV_TAG_HEADER_LEN + len ( metadata ) ) )
writes optional metadata tag to stream .