Context. Very long baseline interferometry (VLBI) imaging of radio emission from extragalactic jets provides a unique probe of physical mechanisms governing the launching, acceleration, and collimation of relativistic outflows. Aims. VLBI imaging of the jet in the nearby active galaxy M 87 enables morphological and kinematic studies to be done on linear scales down to ∼ 100 Schwarzschild radii (R s ). Methods. The two-dimensional structure and kinematics of the jet in M 87 (NGC 4486) have been studied by applying the Waveletbased Image Segmentation and Evaluation (WISE) method to 11 images obtained from multi-epoch Very Long Baseline Array (VLBA) observations made in January-August 2007 at 43 GHz (λ = 7 mm).Results. The WISE analysis recovers a detailed two-dimensional velocity field in the jet in M 87 at sub-parsec scales. The observed evolution of the flow velocity with distance from the jet base can be explained in the framework of MHD jet acceleration and Poynting flux conversion. A linear acceleration regime is observed up to z obs ∼ 2 mas. The acceleration is reduced at larger scales, which is consistent with saturation of Poynting flux conversion. Stacked cross correlation analysis of the images reveals a pronounced stratification of the flow. The flow consists of a slow, mildly relativistic layer (moving at β ∼ 0.5 c), associated either with instability pattern speed or an outer wind, and a fast, accelerating stream line (with β ∼ 0.92, corresponding to a bulk Lorentz factor γ ∼ 2.5). A systematic difference of the apparent speeds in the northern and southern limbs of the jet is detected, providing evidence for jet rotation. The angular velocity of the magnetic field line associated with this rotation suggests that the jet in M87 is launched in the inner part of the disk, at a distance r 0 ∼ 5 R s from the central engine.Conclusions. The combined results of the analysis imply that MHD acceleration and conversion of Poynting flux to kinetic energy play the dominant roles in collimation and acceleration of the flow in M 87.