I got it working for .ts but wont work for .mp4. I used a text editior to edit the file at first and I think that was the problem. I found below on forum and this worked for .ts
Use perl to process, replace http with the full ffmpeg pipe http
perl -pi -e 's/^http\:\/\//pipe\:\/\/\/usr\/bin\/ffmpeg\ \-loglevel\ fatal\ \-re\ -\i\ http\:\/\//g' <downloaded m3u file>
Find the .ts part of the address, add on tail of ffmpeg command
perl -pi -e 's/\.ts/\.ts\ \-c\ copy\ \-f\ mpegts\ \-tune\ zerolatency\ pipe\:1/g' <downloaded m3u file>
I also done p@erl -pi -e 's/\.mp4/\.mp4\ \-c\ copy\ \-f\ mpegts\ \-tune\ zerolatency\ pipe\:1/g' <downloaded m3u file>@ but does not work. I get
iptv: stdin pipe unexpectedly closed: No data
Aug 17 16:35:40 tvheadend tvheadend[9100]: subscription: 0006: service instance is bad, reason: No input detected