Piping command does not work properly when your input is coming from a device (e.g. a webcam) so you cannot work with 2 output. I need to save the webcam stream on a file (.mkv) and, at the same time, publish it on a rtst server. I tried the following:
ffmpeg -y -f dshow -loglevel info -rtbufsize 2147.48M -i "video=my_camera" -vf hflip,rotate=PI ^ -c:v libx264 -preset fast -crf 25 -pix_fmt yuv420p ^ -minrate 2M -maxrate 4M -bufsize 3.5M -s 1920x1080 -f tee "[f=mkv]'C:\test.mkv'|[f=rtsp]rtsp://localhost:8554/mystream]"