This bacterial enzyme is involved in degradation of glycine betaine. The enzyme contains non-covalently bound FAD and NAD(P) cofactors, and catalyses the demethylation of both N,N-dimethylglycine and sarcosine, releasing formaldehyde and forming glycine as the final product. The enzyme can utilize both NAD+ and NADP+, but the catalytic efficiency with NAD+ is ~5-fold higher. The native electron acceptor of the enzyme is a membrane-bound clostridial-type ferredoxin, which transfers the electrons to an electron-transfer flavoprotein (ETF).