He was born in Munich and was the eldest son of Maximilian I , Elector of Bavaria and Maria Anna of Austria a daughter of Ferdinand II , Holy Roman Emperor .
He was born in Munich . He was the eldest son of Maximilian I , Elector of Bavaria - whom he succeeded , and his second wife Maria Anna of Austria , daughter of the emperor Ferdinand II , Holy Roman Emperor .