Only the River Flows is based on Yu Hua's story Mistakes by the River. Director Yimou Zhang initially wanted to make a suspense film based on this story, back in the 1990s. Per Yu Hua, they wrote for many days but didn't know how to film it. Yu Hua gave Yimou Zhang another story, To Live, instead, which was made into same named movie To Live (1994) , and subsequently won the Grand Prize of the Jury of Cannes Film Festival in 1994.
Yilong Zhu decided he should put on weight to play his character Ma Zhe, based on his study and observation of local retired policemen. The police investigators had to stay up late and often ate at late hours, which would be a major factor for weight gain from overwork. The first thing he did after arriving at Nanfeng, the filming site (which was also the day after he won his Golden Rooster Awards), was to put on weight. He did eat a lot and complemented on Nanfeng's local cuisines.
Per actor Yilong Zhu in an interview with ELLE, The most difficult part was to find a way to establish his character, Ma Zhe, how the character should look like. He had no answer until he saw a picture of Yu Hua, the author of the original story. Yu Hua was in a picture with mustache, on a snow day, with long hair. That inspired Yilong Zhu the look of Ma Zhe.
The river scene was filmed in cold winter, Yilong Zhu had to walk in and submerge his face into freezing water.