Even if it is cooked, some red cell membranes inside still maintain the integrity of this form. Then these red blood cells with intact cell membrane will be digested by gastric juice in our stomach, which will lead to the rupture of the membrane and various substances inside, especially the heme containing iron will turn from red to black after oxidation, which can not be absorbed from the stomach, small intestine and large intestine all the way, so it can only be discharged through feces and mixed with feces, which is what we often say.
In fact, it is not only pig blood, but also other animals' blood will have the same effect if they eat too much, including our stomach bleeding, and sometimes even eating some reddish fruits will relieve melena.