Streem to dlna device

I like to create a python script that reencode a IPTV stream (in .m3u8 format) with ffmpeg and send the stream to a DLNA device(anycast) in my network.
But I don’t know how to do.
Anyone cal help?
Thanks in advance.

Is there a reason you need to transcode the stream I tend to find most IPTV streams are quite simple?

Hello, the problem is with a kind of m3u8 files that have separate stream, one for audio and different quality for video depending on network bandwidht. All my DLNA device reproduce video without audio.