Tried the script for newer ffmpeg and this works now, but still get a bad a/v sync, sound way ahead of video, when converting mp4 to mkv

(Elephants Dream (1080p) from Blender project)
Duration: 00:10:53.79, start: 0.000000, bitrate: 3519 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 125 kb/s
    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 3391 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc