The first one actually admits to being a tool-assisted speed run. If you go to around 1:03, you will see a box in the bottom of the screen saying, "This is a tool-assisted movie. For details, visit blah blah blah".
Tool-assisted movies are runs that use things like emulators in order to be as perfect as possible. I'm guessing the guy used an N64 emulator to take advantage of save states.
As for the second one, as it's a 16-star run, there is a faster time than 20 minutes - the current record is
0:17:31.