See here:
http://samtools.sourceforge.net/pileup.shtml
also, if you run samtools with the following command "samtools pileup -c -f <reference_sequence> in.bam" you will get for each position the support for consensus and for reference and some value that tells you the probability of a SNP at this position, I haven't read up on the details but I think that could be a good starting point.
Example Output:
dmel_mitochondrion_genome 2033 T T 10 0 0 3 ... AA>
You could try to extract your desired information from that.
Cheers,
Paul