The film, set in 1947, revolves around the story of Partition and features Huma Qureshi, Hugh Bouneville, Gillian Anderson and Michael Gambon.
Rahman took to Twitter to share a picture of himself along with singer Shreya Ghoshal and captioned it as "Recording the end credits song for 'Viceroy's house' Hindi version."
In the picture, Rahman was in an all-black suit sitting in front of a keyboard accompanied by Shreya, who was standing next to the Oscar-winning composer in a white gold outfit.