The end points of the line segment are $A(3,4)$ and $B(-1,2)$
Hence the midpoint of the line AB is $ \bigg( \large\frac{3-1}{2}$$, \large\frac{4+2}{2} \bigg)$
$ \qquad = (1,3)$
Now the slope of the line is
$ m_1 = \large\frac{2-4}{-1-3}$$ = \large\frac{-2}{-4}$$ = \large\frac{1}{2}$
Hence the slope of the perpendicular will be
$m_2 = -\large\frac{1}{\bigg(\Large\frac{1}{2} \bigg)}$$=-2$
$\therefore $ Equation of the line passing through (1,3) and slope -2 is
$(y-3)=-2(x-1)$
(i.e., ) $(y-3)=-2x+2$
$ \Rightarrow 2x+y=5$
Hence the required equation of the line is $ 2x+y=5$