BUG - Jerky playback of Xvid in MKV

Remuxing any Xvid-videostream into MKV is being played with microstutters or jerkiness in general on the SMP.

Samples: https://www.mediafire.com/folder/tgxgx8wwkm4vc/xvid

test.avi : Reference file, playback is fine. - GOOD

Mediainfo:

General
Complete name : K:\temp\test.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 4.96 MiB
Duration : 32s 282ms
Overall bit rate : 1 289 Kbps
Writing library : VirtualDub build 35491/release

Video
ID : 0
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings, BVOP : 1
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : XVID
Codec ID/Hint : XviD
Duration : 32s 282ms
Bit rate : 1 282 Kbps
Width : 640 pixels
Height : 352 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.237
Stream size : 4.93 MiB (99%)
Writing library : XviD 1.2.1 (UTC 2008-12-04)

test-default.mkv : Remuxing of test.avi using mmg.exe 7.1.0 with its default settings. Playback is jerky (looks like 10fps) or has microstutters every other second, depending on the setting of “match framerate”. - BAD

Mediainfo:

General
Unique ID : 182827350843907799364406480688069588352 (0x898B4457C62EF4668F250B76F701B580)
Complete name : K:\temp\test_default.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 4.95 MiB
Duration : 32s 283ms
Overall bit rate : 1 285 Kbps
Encoded date : UTC 2014-08-11 20:57:48
Writing application : mkvmerge v7.1.0 (‘Good Love’) 32bit built on Jul 27 2014 12:59:18
Writing library : libebml v1.3.0 + libmatroska v1.4.1
DURATION : 00:00:32.283000000
NUMBER_OF_FRAMES : 774
NUMBER_OF_BYTES : 5173664
_STATISTICS_WRITING_APP : mkvmerge v7.1.0 (‘Good Love’) 32bit built on Jul 27 2014 12:59:18
_STATISTICS_WRITING_DATE_UTC : 2014-08-11 20:57:48
_STATISTICS_TAGS : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Video
ID : 1
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : V_MS/VFW/FOURCC / XVID
Codec ID/Hint : XviD
Duration : 32s 282ms
Bit rate : 1 259 Kbps
Width : 640 pixels
Height : 352 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.233
Stream size : 4.85 MiB (98%)
Writing library : XviD 1.2.1 (UTC 2008-12-04)
Default : Yes
Forced : No

test-native.mkv : Remuxing of test.avi using mmg.exe 7.1.0 with the commandline option* “–engage native_mpeg4” enabled. - WORKAROUND/HACK

This option is NOT supported and its usage is NOT recommended by the Matroska-developers (from mmg):

Options meant ONLY for developpers. Do not use them. If something is considered to be an officially supported option then it’s NOT in this list!

Regarding “–engage native_mpeg4”:

Analyze MPEG4 bitstreams, put each frame into one Matroska block, use proper timestamping (I P B B = 0 120 40 80), use V_MPEG4/ISO/… CodecIDs.

 Mediainfo:

General
Unique ID : 245599115907427719587474239846347117898 (0xB8C4AB4E56E41ABD8E3F1A640487154A)
Complete name : K:\temp\test_native.mkv
Format : Matroska
Format version : Version 4 / Version 2
File size : 4.94 MiB
Duration : 32s 241ms
Overall bit rate : 1 287 Kbps
Encoded date : UTC 2014-08-11 20:57:48
Writing application : mkvmerge v7.1.0 (‘Good Love’) 32bit built on Jul 27 2014 12:59:18
Writing library : libebml v1.3.0 + libmatroska v1.4.1
DURATION : 00:00:32.241000000
NUMBER_OF_FRAMES : 773
NUMBER_OF_BYTES : 5173195
_STATISTICS_WRITING_APP : mkvmerge v7.1.0 (‘Good Love’) 32bit built on Jul 27 2014 12:59:18
_STATISTICS_WRITING_DATE_UTC : 2014-08-11 20:57:48
_STATISTICS_TAGS : BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Video
ID : 1
Format : MPEG-4 Visual
Format profile : Advanced Simple@L5
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : V_MPEG4/ISO/ASP
Codec ID/Info : Advanced Simple Profile
Duration : 32s 241ms
Bit rate : 1 261 Kbps
Width : 640 pixels
Height : 352 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.233
Stream size : 4.85 MiB (98%)
Writing library : XviD 1.2.1 (UTC 2008-12-04)
Default : Yes
Forced : No

Note the differences in the logs of the two MKVs.

avi:

Duration : 32s 282ms

default.mkv:

DURATION : 00:00:32.283000000
NUMBER_OF_FRAMES : 774

Codec ID                                 : V_MS/VFW/FOURCC / XVIDCodec ID/Hint                            : XviD

native.mkv hack:

DURATION : 00:00:32.241000000
NUMBER_OF_FRAMES : 773

Codec ID : V_MPEG4/ISO/ASP
Codec ID/Info : Advanced Simple Profile

Another workaround is to start playing the stuttering file, pause and skip back to timecode 00:00. Playback is without stuttering or jerkiness after doing this, which suggests that there’s nothing wrong with the file, but with how the SMP is handling it.

* In the mmg-window under “Muxing” / “Add command line options” / “### Development hacks ###”.

Interesting. What firmware revision do you use? And I wonder if other users experience similar results.

Regards,

All versions are affected, 1.04 up to 2.02.

Sidenote: The first WDTV plays default.mkv without problems.

When muxing to MP4, the file is also played jerky when it has an audio-track:

https://www.mediafire.com/folder/zu18pod74r6eb/test2

Looking forward to an update!

PS:

It’s not possible to skip to a desired time in a MKV muxed with the native-hack, so the “workaround” really is nowhere near being an alternative.

If the   test.avi   plays good … why bother converting / remuxing to mkv or mp4 ? 

EDIT:

just out of curiosity i remuxed test.avi > test.mkv using an older version of mkvmerge  Result: “Micro Jitters”

So, went to plan “B” and used Avidemux… (Video"Copy" Mkv Muxer) test.avi > test.mkv   Result: No framerate issues and no “Micro Jitters”

http://www.mediafire.com/download/6z29gvaafqcc5d3/test_avidemux.mkv

http://fixounet.free.fr/avidemux/

P.S. Firmware 2.02.32 (All HDMI output settings set to Auto)

I don’t see any microjitters on any of the files, not only the ones I’ve remuxed with 7.2.0 (new cue and tag setting turned of).  See for yourselves (quality is quite bad though).

My experience all around with Mpeg4 ASP (e.g. DivX, XviD, etc…) regardless of the container in which they are muxed has been very poor with the last few firmware versions. AVIs seem to make pretty long pauses when you start/skip the video, sometimes mp4 reproduction stops when you rw/ff, and some matroska files seem to have ‘micro-stutters’. None of these happen with other codecs, thankfully. Only with the family of MPEG-4 / ASP codecs.

Even though the video you labeled “bad” seems to play well for me I would recommend a couple of generic things to help solve this issue:

*one: I would remux all Matroska files with the " --engage no_cue_duration --engage no_cue_relative_position --disable-track-statistics-tags" options as a permanent part of mmg. Unlike the option you mentioned (–engage native_mpeg4) these are perfectly safe, they just remove things that were added in versions 6 and 7 of MMG. The last one probably doesn’t have any bearing in your issue, but the first two combined ( " --engage no_cue_duration --engage no_cue_relative_position") disable the addition of cue data related to the ‘version 4’ of the Matroska format. In my experience, that data messes up the navigation of matroska files played on the WDTV, badly. Videos that skip forward 10 mins almost instantly without that extra data, take almost forever to do the same with it. It shows up in the field “Format Version” as “Version 4 / Version 2”. With these command line options it becomes simply “Version 2”, as it were with versions of mkvtoolnix prior to v6.

* two: never put an Xvid stream that has the ‘packed bitstream’  hack inside a matroska container. Those files seem to play at 10-15 fps. When in doubt, always test avi files with the application ‘mpeg4 modifier’ before muxing it, and if it has ‘packed bitstream’, unpack it. In this case your Xvid seemed to be unpacked though, so that can’t be the problem.

* three: don’t use files without audio tracks as tests: those usually have poor navigation on the WDTV. Many files that play ‘clumsily’ without audio, play perfectly fine with it.

Even then, I still have one or two files that I haven’t figured out yet why they have ‘micro-stutters’ when they are muxed in mkv but play fine in avi, so I’m guessing there are even more issues.

By the way, the differences you see in the mediainfo logs are not relevant… mediainfo shows format/codec info in slightly different ways depending on the container (MP4, avi…) because the metadata is also stored differently in them. As you say, the problem is simply how the WDTV handles those files.