Skip to content

Instantly share code, notes, and snippets.


Andrey P. apdevelop

View GitHub Profile
apdevelop /
Last active Oct 8, 2019
Useful ffmpeg audio snippets

Useful ffmpeg audio snippets

  • Generating 400Hz sine wave, encoding it with G.711 μ-law codec and streaming using RTP/UDP protocol (PCMU)

ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 8000 -f mulaw -f rtp rtp://

output format will be: Stream #0:0: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s

  • Cropping audio file at given position and length