how to get realtime output from ffmpeg
ffmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe -

Read from stdout pipe, The format is documented here https://wiki.multimedia.cx/index.php/YUV4MPEG2