I noticed in some of the pics you've posted people are waving Catalan flags with a blue triangle on the side, like Cuba and Puerto Rico's flags. I thought the Catalan flag was just the red and yellow stripes, do they both mean the same thing?
The Catalan flag (called senyera) is, as you say, a yellow background with 4 red bars. This is our historical flag that we have had since the Middle Ages.
The flag that you mention is the estelada, the flag that means independence for catalonia or for the catalan countries. there are 2 widely used estelades: the blue one (also called the historical one) and the red one.
The blue estelada simply means independence. It was created in 1918, based on a previous design from 1906 that had the star in the center instead of on a side.
The red estelada is the leftist estelada. It includes a red star, international symbol of socialism.
There are also less used estelades that you can see from time to time, such as the anarchist estelada (not very used since most anarchists simply use the much more well-known red estelada),
the gay estelada (this one has recently gained a lot of popularity and it’s very common to see in demonstrations, though by far not as much as the blue and red ones),