Install streamlink utility (https://streamlink.github.io/install.html)
choco install streamlink
- Get youtube share link: https://youtu.be/gIB2egm7tL8
hls-live-restart
will record from beginning of stream
streamlink --hls-live-restart https://youtu.be/gIB2egm7tL8 1080p,best -o rec1.ts
ffmpeg -i .\rec1.ts -c copy -bsf:a aac_adtstoasc -f mp4 -movflags faststart+separate_moof .\rec1.mp4
streamlink --hls-live-restart https://youtu.be/gIB2egm7tL8 1080p,best --stdout | ffmpeg -i pipe:0 -c copy -bsf:a aac_adtstoasc -f mp4 -movflags empty_moov+separate_moof+frag_keyframe .\rec2.mp4
streamlink --hls-live-restart https://youtu.be/gIB2egm7tL8 1080p,best --stdout | ffmpeg -i pipe:0 -c copy -bsf:a aac_adtstoasc -f mp4 -movflags empty_moov+separate_moof+frag_keyframe pipe:1 | player
streamlink often disconnects, this makes it unusual for my purposes of youtube recording :(