We propose a method to transform a single-photon field into bunches of pulses with controllable timing and number of pulses in a bunch. The method is based on transmission of a photon through an optically thick single-line absorber vibrated with a frequency appreciably exceeding the width of the absorption line. The narrow spectrum of the incoming photon is ``seen'' by the vibrated absorber as a comb of equidistant spectral components separated by the vibration frequency. Tuning the absorber in resonance with
mth spectral component transforms the output radiation into bunches of pulses with
m pulses in each bunch. We provide a simple analytical solution clearly describing this effect and experimentally demonstrate the proposed technique with a single 14.4-keV photon and an ensemble of vibrated
57Fe nuclei. This method opens an alternate way to the production of time-bin qubits.