PDA

View Full Version : mkvmerge [mmg] skipping MP3 frames


jkwarras
20th February 2004, 09:26
Hi,

Lately I had audio related problems with two DVDRips when using mkvmerge [the gui-latest one] to mux Xvid video and MP3 VBR audio. That's what happened:

1) Ripped the movie into XviD and MP3 VBR --> Mux to avi (automated tool).
2) Remux to Matroska with mmg, defaults values, adding chapters, attachements and tags.

3) When muxing, log says that some frames where skipped because bad MP3 (I don't remember the term used 'frames', 'header'...). So in fact it skipped some frames.

I didn't pay too much attention to that really, and in fact I deleted the sources files and only keep the final matroska. But then, when playback, I've seen that a some point, the movie get suddenly out of sync with the audio and keeps like that until the end. Tried several players and versions of decoders, and it's not a decoder problem, so I only see that the reason is the 'skipping' issue into matroska.

I didn't pay attention this time because in others muxed files I already had see that, but it skipped very few frames so movie didn't get out of sync. But obviously this time it skipped too much.

Is this normal? Is there a way to prevent mmg to skip bad MP3 frames to avoid async? And if yes, it's safe or should we encode the audio again?

Thanks.

Regards.

jkwarras
24th February 2004, 10:00
Wow, it seems I'm the only one to get this strange behaviour :D

virux
24th February 2004, 11:20
um... I have the same behaviour too but only on some encodes that were already old
it also happens on older mkvmerge builds
it seems that the mp3 tracks got corrupted somehow
im afraid i havent found a solution that does not require reencoding (of the audio track) yet...

jkwarras
24th February 2004, 12:04
Originally posted by virux
um...it also happens on older mkvmerge builds

Ups! I've found out that I wasn't using the very latest mkvtoolnix GUI 0.8.4, so may be this was the problem.

it seems that the mp3 tracks got corrupted somehow im afraid i havent found a solution that does not require reencoding (of the audio track) yet...

As I don't have th eoriginal mp3, I'm afraid demuxing the file (with skipped frames) and reencoding it won't help. I'll have to resync at hand :(

Thanks for the info. Regards.

Mosu
24th February 2004, 12:44
mkvmerge will skip unknown bytes, not whole frames:

1) search for a valid MP3 header,
2) process as many bytes as belong to this frame as given by the header,
3) search for a valid MP3 header...
4) if there's a gap between where 2) left of and 3) found a new header this message is issued. Here there simply is no valid MP3 data available, so mkvmerge will discard that. Always. There's no way to make it not do that.

Your file is simply broken. The solution is to create non-broken files :)

jkwarras
24th February 2004, 14:10
Originally posted by Mosu
Your file is simply broken. The solution is to create non-broken files :)

That's what I though ;)

I don't know what happened, I used Besweet as usual.Anyway, thanks for the info.

Regards.

ssjkakaroto
24th February 2004, 16:51
i've got this problem sometimes but i never lost sync because of it :confused:

Atamido
24th February 2004, 17:00
Well, you have to lose several frames to make it noticeable. MP3 has 1152 samples per MP3 block. So, for 48kHz audio, it would take about 42 missing samples to equal a full second of lost audio. If you are only missing 4, then that is 96ms of lost synch. You could easily accomodate for that by makeing the audio about 40ms early at the beginning and you wouldn't likely be able to tell.

Mosu
24th February 2004, 18:05
It also depends on where in the stream these errors occur. The most common case is probably garbage at the very beginning inserted by some AVI tools in order to offset the stream (nandub...). In this case there might be a constant offset in the resulting Matroska file that can be easily fixed.

However, if such a problem occurs in the middle of the stream then you're usually screwed.

jkwarras
24th February 2004, 19:19
Originally posted by Mosu
However, if such a problem occurs in the middle of the stream then you're usually screwed.

Yep, this is my case. I'm screwed :p

wertherman
8th March 2004, 02:20
I have this problem with four avi files that are sitting on my hard disk. Mkvmerge (mkv-toolnix 0.82) displays the message "Warning: mp3_packetizer: skipping 25344 bytes (no valid MP3 header found)." or similar - the number of bytes varies depending on the file.

The files were all produced with AutoGK, could this be a problem of AutoGK instead of mkvmerge???

Mosu
8th March 2004, 08:59
Originally posted by wertherman
I have this problem with four avi files that are sitting on my hard disk. Mkvmerge (mkv-toolnix 0.82) displays the message "Warning: mp3_packetizer: skipping 25344 bytes (no valid MP3 header found)." or similar - the number of bytes varies depending on the file.

The files were all produced with AutoGK, could this be a problem of AutoGK instead of mkvmerge???

Yes. A couple of tools seem to produce garbarge ( = not valid MP3 frames) when they try to sync audio and video in an AVI. mkvmerge cannot handle this garbage and skips it. That's what the warning is about. I'm guessing that the resulting files will be slightly out of sync (a constant desync, meaning the discrepancy does not increase over time) which can be easily corrected with the sync option for the audio tracks.