ffmpeg音频格式转换
打开ffmpeg下bin路径shift+鼠标右键,选择在此处打开命令窗口
mp3转pcm
ffmpeg.exe -i Cry.mp3 -f s16le -ar 8000 -ac 1 -acodec pcm_s16le Cry_8k.pcm
wav转pcm
ffmpeg.exe -i “di.wav” -f s16le -ar 8k -ac 1 -acodec pcm_s16le Di.pcm
wav转aac
ffmpeg.exe -i “01.wav” -ar 8k -ac 1 -acodec aac WiFi_failed.aac
mp3转aac
ffmpeg.exe -i “test.mp3” -strict experimental -ab 128k -ar 8k -ac 1 -acodec aac -y test.aac
m4a转pcm
ffmpeg.exe -i demo.m4a -f s16le -ar 16000 -ac 1 -acodec pcm_s16le demo.pcm
mp3转alaw
ffmpeg.exe -i “speaker_test.mp3” -f alaw -ar 8000 -ac 1 -acodec pcm_alaw “speaker_test.g711a”
webrtc推流命令:
ffmpeg -stream_loop -1 -re -i "./t2.mp4" -vcodec copy -acodec pcm_alaw -ar 8000 -ac 1 -f rtsp -rtsp_transport tcp rtsp://192.168.230.128/live/test
ffmpeg -stream_loop -1 -re -i "./t2.mp4" -vcodec copy -acodec pcm_alaw -ar 8000 -ac 1 -f flv rtmp://192.168.230.128/live/test
ffmpeg -stream_loop -1 -re -i "./t2.mp4" -vcodec copy -acodec pcm_mulaw -ar 8000 -ac 1 -f rtsp -rtsp_transport tcp rtsp://192.168.230.128/live/test
ffmpeg -stream_loop -1 -re -i "./t2.mp4" -vcodec copy -acodec pcm_mulaw -ar 8000 -ac 1 -f flv rtmp://192.168.230.128/live/test