Hi Aziz
I did the first video you linked above.
I'll tell you how I did it, though there's probably other ways to do it too.
I use
startrails software to create my startrail images and also used it to create the timelapse, using the 'video' button.
So the sequence started as a timelapse video, then had the star trail composite. You'll notice when you use 'startrails' to create a startrail image, it adds each image to the final as it goes.
I simply 'recorded the portion of the screen' as startrails was creating the final image. I can't remember the software I used, but it was freeware and was one of the types of software that you'd use for training videos etc, where you can record a portion of the screen.
So I had the timelapse video, then a video of startrails building up the star trails image, and the final star trails image. I simply combined all of them using Windows Movie Maker.
I'm sure you could use other programs to achieve the same effect - one example would be using photoshop actions to reveal each layer of an image one at a time to create the star trails image, and then again using screen-recording software to create a video as it does it.
I'd be interested to hear of any other software that could do it.
I hope I've explained it well enough. Let me know if you have any questions.