4. There is a cylindrical water cup (neglecting thickness), with a base diameter of 8 and a height of $8 \sqrt{3}$. The cup contains an appropriate amount of water. When the cup is slowly tilted until the water just begins to overflow, the angle between the generatrix of the cup and the horizontal plane is $\frac{\pi}{3}$. Continuing to slowly tilt the cup, the angle between the generatrix and the horizontal plane when the pouring stops is $\frac{\pi}{6}$. The volume of the water poured out is $\qquad$
4. $\frac{128 \sqrt{3} \pi}{3}$.

As shown in Figure 2.
Initially, the volume of the part without water is half of a cylinder with a height of $\frac{8}{\sqrt{3}}$. Therefore,

the initial volume of water is $V_{1}=\pi 4^{2} \times\left(8 \sqrt{3}-\frac{4}{\sqrt{3}}\right)$; the final volume of water is half of the cylinder, i.e., $V_{2}=\pi 4^{2} \times 4 \sqrt{3}$.
Thus, the volume of water poured out is
$$
\Delta V=V_{1}-V_{2}=\pi 4^{2}\left(4 \sqrt{3}-\frac{4}{\sqrt{3}}\right)=\frac{128 \sqrt{3} \pi}{3} .
$$