Using the ffmpeg hashframe muxer on encoded frames in real time
Use the tee muxer.
ffmpeg -nostdin -hwaccel auto -fflags +igndts \
-f alsa \
  -ac 1 \
  -ar 44000 \
  -thread_queue_size 2048 \
  -i hw:2,1,0 \
-f video4linux2 \
  -thread_queue_size 2048 \
  -i /dev/video0 \
  -map 1 -map 0 \
  -vcodec libx264 \
  -preset ultrafast \
  -tune zerolatency \
  -s 1280x720 \
  -r 30 \
  -acodec aac \
  -t 00:00:05 \
-f tee &quot;[f=framehash]out/out.md5|[f=avi]out/out.avi&quot;