News:

--

Main Menu

Audio loss on saving

Started by tgwj77, February 21, 2023, 06:13:25 PM

Previous topic - Next topic

tgwj77

New to Avidemux - great tool which I am hoping to use a lot. I am using release 2.8.1.

I have a strange issue on saving one particular video file. All I am trying to do is trim the beginning and end of the programme and remove commercial breaks (although I am now just working with the unedited file to illustrate the issue).

Source video is a .ts file, recorded using Plex from a DVB-T2 broadcast in the UK. It includes some ads before the main programme, the main programme with 3 ad breaks within it, then a further ad break and the first few minutes of the subsequent programme. The .ts file loads and plays fine within Avidemux. I am then exporting in copy mode to a .mkv file.

However, in the exported .mkv the audio for the main programme is silent. The audio is OK for the ad breaks and sponsor bumpers before, during and after that programme. The audio from the few minutes of the following programme at the end of the file is also OK.

By chance, I noticed that the audio for the main programme is fine when I export a short clip of it. So I experimented with a few different clips from different parts of the video, including spanning the transition from ads to main programme and vice versa. Results (from playback in VLC):

1. 30" solely ads: ads audio OK
2. 30" solely programme: programme audio OK:
3. 15" ads followed by 15" programme: ads audio OK, programme audio silent
4. 15" programme followed by 15" ads: programme audio starts OK but goes silent 5" before ads, ads audio OK

And now for the really fun part of clip 4. If I play the clip through to the ads, and then use the time slider to go back to the first section of the clip containing the programme, the programme audio which played OK initially is now silent! Only if I use the restart button to jump back to the very beginning of the clip does that programme audio play OK again (until 5" before the ads).

Very strange!

I don't know whether the following is relevant, but the audio info for the original .ts file in the Properties section is as follows (and accordingly Avidemux only makes available one track - Track 0 - for selection in the Audio preferences):

=====================================================
Audio (1 active track)
=====================================================
Codec:            AAC
Channels:         6
Bitrate:         16000 Bps / 128 kbps
Frequency:         48000 Hz
Total Duration:         01:54:49.710


However, the audio options for playing the original .ts file in VLC show a couple of tracks (albeit the second one seems to be silent).

Any help would be gratefully received!

eumagga0x2a

Avidemux generally cannot handle any property changes within audio or video streams. In case of AAC, this codec needs so-called extradata which tells AAC decoder how to interpret the data in the stream. In MPEG-TS, AAC extradata is injected from time to time between AAC packets in a LATM encapsulated AAC stream, therefore it is technically easily possible to switch AAC stream properties on the fly. In MKV, extradata is provided globally, making intermittent format switches a no-go. Regarding Avidemux, the MPEG-TS demuxer extracts AAC extradata when detecting the audio track and that's it.

The only option in such a case is to use MPEG-TS streams which start with audio already in the right format. In this case, the stretch of audio stream which expects different extradata will fail to decode (potentially producing a huge amount of debug output filled with corresponding warning and errors). You cannot use Avidemux for this purpose as it will always use AAC extradata it found when detecting the streams.

tgwj77

Thank you! That makes sense. In that case I will have a play around with the original in Handbrake and see what I can produce.