Building my live streaming server. (FLV data file to .ts and .m3u8)

I hope I'm in the right place.
I am building my own RTMP/AMF0 live streaming server with python.
I'm working with OBS. I succeeded with the handshake, "set chunk size", "releaseStream", "_result", "onStatus" and all those other commands and packets.
Now, I am receiving the "setMetaData" packet and video and audio packets (8/9).
What I realized until now is that all the data is actually an FLV file and its audio encoded in AAC and video in H246. Is that correct?
I need your help figuring out how to connect audio and video and create a new flv / ts file along with m3u8 so I can play it in HTTP. (HLS)
Thanks in advance!
