The GamepadViewer provides what you are looking for.
However, you will need to record your PS4 gameplay footage on your PC using a capture card or something similar. Also you need to connect your gamepad to both your console and your PC by bluetooth binding it to the console and then plugging it into a USB port of your PC.
In your recording program, you can then setup a capture for your browser window, chroma key out the background and layer it on top of your footage. If there is some input lag, you can adjust the delay using in-url settings, e.g.
This is and more settings are explained on the info page of the tool. You can also change the skin of the controller to PS4 (black or white) or remap the buttons (e.g. if you changed the mapping through accessibility settings of your PS4). There even is a URL-generator that let's you pick all your options very easily.
I tested this on my PS4 Pro and Chrome under Windows 10 Pro and it worked flawlessly.