Unsupported audio codec error when remuxing mkv to mp4 (2.7.5)

Started by gekemo, January 12, 2020, 02:03:07 PM

Previous topic - Next topic

gekemo

Hi, new to the forums and muxing, so apologies for being slow

I have a file like this:

=====================================================
Video
=====================================================
Codec 4CC:      HEVC
Image Size:      1920 x 1080
Aspect Ratio:      1:1 (1:1)
Frame Rate:      23.976 fps
Total Duration:      00:23:41.044

=====================================================
Extra Video Properties
=====================================================
ExtraDataSize:      1117
Extra data:      01 02 20 00 00 00 90 00 00 00

=====================================================
Audio
=====================================================
Codec:         OPUS
Channels:      Stereo
Bitrate:      11866 Bps / 94 kbps
Frequency:      48000 Hz
Total Duration:      00:23:41.043


I'm running a nightly build, the latest as of now: 2.7.5
I'm trying to convert a mkv to mp4 losslessly so I can run the file on a bluray player, and so I want to remux to mp4, but saving as mp4 just brings up the error, "Unsupported - Only AAC, AC3, E-AC3, MP2, MP3 and Vorbis supported for audio". Pretty sure it's because of the OPUS codec but is there anything I can do to change this? I saw a previous thread (https://avidemux.org/smif/index.php?topic=18114.0) which had a solution in an older version but they had a PCM codec in their file. Also, I was not able to understand the solution because of my lack of knowledge in programming. I'd appreciate any help in this.

eumagga0x2a

You will need to re-encode the audio track to a codec supported both by the MP4 muxer and the bluray player. Try AAC first, else AC3 (the default setting is "Copy" i.e. no re-encoding at all, select a different one from the dropdown list). Absolutely no programming involved.

gekemo

Quote from: eumagga0x2a on January 12, 2020, 02:13:43 PM
You will need to re-encode the audio track to a codec supported both by the MP4 muxer and the bluray player. Try AAC first, else AC3 (the default setting is "Copy" i.e. no re-encoding at all, select a different one from the dropdown list). Absolutely no programming involved.
I have tried every option other than copy and it gives the same error. My video output is copy, and the output format is mp4 muxer. Didn't change anything else.

eumagga0x2a

Do not try any, just load the source file, set audio output to "AAC (lav)" or "AC3 (lav)", then save. There should not be any error.

eumagga0x2a

Okay, I understand what might be going on. Please use the "Audio" --> "Select Track" dialog to take care of all audio tracks. There must be more than just one audio track in the source video file. The audio output dropdown applies only to the first one.

gekemo

Quote from: eumagga0x2a on January 12, 2020, 02:40:03 PM
Do not try any, just load the source file, set audio output to "AAC (lav)" or "AC3 (lav)", then save. There should not be any error.
I tried just as you said and the same settings in the image, still the same error.
I should mention, every time this error pops up 2 additional error messages open after: "Muxer - cannot open" and "Failed - File [filename.mp4] was NOT saved correctly." Is there any other information you need perhaps to help me solve this?

gekemo

Quote from: eumagga0x2a on January 12, 2020, 02:44:41 PM
Okay, I understand what might be going on. Please use the "Audio" --> "Select Track" dialog to take care of all audio tracks. There must be more than just one audio track in the source video file. The audio output dropdown applies only to the first one.
oh sorry for my previous message then, didn't see this reply yet. So should I select all tracks or just one?

gekemo

Quote from: gekemo on January 12, 2020, 02:53:19 PM
Quote from: eumagga0x2a on January 12, 2020, 02:44:41 PM
Okay, I understand what might be going on. Please use the "Audio" --> "Select Track" dialog to take care of all audio tracks. There must be more than just one audio track in the source video file. The audio output dropdown applies only to the first one.
oh sorry for my previous message then, didn't see this reply yet. So should I select all tracks or just one?
ah got it, you have to select only one, sorry I didn't get that.

gekemo

So it didn't have the error message and sucessfully saved. I played it on the bluray player and it played this time without telling me the file was unsupported, but only the audio seems to work. I figure that's because the file's in HEVC and that's too new for it, so I'm changing the video output this time to x264 (and keeping the AAC lav audio output). The estimated time remaining is about 2 hours. Is this normal? It may just be my potato laptop though.

eumagga0x2a

2 hours for a fullHD video (approx. 1/4 of real time) is an excellent speed at the default quality level. If your laptop has a NVIDIA graphics card, you might try the NVIDIA H.264 hw accelerated encoder, which achieves only low compression but is blazingly fast.

You can include up to 4 audio tracks. All of them must use codecs supported by the muxer, obviously.

gekemo

Quote from: eumagga0x2a on January 12, 2020, 03:44:29 PM
2 hours for a fullHD video (approx. 1/4 of real time) is an excellent speed at the default quality level. If your laptop has a NVIDIA graphics card, you might try the NVIDIA H.264 hw accelerated encoder, which achieves only low compression but is blazingly fast.

You can include up to 4 audio tracks. All of them must use codecs supported by the muxer, obviously.
Ah, okay. I found that I could select multiple audio tracks, so that wasn't the issue. One of them was in an unsupported codec, so that was probably the cause (muxing with both selected and changing the output codec of the unsupported one worked just fine). How might I enable this hardware accelerated encoder? And just how low compression are we talking? Because I plan to remux 13 fullHD files which are ~200mb each. I may need to do more files as well, because it appears people like to use mkv despite it being not very compatible.

eumagga0x2a

Quote from: gekemo on January 12, 2020, 05:59:56 PM
Quote from: eumagga0x2a on January 12, 2020, 03:44:29 PM
2 hours for a fullHD video (approx. 1/4 of real time) is an excellent speed at the default quality level. If your laptop has a NVIDIA graphics card, you might try the NVIDIA H.264 hw accelerated encoder, which achieves only low compression but is blazingly fast.
How might I enable this hardware accelerated encoder?

Does your laptop have a NVIDIA graphics card? If yes and the NVIDIA graphics driver is very recent, there should be a "Nvidia H264" encoder in the list of video encoders.

QuoteAnd just how low compression are we talking?

I fear, I can't provide any solid estimates. Maybe ~2x bitrate for the same visual quality compared to x264, but very content-dependent.

QuoteBecause I plan to remux 13 fullHD files which are ~200mb each.

If the video stream is HEVC, then apart from AV1 (which we support only for decoding at the moment), everything will inflate the file size unless you reduce resolution or accept a very big drop in quality.

If file size and bandwidth (max. possible read spead) don't matter, but the time matters and a hw accelerated encoder is available, yank the bitrate to 10000kbps (this might be even the default value) in the configuration of the "Nvidia H264" encoder to keep quality close to that of the source (you will always lose quality by re-encoding).

If both file size and quality matter, use x264 and accept relatively slow encoding speed at good quality levels.

QuoteI may need to do more files as well, because it appears people like to use mkv despite it being not very compatible.

Outside of the Apple bubble, MKV is widely supported by current hardware and software players.

gekemo

Quote from: eumagga0x2a on January 12, 2020, 06:52:28 PM
Quote from: gekemo on January 12, 2020, 05:59:56 PM
Quote from: eumagga0x2a on January 12, 2020, 03:44:29 PM
2 hours for a fullHD video (approx. 1/4 of real time) is an excellent speed at the default quality level. If your laptop has a NVIDIA graphics card, you might try the NVIDIA H.264 hw accelerated encoder, which achieves only low compression but is blazingly fast.
How might I enable this hardware accelerated encoder?

Does your laptop have a NVIDIA graphics card? If yes and the NVIDIA graphics driver is very recent, there should be a "Nvidia H264" encoder in the list of video encoders.

QuoteAnd just how low compression are we talking?

I fear, I can't provide any solid estimates. Maybe ~2x bitrate for the same visual quality compared to x264, but very content-dependent.

QuoteBecause I plan to remux 13 fullHD files which are ~200mb each.

If the video stream is HEVC, then apart from AV1 (which we support only for decoding at the moment), everything will inflate the file size unless you reduce resolution or accept a very big drop in quality.

If file size and bandwidth (max. possible read spead) don't matter, but the time matters and a hw accelerated encoder is available, yank the bitrate to 10000kbps (this might be even the default value) in the configuration of the "Nvidia H264" encoder to keep quality close to that of the source (you will always lose quality by re-encoding).

If both file size and quality matter, use x264 and accept relatively slow encoding speed at good quality levels.

QuoteI may need to do more files as well, because it appears people like to use mkv despite it being not very compatible.

Outside of the Apple bubble, MKV is widely supported by current hardware and software players.
In that case I'll just take the slower option. I'm trying to play on a bluray player and I'm pretty sure most dvd players don't support mkv.
Also is it possible to do this in batches or do I just do it one at a time?

eumagga0x2a

Quote from: gekemo on January 13, 2020, 04:20:05 AMis it possible to do this in batches [...]?

Yes, sure, both command line options as well as internal scripting (e.g. https://avidemux.org/smif/index.php/topic,18976.0.html) are available.

Please avoid fullquotes when possible.

gekemo

I seem to lose the subtitles in the process. How do I keep them intact/add them back in? I have already extracted the sub files from the original mkv.