Ramanujan mentioned the following continued fraction formula in his famous letter to G. H. Hardy in 1913:
$$\cfrac{4}{x +}\cfrac{1^{2}}{2x +}\cfrac{3^{2}}{2x +}\cdots = \left(\dfrac{\Gamma\left(\dfrac{x + 1}{4}\right)}{\Gamma\left(\dfrac{x + 3}{4}\right)}\right)^{2}\tag{1}$$ The form of the continued fraction is very familiar and I am aware of the standard result corresponding to $x = 1$ namely $$\pi = \cfrac{4}{1 +}\cfrac{1^{2}}{2 +}\cfrac{3^{2}}{2 +}\cdots\tag{2}$$ How do we generalize $(2)$ to get $(1)$?
Just for clarity the notation $$\cfrac{a_{1}}{b_{1}+}\cfrac{a_{2}}{b_{2}+}\cfrac{a_{3}}{b_{3}+}\cdots$$ consumes less space in typing compared to the more cumbersome but easier to understand continued fraction $$\cfrac{a_{1}}{b_{1} + \cfrac{a_{2}}{b_{2} + \cfrac{a_{3}}{b_{3} + \cdots}}}$$
We'll go the other direction and generalize $(1)$ to get more pi formulas $(2)$. Ramanujan gave the more general,
$$F(a,b) = \frac{\Gamma\left(\frac{a+b+1}4\right)\Gamma\left(\frac{a-b+1}4\right)}{\Gamma\left(\frac{a+b+3}4\right)\Gamma\left(\frac{a-b+3}4\right)} = \cfrac{4}{a + \cfrac{1^2-b^2}{2a + \cfrac{3^2-b^2}{2a + \cfrac{5^2-b^2}{2a + \ddots}}}}$$
For $b=0$, this reduces to the one in Ramanujan's letter,
$$F(a,0) = \frac{\Gamma^2\left(\frac{a+1}4\right) }{\Gamma^2\left(\frac{a+3}4\right) } = \cfrac{4}{a + \cfrac{1^2}{2a + \cfrac{3^2}{2a + \cfrac{5^2}{2a + \ddots}}}}$$
Let $a$ be an odd integer, then $F(a,0)=F(a)$ is a rational multiple of $\pi$ or $1/\pi$. In closed-form,
\begin{align} F(4m+1) &= \pi\,\left(\frac{(2m)!}{2^{2m} m!^2}\right)^2\\ F(4m+3) &= \frac{4}{\pi}\left(\frac{2^{2m} m!^2}{(2m+1)!}\right)^2 \end{align}
The simplest is $m=0,$ yielding the familiar cfracs,
$$F(1) = \pi = \cfrac{4}{1 + \cfrac{1^2}{2 + \cfrac{3^2}{2 + \cfrac{5^2}{2 + \ddots}}}}, \qquad F(3) = \frac4{\pi} = \cfrac{4}{3 + \cfrac{1^2}{6 + \cfrac{3^2}{6 + \cfrac{5^2}{6 + \ddots}}}}$$
and so on.