Hi Roadtripking,
According to Brazilian law the foreign marriage must be registered both at the Consulado-Geral do Brasil having jurisdiction over the city where the marriage took place and subsequently upon returning to Brazil it must also be registered with the 1º Oficio de Cartório de Registro Civil in the capital of the state of one's residence or in Brasília (whichever is more convenient). It is my understanding that registration here in Brazil must take place within 180 days of one's arrival in the country.
Registration at the Consulado-Geral do Brasil can only be done by the Brazilian spouse, and must be done in person. In rare cases where a foreign marriage has taken place in a 3rd country (i.e. you were married in Canada for example, later moved to the USA and decided to register the marriage at the Consulado-Geral there) the LOCAL (foreign) Marriage Certificate would first need to be legalized by the Consulado-Geral do Brasil in the country where the marriage took place. Only then would it be accepted for registration in any other Consulado.
Upon registration, the Consulado would then issue a "Certidão de Casamento" from the Consular Cartório, which is the Marriage Certificate that would later be registered here in Brazil. Many Consulados are not extremely familiar with the procedure, and some have found that when attempting to register a marriage that had taken place years before they were told that it couldn't be done since too much time had passed. This is absolutely false and there is NO TIME LIMIT emposed on registration abroad. The ONLY time restriction is the 180 day limit imposed on registration here in Brazil.
Once the marriage is registered at the Cartório then you have two options: a) obtain a VITUR Tourist Visa and come to Brazil and apply for Permanência Definitiva com base em cònjuge brasileira here (what I recommend); or b) Apply for a VIPER Permanent Visa there before coming to Brazil (I don't recommend this option if you don't wish to wait a few months) you cannot enter Brazil even on another visa category until the VIPER has actually been granted.
With the first option if all the documents are present and in proper order, permanency is granted immediately, you register in the RNE and apply for your civil ID card the Cédula de Identidade Estrangeiro all at the same time. The documents required are all the same in either case, it's just a matter of which option is most convenient for you.
If you have any further questions or have doubts you'd like cleared up then feel free to post them here.
Cheers,
James Expat-blog Experts Team