Help with video PS4

So I have been seeing some sweet videos shared from BF5. How are you guys capturing these on PS4? I have never done it and don’t know how. I have had a couple of pretty sweet moments that would be cool to share but didn’t know at the time it was an option. Do you have to be recording before the event or can you capture it somehow in some sort of replay?

School me

When something sweet happens you press your controller share button and there is option to save video clip. Then you can edit clips on ps 4 share factory app. Hope this helps!

Thank you