Can You Identify This British Naval Uniform?

by Croixrousse

I wondered if anyone with some knowledge of British military / naval history could help me to identify the uniform of the man in this portrait: http://imgur.com/vHeWJTU (I'm sorry about the poor cellphone photo; I can probably take a better one if needed.)

I believe he was a Royal Navy officer of some sort - perhaps early 19th century? but don't know much else. The portrait has come down in my mother's family and I'd like to identify exactly who it was - so any information on likely date, rank or anything else would be extremely helpful.

Thanks!

Second_Mate

The uniform is that of a post-Captain, as he has two epaulettes.

discworldian

OP, is there a signature on the painting anywhere? Identifying the painter might help us narrow down the timeframe.