0
votes

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]"

1

1 Answers

0
votes

Finally I did it. Use -flags +global_header, it is mandatory as the same -map 0:v option. Now is working perfectly.

ffmpeg -y -f dshow -loglevel info -rtbufsize 2147.48M -i "video=MY_CAMERA" ^ -flags +global_header -c:v libx264 -preset fast -crf 30 -pix_fmt yuv420p ^ -minrate 2M -maxrate 4M -bufsize 3.5M -s 1920x1080 -f tee -map 0:v "C:\out\test.mkv|[f=rtsp]rtsp://localhost:8554/mystream"