I think in both examples that was creating using a particle generator. For example in the first one the shoes are tracked, then a particle generator is tied to the result. Also you would need to create some kind of 3D camera tracker also to get the streaks to look like they are part of the scene.
Here's a couple of tutorials on Light Streaks. You should have enough to go on to either get a start with this now, find more tutorials, or ask more specific questions.
"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.