"All" is a determiner, and it is used to indicate that we are talking about all members of a group. "The" is a definite article, and it is used to indicate that we are talking about a specific group or object. In this case, we are talking about all of the ducks, so "all the ducks" is the correct choice.
"Of ducks" is incorrect grammar because "of" is a preposition. Prepositions are used to connect a noun or pronoun to another word in a sentence. In this case, we would need to use a different preposition, such as "of the ducks" or "of those ducks."