Stutter with 29.970Hz MPEG2 NTSC video

During the testing for the DTS-HD MA/HRA passthrough issue, another issue got noticed which I’d like to address in this thread:

MPEG2 videos with NTSC resolution - 480p - and framerate - 29.970Hz - are causing massive stutter. They stutter in a regular, less-than-one-second interval. No frame drops are shown and the sound plays fine. The issue showed with some publicly available test files, so it’s easily reproducable for others with these files:

dolby_aurora-DWEU.vob

MediaInfo:

===================== General =====================
Complete name               : [...]\dolby_aurora-DWEU.vob
Format                      : MPEG-PS
File size                   : 28.7 MB
Duration (ms)               : 34s 17ms
Overall bit rate            : 7 084 Kbps

===================== Video =====================
Id                          : 224 (0xE0)
Format                      : MPEG Video
Formatversion               : Version 2
Formatprofile               : Main@Main
Formatsettings, BVOP        : Yes
Formatsettings, Matrix      : Custom
Formatsettings, GOP         : M=3, N=12
Duration (ms)               : 34s 17ms
Bit rate                    : 6 500 Kbps
Width                       : 720 pixels
Height                      : 480 pixels
Display aspect ratio        : 16:9
Frame rate                  : 29.970 (30000/1001) fps
Standard                    : NTSC
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 0.628
Time code of first frame    : 01:11:58:00
Time code source            : Group of pictures header
GOP, Open/Closed            : Open
GOP, Open/Closed of first f : Closed
Stream size                 : 26.3 MB (92%)

===================== Audio =====================
Id                          : 189 (0xBD)-128 (0x80)
Format                      : AC-3
Format info                 : Audio Coding 3
Mode extension              : CM (complete main)
Formatsettings, Endianness  : Big
Muxing mode                 : DVD-Video
Duration (ms)               : 33s 856ms
Bit rate mode               : Constant
Bit rate                    : 448 Kbps
Channel(s)                  : 6 channels
Channel positions           : Front: L C R, Side: L R, LFE
Sampling rate               : 48.0 KHz
Frame rate                  : 31.250 fps (1536 spf)
Compression mode            : Lossy
Stream size                 : 1.81 MB (6%)

===================== Menu =====================

dolby_rain-DWEU.vob

MediaInfo:

===================== General =====================
Complete name               : [...]\dolby_rain-DWEU.vob
Format                      : MPEG-PS
File size                   : 30.4 MB
Duration (ms)               : 36s 19ms
Overall bit rate            : 7 069 Kbps

===================== Video =====================
Id                          : 224 (0xE0)
Format                      : MPEG Video
Formatversion               : Version 2
Formatprofile               : Main@Main
Formatsettings, BVOP        : Yes
Formatsettings, Matrix      : Custom
Formatsettings, GOP         : M=3, N=12
Formatsettings, picture str : Frame
Duration (ms)               : 36s 19ms
Bit rate                    : 6 500 Kbps
Width                       : 720 pixels
Height                      : 480 pixels
Display aspect ratio        : 16:9
Frame rate                  : 29.970 (30000/1001) fps
Standard                    : NTSC
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Interlaced
Scan order                  : Top Field First
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 0.628
Time code of first frame    : 01:08:58:00
Time code source            : Group of pictures header
GOP, Open/Closed            : Open
GOP, Open/Closed of first f : Closed
Stream size                 : 27.8 MB (92%)

===================== Audio =====================
Id                          : 189 (0xBD)-128 (0x80)
Format                      : AC-3
Format info                 : Audio Coding 3
Mode extension              : CM (complete main)
Formatsettings, Endianness  : Big
Muxing mode                 : DVD-Video
Duration (ms)               : 35s 840ms
Bit rate mode               : Constant
Bit rate                    : 448 Kbps
Channel(s)                  : 6 channels
Channel positions           : Front: L C R, Side: L R, LFE
Sampling rate               : 48.0 KHz
Frame rate                  : 31.250 fps (1536 spf)
Compression mode            : Lossy
Stream size                 : 1.91 MB (6%)

===================== Menu =====================

dts_sonic_landscape-DWEU.vob

MediaInfo:

===================== General =====================
Complete name               : [...]\dts_sonic_landscape-DWEU.vob
Format                      : MPEG-PS
File size                   : 20.4 MB
Duration (ms)               : 19s 52ms
Overall bit rate mode       : Variable
Overall bit rate            : 8 999 Kbps

===================== Video =====================
Id                          : 224 (0xE0)
Format                      : MPEG Video
Formatversion               : Version 2
Formatprofile               : Main@Main
Formatsettings, BVOP        : Yes
Formatsettings, Matrix      : Custom
Formatsettings, GOP         : M=3, N=12
Duration (ms)               : 19s 52ms
Bit rate mode               : Variable
Bit rate                    : 7 310 Kbps
Maximum bit rate            : 7 500 Kbps
Width                       : 720 pixels
Height                      : 480 pixels
Display aspect ratio        : 16:9
Frame rate                  : 29.970 (30000/1001) fps
Standard                    : NTSC
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 0.706
Time code of first frame    : 01:00:00:00
Time code source            : Group of pictures header
GOP, Open/Closed            : Closed
Stream size                 : 16.6 MB (81%)

===================== Audio =====================
Id                          : 189 (0xBD)-136 (0x88)
Format                      : DTS
Format info                 : Digital Theater Systems
Mode                        : 16
Formatsettings, Endianness  : Big
Muxing mode                 : DVD-Video
Duration (ms)               : 18s 848ms
Bit rate mode               : Constant
Bit rate                    : 1 510 Kbps
Channel(s)                  : 6 channels
Channel positions           : Front: L C R, Side: L R, LFE
Sampling rate               : 48.0 KHz
Frame rate                  : 93.750 fps (512 spf)
Bit depth                   : 20 bits
Compression mode            : Lossy
Stream size                 : 3.39 MB (17%)

===================== Menu =====================

Here are logs with hardware acceleration enabled for MPEG2:

http://paste.osmc.tv/eqapudamec

Playback with hardware acceleration turned on produces stutter although Vero seems to go into the correct display mode (60p is shown - question would be, if its 59.940Hz or 60Hz).

and logs with hardware acceleration disabled for MPEG2:

http://paste.osmc.tv/imaqocosox

When hardware acceleration is disabled, the stutter isn't there for the first few seconds of playback (60p is the display mode chosen by the Vero again) and then the display mode switches to 24p (short black screen and display mode switch).

It’s not a critical issue that should be fixed as soon as possible, but it occurs with a video format which is pretty basic: MPEG2 used for NTSC DVDs. So, I guess, it would be nice, if this could be fixed.

As I can’t test for a while from tomorrow on, I’d like to invite especially @JimKnopf to help testing here, if needed, as he discovered the issue, too.

Yep, I’m on board. Since it is so easy to reproduce, I assume there is no need for further information but let me know if you need some after all.

I cannot reproduce this with rips of DVDs created with MakeMKV. I have hundreds of files created this way.

brian@gelth /media/Rutan/TV Shows/Gentle Ben/S01 $ mediainfo Gentle\ Ben\ S01E01.mkv
General
Unique ID                                : 139290595299625652955911445369965189485 (0x68CA64918CA4399BC2DBCCA05F7F196D)
Complete name                            : Gentle Ben S01E01.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 982 MiB
Duration                                 : 25mn 27s
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 394 Kbps
Encoded date                             : UTC 2018-01-13 02:48:07
Writing application                      : MakeMKV v1.10.8 linux(x64-release)
Writing library                          : libmakemkv v1.10.8 (1.3.5/1.4.7) x86_64-linux-gnu
Original source medium                   : DVD-Video

Video
ID                                       : 1
ID in the original source medium         : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : Variable
Format settings, picture structure       : Frame
Codec ID                                 : V_MPEG2
Codec ID/Info                            : MPEG 1 or 2 Video
Duration                                 : 25mn 27s
Bit rate mode                            : Variable
Bit rate                                 : 5 190 Kbps
Maximum bit rate                         : 9 800 Kbps
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) fps
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.501
Time code of first frame                 : 00:59:58;00
Time code source                         : Group of pictures header
Stream size                              : 945 MiB (96%)
Language                                 : English
Default                                  : No
Forced                                   : No

Audio
ID                                       : 2
ID in the original source medium         : 189 (0xBD)-128 (0x80)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 25mn 27s
Bit rate mode                            : Constant
Bit rate                                 : 192 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 spf)
Compression mode                         : Lossy
Stream size                              : 35.0 MiB (4%)
Title                                    : Stereo
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
ID in the original source medium         : 189 (0xBD)-32 (0x20)
Format                                   : VobSub
Codec ID                                 : S_VOBSUB
Codec ID/Info                            : Picture based subtitle format used on DVDs
Duration                                 : 24mn 38s
Bit rate                                 : 6 451 bps
Count of elements                        : 449
Stream size                              : 1.14 MiB (0%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Menu
00:00:00.000                             : en:Chapter 01
00:01:34.160                             : en:Chapter 02
00:14:35.875                             : en:Chapter 03
00:22:54.906                             : en:Chapter 04
00:24:45.851                             : en:Chapter 05

I wonder if it could be because they are VOB instead of MKV.

@JimKnopf @Chillbo

Do you have any clips that you can send to reproduce this issue. Preferably not demo clips, but actual clips of real content?

For now, setting MPEG2 acceleration to HD and up will resolve this problem I suspect.

I noticed your comments on this the other day, as well as the fact that this seems to be a recent issue.

Can you let me know what other videos exhibited this problem, and with which version of OSMC they first appeared?

Cheers

Sam

I suspect from this comment (I missed it my first read) that the test file that you are using is switching framerate midstream. That’s not normal.

Do you have Adjust Framerate set to Always or Start? Does changing that make a difference?

I’ve another movie trailer clip with exact the same symptoms

  • NTSC
  • framerate switch 29.97 Hz to 23.98 Hz after some seconds
  • without HW Acceleration and Adjust Framerate set to ALWAYS the clip runs smooth , of course with a short pause and black screen when the framerate switch occurs

NTSC is quite difficult for me since it is only popular in North- and South-America but not at all in Europe and seldom in Asia Pacific region. But will have a look into me collection.

Addtion:
Finally found two DVDs I own with NTSC: Animusic 1 + Animusic 2 and created some tests vobs but I’m not able to reproduce the stutter issue with that.
Comparing the created vobs with the failing trailers with mediainfo, I can only see the following differences

  • the failing trailers have a framerate switch after some seconds
  • the failing trailers use a fix GOP structure whereas the Animusic trailers show a variable one

From my point of view the issue is at the moment isolated to the 3 movie trailers which seem to be created with some unhealthy properties (frame rate switch).

Actually, no :innocent: It occured in the test thread and I didn’t notice the special framerate features of the files… I don’t have any others here.

Yep, it looks like that! I thought that the described behaviour (When hardware acceleration is disabled, the stutter isn't there for the first few seconds of playback (60p is the display mode chosen by the Vero again) and then the display mode switches to 24p (short black screen and display mode switch).) was part of the issue, but now that you guys pointed out that the file actually changes the framerate itself, it looks all fine without acceleration. :see_no_evil:

Yep, very recent and therefore only appeared on the Stretch build (2017.12-1).

The setting I use here is always, so just from that point of view - knowing now that the video is special in regard to the framerate switch - I’d expect the Vero to change the framerate midstream. But that only happens when acceleration is turned off.

I agree! It looks like a very rare phenomenon which we might be able to neglect…

Let’s keep an eye on it, but leave things for now

Sam

It would be interesting to see what happens if you try Start instead. But I agree that this issue is probably not worth pursuing.

Im unsure if this is the same thing, but today I had my first unsmooth experience.

Its a 29fps dvd (Video_TS/xxxx.vob)

Sound is fine, video is microstuttering all the time. If I stop and then resume it runs smooth for a while.
It doesnt look like it buffers (no grey bar ahead of the blue bar)

What can I try? I already tried the sync thingy wich says audio passthrough might not work and it made the sound cracy/poppy/unbearable so switched that back quick.

Ideas? Im open for some tuning of cashing/buffer or any on/off setting first and foremost but am very unsure what to touch seince everthing else is running silky smooth and dont really want to screw something up.

Regarding video stutters the low hanging fruits to check are settings you find at

GUI Settings->Player->Video

There activate “Adjust Display Refresh Rate” and deactivate “Sync Playback to Display”.

This should be the first to check.

It didnt work. But I found something out - what happens is this:

  1. I start the video and all plays fine.
  2. Screen goes black and it says (DolbyDigital+) on my reciever and the video starts to stutter.

If I search or jump or stop we go back to 1 and then 2 over again. Its reproducable but doesnt always happen after exactly the same amount of time but usually after 30seconds-1min.

The video is a rip from the chronological donald and only has 2.0 sound. I activated the “jump over startupscreen” since this is one of the reasons I like to have them on hdd since the kids like these discs and they have a superlong intro…

I think it is NTCS since I bought it overseas and I live in Europe.

Have you tried using MakeMKV to remux the video?

I havent tried anything since its the first movie with problems. I could try that, but isnt it wierd that it doesnt seem to buffer, all my other videos have this grey bar ahead of the blue but not here…maybe its not important but like to point it out again.

What should I use for program and what is my prefered outcome here? Make it 25fps?

Use MakeMKV (it’s free) and just grab the episodes as-is. MakeMKV just re-muxes, it doesn’t mess with framerates, etc.

Could you also post MediaInfo of the file?

Tell me how to find the info.

If you’re using Windows: MediaInfo

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 1
Bit rate mode : Variable
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate : 29.970 (29970/1000) FPS
Standard : NTSC

Sorry that was the menu I think.

Here the first VOB:

Format : MPEG-PS
File size : 1 024 MiB
Duration : 32 min 12 s
Overall bit rate mode : Variable
Overall bit rate : 4 445 kb/s

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings : CustomMatrix / BVOP
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : Variable
Duration : 32 min 12 s
Bit rate mode : Variable
Bit rate : 4 229 kb/s
Maximum bit rate : 8 126 kb/s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.408
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
GOP, Open/Closed : Open
GOP, Open/Closed of first frame : Closed
Stream size : 974 MiB (95%)

Audio
ID : 189 (0xBD)-128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Muxing mode : DVD-Video
Duration : 32 min 12 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 29.5 MiB (3%)
Service kind : Complete Main