Home How can i use ffmpeg to extract audio from an video every 5 seconds

# How can i use ffmpeg to extract audio from an video every 5 seconds

roomy
1#
roomy Published in 2017-12-06 02:57:40Z
 I need to extract audio from live stream. I want to generate an audio file every 5s. if i use the command ffmpeg -i ***.flv -c:a aac -fs 128k output.aac I can only get one file. but i want generate a file every 5s. if i use the commmand ffmpeg -i ***.mp4 -vf fps=1/5.0 E:\image%d.jpg I got an image every 1s. How can i do the same thing to extract audio.
LordNeckbeard
2#
 Use the segment muxer: ffmpeg -i input -map 0:a -f segment -segment_time 5 output_%03d.aac  Add -c copy and use a compatible output container format if you don't want to re-encode.