Lossless extraction of streams from WebM
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Underwater World
--
Chapters
00:00 Lossless Extraction Of Streams From Webm
00:15 Answer 1 Score 43
01:48 Accepted Answer Score 17
02:02 Answer 3 Score 2
02:23 Answer 4 Score 1
02:41 Thank you
--
Full question
https://superuser.com/questions/412890/l...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#videoconversion #extract #lossless #webm
#avk47
ANSWER 1
Score 44
To extract audio from a WebM file, using the ffmpeg tool (https://www.ffmpeg.org/download.html) :
ffmpeg -i "input.webm" -vn -acodec copy "output.oga"
Explanation :
"-i input.webm" designates the input file
"-vn" removes the video stream from the output
"-acodec copy" tells ffmpeg to copy the audio stream as-is (no re-compression)
"output.oga" designates the output file.
NB : Use quotes "" around filenames that contain spaces.
The output file extension has to match with the format of the audio stream contained in the source webm file.
I use ".oga" as output file extension because most webm files I handle contain Vorbis audio.
".oga" is the prefered extension in this case, even if .ogg is still a frequently encountered extension for vorbis audio-only files.
This command line based on ffmpeg should give you the audio format from the source file :
ffmpeg -i "inputfile.ext"
Search for the line containing the text "Audio", usually near the end of the command output.
In my case, this is the output :
Stream #0:1: Audio: vorbis, 44100 Hz, stereo, fltp (default)
Reading this wikipedia page might give you some insight on which file extensions should be used with which audio formats : http://en.wikipedia.org/wiki/Audio_file_format
ACCEPTED ANSWER
Score 18
Since WebM is a Matroska subset, mkvtoolnix should let you demux the files. It's open source, cross platform, and the author provides binaries for Windows.
ANSWER 3
Score 2
With MKVToolNix – Matroska tools for Linux/Unix and Windows:
mkvextract.exe "file.webm" tracks 0:"file_audio.ogg"
(assuming audio track ID is 0 - you can check with mkvinfo.exe
or mkvtoolnix-gui.exe
)
ANSWER 4
Score 1
Video files have a container format and codec formats.
Its hard to 'extract' the video bits easily, but it is possible to change the container format to something you can consume whilst not altering the video bits:
ffmpeg using -vcodec copy
(and typically -an
to strip any audio)