[FFmpeg-user] Question about using Webm/Matroska container in audio transconding

Ivan Zderadicka ivan.zderadicka at gmail.com
Tue Dec 11 16:13:59 EET 2018


Hi,

I'm using ffmpeg for transcoding of audio (audio book chapters) into 
Opus stream that is then being sent to client.

I'm using Ogg container and Webm or Matroska container for resulting audio.

To convert to Opus I use following command (here is pipe going to test 
file, normally is pipe consumed and send to socket):

ffmpeg -i kapitola.mp3 -y -map-metadata 0 -map a -acodec libopus -vbr on 
-b:a 24k -compression_level 6 -cutoff 12000 -f opus pipe:1 > test1.opus

Same for Webm container:

ffmpeg -i kapitola.mp3 -y -map-metadata 0 -map a -acodec libopus -vbr on 
-b:a 24k -compression_level 6 -cutoff 12000 -f webm pipe:1 > test1.webm


Now Webm result  does not contain duration of audio stream (while in 
case of Ogg container correct duration is there), which basically means 
that result is not
seekable in client player.

If output of ffmpeg is a local file, not pipe, then duration is present. 
So I assume in case of Webm duration is added to file later ( same issue 
also for Matroska container).

Now my question is -  is there any workaround for this, am I missing 
something in arguments? Or is it intrinsic to Webm/Matroska container 
and nothing can be done about it, when output is pipe?
Why it works for Ogg and not for Webm?

Thanks
Ivan




More information about the ffmpeg-user mailing list