View Single Post
Old 9th February 2019, 01:14   #385  |  Link
mkver
Registered User
 
Join Date: May 2016
Posts: 197
Quote:
Originally Posted by manolito View Post
The average user will not have such analysis skills (I certainly don't), and we have software like mkvextract and mkvmerge to do this automatically. This is all I am asking for.
The software can't read your mind, but what could be done is that if a Matroska file has a video track and you select to not extract the video track, then the delay that is put into the filenames should not be calculated as if the video started with 0, but rather as if the video timestamps were unchanged (in your example, the delay that would be put in the filenames would be 5ms and 65ms). You may ask gpower2 about it; but who knows: Maybe someone else would call the behaviour just proposed weird.
(And what should happen when there is more than one video track? I don't know.)

There is BTW a second workaround for you that is only applicable when your recording contains a few seconds at the beginning that you want to discard (there needs to be a complete GOP at the beginning that you don't want to keep). When you initially remux from ts to mkv, you can let mkvmerge split by parts based on timestamps in order to discard the very beginning. The lowest timestamp of the main video track will then be zero (for each part). So the problem you encountered here doesn't happen for such files.
Quote:
Originally Posted by manolito View Post
The reason why I need to extract the audio track(s) from the source MKV is that I use StaxRip (an older 32-bit version) to recode the HD source HEVC / AAC-LATM (or E-AC3) into an SD AVC / AAC file. And StaxRip processes the audio separately from the video, and the extracted audio always needs to be decompressed to PCM first to make frame accurate editing possible.
I don't use StaxRip, but keep in mind that StaxRip may add confusion of its own to the offsets. (I.e. does StaxRip even care about the offset in the input file (namely that the first video track doesn't start at zero?)? How does it handle the fact that the lowest video timestamp belongs to an undecodable frame (one of the B-frames shared between GOPs?)?)
Quote:
Originally Posted by manolito View Post
If I have repacked a captured MTS file to MKV first and there are glitches in this file, I will loose audio sync. But by trial and error I found out that this does not happen if I use the original MTS or TS as the source for StaxRip. My source filter is DSS2Mod, and when the source has transmission errors and I use the original Transport Stream as the source then I will see the broken frames, but sync is maintained.
Newer versions of mkvmerge discard whole PES packets when mkvmerge detects any errors (by looking at the continuity counter). This might explain your observation. The last version that didn't do this was AFAIK 19.0.
mkver is offline   Reply With Quote