Given the difference in shade between the Kepi and the Frock Coat, I present the following deductions for consideration:
First, an assumption can be made that the Kepi is dark blue in color. Oftentimes, thanks to the way in which the photo-sensitive emulsions of that time reacted to certain hues, red would have appeared rather light, and washed out, eliminating red as the kepi color, HOWEVER... one can also notice that the collar of the frock is distinctively darker than the body of the jacket, AND a faint row of piping between the two is lighter than both the collar AND the jacket.
This leads me to believe that this soldier is wearing a grey or light-blue frock coat with medium to dark blue collar and kepi with red piping. The branch of service is supported by the sword, shoulder scales, and the diminutive crossed cannons on the Kepi, lending support to the idea that the piping is red, washed out by the photographic limitations of that time period.
Dating this pic is a bit more difficult, but based on the rather long hair and uniform embellishments (particularly the shoulder scales and Kepi brass) I would lean heavily toward an early or even pre-war timeframe. Such 'fancy' hat brass was replaced by the standard issue crossed cannons in the Federal army relatively quickly, whereas such 'pieces of flare' were often times eliminated in Confederate service early in the conflict. Also, its quite probable that a Kepi such as this one would have been replaced by a Forage Cap or Hardee Hat in Federal Service... or a gray-ish kepi or slouch on the Southern side of the fight. Finally, such a 'fancy' uniform would have succumbed to the necessities of the conflict fairly early on, being replaced with a Federal Shell Jacket or Sack Coat in the north, or a simple Shell Jacket south of the Mason-Dixon.
As to exactly what unit this uniform represents, alas I have no real idea, nor do I feel it prudent to offer an opinion beyond that which I have already shared. So many of these 'fancy' uniforms were poorly recorded, and fewer still saved, that all-too-often their origins will remain lost to history.
Good luck, hope this helps.