1. I saw him swim in the river.

2. I saw him swimming in the river.
---------------------------------
What is the difference between the two sentences? Does #1 mean that I saw all the process of his swimming from beginning to end? Does #2 mean that I saw the person who was swimming at that time, temporarily.

Both sentences mean the same thing. There's really no difference in meaning.

The difference between the two sentences is in the verb tense and the interpretation of the action.

In sentence #1, "I saw him swim in the river," the verb "swim" is in the base form or simple present tense. This sentence suggests that you witnessed the complete action of him swimming in the river from beginning to end. It implies that you observed the entire process or action of swimming.

In sentence #2, "I saw him swimming in the river," the verb "swimming" is in the present participle form. This sentence suggests that you saw him in the middle of the action of swimming in the river. It implies that you observed him while he was already swimming at that time, without necessarily witnessing the whole action from start to finish.

So, to answer your question, sentence #1 implies that you saw the whole process of swimming from beginning to end, while sentence #2 implies that you saw the person in the act of swimming temporarily.