Skip to content

Instantly share code, notes, and snippets.

View apdevelop's full-sized avatar

Andrey P. apdevelop

View GitHub Profile
@apdevelop
apdevelop / ffmpeg-audio.md
Last active October 8, 2019 19:51
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://127.0.0.1:16384

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