[FFmpeg-trac] #4178(undetermined:open): Opus audio in MKV container

FFmpeg trac at avcodec.org
Fri Jan 23 02:57:22 CET 2015


#4178: Opus audio in MKV container
-------------------------------------+-------------------------------------
             Reporter:  agressiv     |                    Owner:  vigneshvg
                 Type:  defect       |                   Status:  open
             Priority:  important    |                Component:
              Version:  git-master   |  undetermined
             Keywords:  mkv opus     |               Resolution:
  regression                         |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  1            |
-------------------------------------+-------------------------------------

Comment (by agressiv):

 Ok, here is the explanation for the above files:

 '''st6.mka/opus'''
 Original Audio is encoded from TrueHD inside Source.mkv.  Source.mkv is
 about 32gb.

 {{{
 ffmpeg.exe -i Source.mkv -acodec libopus -b:a 256k Audio.opus
 }}}


 Source.mkv contains extremely high-bitrate Video.  I shrink that down with
 x264-x64.exe, and re-mux the file with mkvmerge.exe, which produces
 st6.mkv.

 {{{
 mkvmerge.exe -o st6.mkv -d 0 -A -S st6.264 --language 0:eng --sync 0:0 -a
 0 -D -S Audio.opus --chapters st6.xml
 }}}

 I then use ffmpeg to extract 20 seconds of audio, with the following
 command:

 {{{
 ffmpeg.exe -i st6.mkv -acodec copy -ss 00:00:00.0 -c copy -t 00:00:20.0
 st6.opus
 ffmpeg.exe -i st6.mkv -acodec copy -ss 00:00:00.0 -c copy -t 00:00:20.0
 st6.mka
 }}}

 The MKA file crackles at two points, whereas the Opus file does not.

 '''st7.mka/opus'''
 I use ffmpeg to extract opus from the original mkv encoding I did several
 months ago.
 {{{
 ffmpeg.exe -i st7.mkv -acodec copy -ss 00:00:00.0 -c copy -t 00:00:20.0
 st7.opus
 ffmpeg.exe -i st7.mkv -acodec copy -ss 00:00:00.0 -c copy -t 00:00:20.0
 st7.mka
 }}}

 st7.mka is obviously very similar to the original attachment; st7.opus is
 extracted from the mkv rather than the mka.

 The original Opus file which created st7.mkv is long gone.

 I tried lots of experimentation to see if I could get inconsistent
 results, such as using multiple computers, stressing out the disk when
 doing the audio encoding and muxing - nothing would cause it to behave
 inconsistently.

 '''st8.mka/opus''' (Not Uploaded)
 I encoded these directly from the 32gb original.  There were no artifacts.
 Note that mkvmerge is never in the equation either.
 {{{
 ffmpeg.exe -i Source.mkv -acodec libopus -b:a 256k -ss 00:00:00.0 -t
 00:00:20.0 st8.mka
 ffmpeg.exe -i Source.mkv -acodec libopus -b:a 256k -ss 00:00:00.0 -t
 00:00:20.0 st8.opus
 }}}

 I also tried the latest ffmpeg build (I was trying to re-create it from
 the old version I have, ffmpeg version N-67289-g7f24e1e from October)

 '''st9.mka/opus'''
 I encoded these just like st6.mka/opus, with mkvmerge, except with the
 latest ffmpeg binary, ffmpeg version N-69190-g6c559a0.  This actually
 sounds worse, more artifacts, but not as bad as st7.  Opus file plays ok.

 '''st10.mka/opus'''
 When I mux with ffmpeg instead of mkvmerge, I am not getting any problems:
 {{{
 ffmpeg.exe -i st10.264 -i Audio.opus -c copy -map 0:v:0 -map 1:a:0
 -shortest st10.mkv
 ffmpeg.exe -i st10.mkv -acodec copy -ss 00:00:00.0 -c copy -t 00:00:20.0
 st10.opus
 ffmpeg.exe -i st10.mkv -acodec copy -ss 00:00:00.0 -c copy -t 00:00:20.0
 st10.mka
 }}}

 So, this still points in the direction of mkvmerge, but since I do not
 really know how to analyze these files the way you guys can, I won't jump
 to any other conclusions.

 I've spent many hours on this now, and I'm sorry about all of the
 attachments, but I am very detail-oriented.  If there is still something
 else I can do to help narrow this down, let me know.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4178#comment:10>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list