With pure CSS you can achieve this by using display: flex; align-items: center;
<div class="embed-responsive embed-responsive-1by1" style="background:blue; height:300px; display: flex; align-items: center;">
<div class="embed-responsive-item">
<div style="vertical-align: middle;">
<span class="h4" style="color:white; font-size: 34px;">The text I want to vertically align in the middle</span></div>
</div>
</div>
In Bootstrap 4 the embed-responsive-item
class will add position: absolute;
which break the layout. Remove that and add row
class for parent and col-sm-12 align-self-center
for child. That will work.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<div class="container">
<div class="row embed-responsive embed-responsive-1by1" style="height:2000px;border:1px solid gray">
<div class="col-sm-12 align-self-center">
<span>.align-self-center</span>
</div>
</div>
</div>