You can definitely do it with magnets -- at least if the pipe is nonmetallic -- although I don't know a cheap or simple way. But it would be similar to the technique used for imaging blood flow in an MRI. You surround a section of the pipe with a strong magnet, which aligns the spins in the hydrogen nuclei, then detect the oriented spins as they flow to one side or the other. I'm not sure how difficult or expensive the detection could be, if all you need to know is left vs right; the detection methods used in MRI, to produce an image, are very tricky and expensive, but might be overkill here.
As suggested in the comments by Christopher James Huff, you could start with the design of a proton precession magnetometer:
http://ilotresor.com/build-a-proton-precession-magnetometer/
It looks like the detection method here is a simple coil and audio amplifier; in the Earth's weak magnetic field, the protons will "sing" as they precess at a frequency around 2kHz, well within the audio range, as they relax from the stronger magnetic field used to align them.