February 27, 2021, 03:13:35 AM

News:

--


Opus track invisible in MKV

Started by Blues, October 17, 2018, 11:20:16 AM

Previous topic - Next topic

Blues

matroska_reader: The CodecID for track 1 is 'A_OPUS', but the private codec data does not contain valid headers.

This is what I get from mkvtoolnix when I try to open a file encoded by Avidemux.

eumagga0x2a

WFM with Avidemux from the current git master and mkvtoolnix 25.0.0. Please specify steps to reproduce.

Blues

Loaded file to Avidemux (git a few days ago), video to copy, audio to Opus bitrate 96, container MKV. Resulting file plays in MPV, but when loaded to mkvtoolnix-23.0 GUI [to add subtitles] there is no audio track. Getting the mentioned error instead. You think the mkvtoolnix is too old?

eumagga0x2a

October 17, 2018, 04:07:58 PM #3 Last Edit: October 17, 2018, 04:16:27 PM by eumagga0x2a
Well, I tested with bitrate set to 128 kbit/s, but I doubt this would matter.

QuoteYou think the mkvtoolnix is too old?

It may depend on the opus version on your system as well. I use v1.3.

Actually, mkvtoolnix has such a high pace of development that trying a build from the git head looks reasonable.

Blues

OK, thanks. At least I know now where to look.

Blues

OK, something is wrong. I have a file here, from youtube, mkv, opus audio. When I use Avidemux to extract audio I get a file which does not identify as opus. When I use mkvextract it gives me opus file.
File itself is here: http://www.asclinux.com/tmp/hmsn.mkv

eumagga0x2a

Avidemux saves only raw audio data, no Ogg container structures and no codec extradata, unfortunately, which renders the feature in case of Opus audio useless.

Blues

Right, so this is also the reason for problem in the first post.

eumagga0x2a

I don't think so. Avidemux correctly handles Opus extradata when muxing, just not when dumping a raw stream.

Blues

November 25, 2019, 05:53:34 PM #9 Last Edit: November 25, 2019, 07:13:18 PM by Blues
I'm still having issue with opus. Avidemux-2.7.4, mkvtoolnix-37. Using Avidemux to encode audio in opus and muxing into mkv. When trying to add subtitles with mkvtoolnix the resulting file has no audio. Tried to extract audio from this mkv, got this error:
Error: Track 1 with the CodecID 'A_OPUS' is missing the "codec private" element and cannot be extracted.
Made further attempt to get the audio out of Avidemux created mkv so I could remux it with added subtitles. With ffmeg:
[opus @ 0x55d2160dec80] No extradata present
Could not write header for output file #0 (incorrect codec parameters ?): Invalid data found when processing input
Stream mapping:
  Stream #0:1 -> #0:0 (copy)

Then VLC, set video and audio into copy mode, the output mkv has no audio. Tried to play this file with VLC, silence. The only application which can find the audio is MPV so far.

How can I add subtitles to this file? I do not want to recode the audio.

OK. I managed to redo all cutting and editing in original file and create a matching audio file for my video. Then I encoded it using opusenc and all is fine now. Just have to remember not to use opus encoding in Avidemux. :(

eumagga0x2a

I'll look into creating Opus extradata. On Linux, all video players play mkv files with Opus audio as generated by Avidemux just fine (indeed, mkvtoolnix doesn't like that extradata are missing and drops the audio track). FFmpeg won't add extradata on its own, which are required for saving audio as a file, but apart from that, happily remuxes extradata-less mkv.

eumagga0x2a

mkvtoolnix should be happy now. Please be aware that this doesn't enable Avidemux or mkvtoolnix to dump the audio stream to a playable audio file.

Blues