Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrey P. apdevelop

View GitHub Profile
@apdevelop
apdevelop / ffmpeg-audio.md
Last active Oct 8, 2019
Useful ffmpeg audio snippets
View ffmpeg-audio.md

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