For more information, https://en.wikipedia.org/wiki/Verbal_noun
Verbal noun is a category. Gerund in a subcategory within verbal nouns.
As for the example:
"I heard shouting in the distance but I don't know who was shouting."
A shout = noun
to shout = verb (infinitive)
I heard shouting ... (gerund which functions as a noun).
As a check, replace the gerund with a noun.
I heard a noise. I heard noises. (= this works, so shouting is a gerund)
I heard a shout. I heard shouts. (= this works, so shouting is a gerund)
... who was shouting (present participle used in the present continuous)
As a check, replace the participle with noun.
... who was a noise ... (= this doesn't work, so shouting is not a gerund but a participle)
... who was a shout ... (= this doesn't work, so shouting is not a gerund but a participle)