I've been transcoding my video files I made using makemkv. My encoding script can be found in this forum, too. Now I've been experiencing audio/video sync issues. The audio drops out of sync exponentially as the video progresses towards the end.
I have checked the original mkv files using mediainfo and they do not contain audio delay. Also I believe makemkv corrects audio delay to mkv files. I use the "expert mode" and "show AV sync issues" options in makemkv, but I never get any messages about them in the output.
The next step for me was to extract the audio and video timecodes from the original mkv file and mux it into the final mkv file I create using mkvmerge. Here is how I extract and mux them:
Code: Select all
Extract:
mkvextract timecodes_v2 "video.mkv" 1:"video-timecodes.txt" \
2:"audio-timecodes.txt"
Muxing:
mkvmerge --default-language eng -o "video-muxed.mkv" \
--language 0:eng --compression 0:none --timecodes 0:"video-timecodes.txt" -d 0 --no-chapters -A -S "video.h264" \
--language 0:eng --compression 0:none --timecodes 0:"audio-timecodes.txt" -a 0 --no-chapters -D -S "audio.m4a" \
--chapter-language eng --chapters "chapters.txt"
Code: Select all
mkvmerge v6.7.0 ('Back to the Ground') 64bit built on Jan 9 2014 18:03:17
'video.h264': Using the demultiplexer for the format 'AVC/h.264'.
'audio.m4a': Using the demultiplexer for the format 'QuickTime/MP4'.
'video.h264' track 0: Using the output module for the format 'AVC/h.264 (unframed)'.
'audio.m4a' track 0: Using the output module for the format 'AAC'.
The file 'video-muxed.mkv' has been opened for writing.
'video.h264' track 0: Extracted the aspect ratio information from the MPEG-4 layer 10 (AVC) video data and set the display dimensions to 720/405.
Warning: 'audio.m4a' track 0: The number of external timecodes 945 is smaller than the number of frames in this track. The remaining frames of this track might not be timestamped the way you intended them to be. mkvmerge might even crash.
mkvmerge: /build/buildd/libmatroska-1.4.1/make/linux/../../src/KaxCluster.cpp:279: int16 libmatroska::KaxCluster::GetBlockLocalTimecode(uint64) const: Assertion `TimecodeDelay >= int16(0x8000) && TimecodeDelay <= int16(0x7FFF)' failed.
./mux.sh: line 4: 12944 Aborted mkvmerge --default-language eng -o "video-muxed.mkv" --language 0:eng --compression 0:none --timecodes 0:"video-timecodes.txt" -d 0 --no-chapters -A -S "video.h264" --language 0:eng --compression 0:none --timecodes 0:"audio-timecodes.txt" -a 0 --no-chapters -D -S "audio.m4a" --chapter-language eng --chapters "chapters.txt"