Okay, watched the second video. It is true that once in Atocha train station, you have to get a "number" exactly like standing in an American deli line!
One machine dispenses "numbers" for trains that day, the other machine for tickets in the future. I only figured this out with my translator app! When I was there last September I had a 40 min. wait until my number came up, but I was in no hurry as I was staying the night nearby (for jet lag) and heading for Pamplona the next day. When they call your number,then you buy your train ticket. So plan for this waiting time.