This is really a question for the rasberry pi stack but its ok!
If you type in cd (where ever the file is stored) and type ‘omxplayer (yourvid).h264, it will show you the video. The best thing for you to do is to use a command called ‘MP4Box’.
You can do this with the CMD but ill tell you how to do it in Python. Below your current code add the following.
command = "MP4Box -add beepvid.h264 beepvid.mp4"
call([command], shell=True)
print("vid conv")
This will convert the ‘beepvid.h264’ to mp4 and you can install VLC player if you want to play it. The way to install VLC player is the following: sudo apt-get install vlc. I suggest you type in ‘ sudo apt-get update’ and ‘sudo apt-get upgrade’ before hand
I hope this has answered your question.