This did it for me. Rather than trying to echo the ID in the k2 template, I cleaned the output and made a template-override for the allvideos plugin:
<?php
$string = $output->player ;
$search = '<iframe src="https://www.youtube.com/embed/' ;
$trimmed = str_replace($search, '', $string) ;
$string = $trimmed ;
$search = '?rel=0&fs=1&wmode=transparent" width="400" height="300" allowfullscreen="true" frameborder="0" scrolling="no" title="JoomlaWorks AllVideos Player"></iframe>' ;
$trimmed = str_replace($search, '', $string) ;
?>
<div class="embed-responsive embed-responsive-16by9 mb-2">
<iframe title="Watch video" class="embed-responsive-item" src="https://www.youtube.com/embed/<?php echo $trimmed; ?>?rel=0&modestbranding=1" allowfullscreen></iframe>
</div>