Ripple and dune formation in rivers