Extracting sound from a video file using FFmpeg is very easy. Firstly, determine what codec is used for the sound in the video file.
(base) ┌─jason-Lenovo-H50-55@jason⬎ └─◉ 5.1-~/Videos-09:28-⚫ ◉--[$] ☕ ffprobe -hide_banner 6j9k54k8y444444444444447hö5jo8\ \[8X-DHT95Aj8\].webm Input #0, matroska,webm, from '6j9k54k8y444444444444447hö5jo8 [8X-DHT95Aj8].webm': Metadata: ENCODER : Lavf58.29.100 Duration: 00:00:45.14, start: -0.007000, bitrate: 1679 kb/s Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 3840x2160, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: DURATION : 00:00:45.120000000 Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default) Metadata: DURATION : 00:00:45.141000000 |
This tells us that the video is using the opus codec for the audio.
Then we can rip the audio to an mp4 file using FFmpeg.
(base) ┌─jason-Lenovo-H50-55@jason⬎ └─◉ 5.1-~/Videos-09:25-⚫ ◉--[$] ☕ ffmpeg -hide_banner -loglevel error -i 6j9k54k8y444444444444447hö5jo8\ \[8X-DHT95Aj8\].webm -map 0:a -acodec libopus audio.mp4 File 'audio.mp4' already exists. Overwrite? [y/N] y |
Now we have a nice mp4 file to listen to.
Use the -hide_banner -loglevel error parameters to FFmpeg to hide all of the build information and other useless info and be able to concentrate on the output.