Aha! Everything is clear now.
MakeMKV is not a fraud. It is deleting only major frames and not performing any other adjustments, e.g., to the timestamps. Thus, I would expect ffmpeg to bomb when converting the THD stream demuxed from the MKV to FLAC. And it does! It fails exactly as does DGDemux. I suppose it is not surprising as there was never an answer to Mike's post asking how to properly adjust timestamps (last post here:
https://github.com/Nevcairiel/LAVFilters/issues/282). Thus, MakeMKV is implementing option 2 below. tsmuxer is implementing option 1 but truncating the audio to the length of the video when the video is also demuxed along with the audio.
Therefore, unless one of our esteemed members finds something to challenge this, it looks like we will have to go with our solution for creating a clean in-sync flac file. To remind you, the options are proposed to be:
1. Demux the stream raw. Keeps ATMOS but no sync correction and does not bomb ffmpeg FLAC conversion. Use when not too many M2TS files are in the playlist.
2. Demux with gaps correction. Keeps ATMOS and does sync correction but bombs ffmpeg FLAC conversion. Use when you have too many M2TS files. You can use the THD file directly in (say) mkvtoolnix, as players don't care about the spec violation.
3. Demux raw and correct sync in the uncompressed domain. Does sync correction and does not bomb ffmpeg but loses ATMOS. Not a big deal because any conversion to FLAC would lose ATMOS. Use when you want a sync-corrected FLAC file.
I do not see any way to make a valid sync-corrected THD file that retains the ATMOS. Maybe it could be possible by re-encoding the clean FLAC from 3 to THD and re-adding the ATMOS metadata. Not something that is going to be feasible absent a full-featured THD encoder and some technology to save and restore ATMOS metadata. Forget about it!
I conclude that method 3 (successfully concept tested) is the ONLY way to make a sync-corrected FLAC file. Your feedback on this conclusion and proposal will be greatly appreciated.
domy?
renols?
gonca?