I doubt an Arduino or Raspberry Pi solution would be practical, or even possible, due to the limited processing power of those units and the processing power required to do what you want to do: Add an Overlay
Overlays are acheived using Alpha Channels. An Arduino, may be able to handle video, do certain encoding, input/output functions, but adding an overlay which requires the use of a larger bit-depth and different approach to color space due to the 4th Channel: The Alpha Channel, in addition to the Primary RGB Channels.
Your best bet is a simply HDMI capture card, or using a GPU that has HDMI capture, in conjunction with a software package like Livestream, which can handle overlays, logos, etc. They have different options, but their Producer / Studio Software, which goes from free to paid plans depending on usage and features, can do what you want.
There are others out there. You can also look at Bandicam. Bandicam is a great Screen Capture application, and it may have the abilty to apply its features, such as adding overlays to its recordings, to a camera input feed.
Its also very user friendly. Supports H264 and other codecs, and is very affordable (I think $30).
Worth looking at.