Audio desync on DVD rips

I’ve been ripping my way through our DVD library and ran into an oddity. The vast majority of my rips work great, but the newest slowly desyncs over time, falling further and further behind.

I rip to mp4 using Handbrake and used exactly the same profile (have for years now). Stopping and restarting an episode will sync it back up, but sure enough a minute or two in it starts to lag again. I checked another series ripped within a month of this one and it plays flawlessly.

Enabling or disabling audio passthrough doesn’t change the behavior. Are there other settings on OSMC I should look at?

Thanks!

Do you have a sample you can share?
If so, I will test it on my setup.
It might be something with the files.

Would also help to know which device and OSMC version you are using

Sam

It’s a 4k and it was recently reimaged and I’ve installed all prompted updates.

Can you recommend an application for clipping off a chunk of the MP4?

Wife was just dealing with/ignoring it yesterday and there have been some developments. The audio would fall further and further behind, then the video would black out for a moment and then begin again, synced. She left it playing for several hours through the season of the show and I didn’t notice any syncing issues when it was playing just now. I’m going to fire up the first episode of the series again as that is where it was initially happening so badly.

Maybe this was a temporary thing caused by networking issues to my Synology perhaps? Hmm…

Okay, a slight change to the complaint. The audio doesn’t appear to lag behind, although I would have sworn it did yesterday. It actually drifts ahead further and futher. Just started the first half dozen episodes and it happened in all cases. If you skip around with the seek function it would be synced initially, then begin to drift.

I would swear when it was running earlier after being on all night (we need background noise to sleep) it was perfectly synced for the half hour I watched before getting up.

Why would running and playing the episodes make any difference?

I just did a reboot as it hasn’t been restarted in at least a few days, maybe more. Same thing with the episodes’ audio leading by more and more as you watch.

Lossless Cut is free and simple.

You could adjust the video refresh rate to 25 images per seconds for DVD PAL or 29,976 for NTSC.
Settings → video → Adjust display refresh rate

I always have to do it when I watch French TV witch is at 50 images per seconds whereas Youtube is at 60 images per seconds.

I got a shorter 35MB clip that exhibits the same behavior and runs perfectly on VLC on Windows (like the original file does).

Here’s a link to the file on file.io https://file.io/WXpQRdM3Ty5I

If I should be using a different site or method let me know.

Edit: On my Vero 4k, it has a full on blackout at right about 1 minute where it attempts to sync back up, best I can tell.

I will test this sometime later today.

For others maybe looking at this without downloading the sample, this is the MediaInfo:

General
Complete name                            : D:\Downloads\SatC - S1E01-00.00.00.000-00.02.07.169.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 34.6 MiB
Duration                                 : 2 min 7 s
Overall bit rate                         : 2 277 kb/s
Frame rate                               : 25.547 FPS
Encoded date                             : 2024-01-19 22:34:42 UTC
Tagged date                              : 2024-01-19 22:34:42 UTC
Writing application                      : Lavf60.3.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2 min 7 s
Source duration                          : 2 min 7 s
Bit rate                                 : 2 110 kb/s
Width                                    : 716 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Variable
Frame rate                               : 25.547 FPS
Minimum frame rate                       : 23.974 FPS
Maximum frame rate                       : 29.970 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.240
Stream size                              : 32.0 MiB (93%)
Source stream size                       : 32.0 MiB (93%)
Writing library                          : x264 core 157 r2935 545de2f
Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=14000 / vbv_bufsize=14000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : 2024-01-19 22:34:42 UTC
Tagged date                              : 2024-01-19 22:34:42 UTC
Color range                              : Limited
Color primaries                          : BT.601 NTSC
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601
Menus                                    : 3
mdhd_Duration                            : 127343
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 2 min 7 s
Source duration                          : 2 min 7 s
Bit rate mode                            : Constant
Bit rate                                 : 161 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 2.44 MiB (7%)
Source stream size                       : 2.44 MiB (7%)
Title                                    : Stereo
Language                                 : English
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : 2024-01-19 22:34:42 UTC
Tagged date                              : 2024-01-19 22:34:42 UTC
Menus                                    : 3

Menu #1
ID                                       : 3
Format                                   : Timed Text
Codec ID                                 : text
Duration                                 : 2 min 7 s
Language                                 : English
Encoded date                             : 2024-01-19 22:34:42 UTC
Tagged date                              : 2024-01-19 22:34:42 UTC
Menu For                                 : 1,2
00:00:00.000                             : Chapter 1

Menu #2
00:00:00.000                             : Chapter 1


Right away my thoughts are that the Vero doesn’t play well with variable frame rate content.
Doesn’t the Vero lock sync with the display when it starts the file?

When I play it back on PC, MPC-HC locks it at 120 FPS which makes sense for divisibility reasons.
If the variable rate is between 24 and 30 then 120 will work but there will obviously be duplicate frames etc.
@angry.sardine would probably be able to give some good knowledge about this.
I have had some DVD remuxes plagued with the same sync issues.
Running them through handbrake and setting the frame rate to constant and choosing either 24 or 30 will solve the issue, but it may introduce new things like compression artifacts or what not depending on your settings.
@angry.sardine and myself are usually dealing with untouched MPEG-2 sources so there may be some differences between our experiences and yours.
But that’s just my initial thoughts.

It’s strange to me that it would use a variable framerate, but it looks like my Handbrake template uses “peak framerate” rather than constant framerate. What’s strange is, like I said, I have used this same template for so long and ripped so many of our DVDs and this is the first time I’ve had this effect on the player.

I appreciate you looking at it. Since the rip is from DVD, the quality is already not great (by today’s standards) so I’m not excited about reducing that to fix this, but perhaps it is the lesser of two evils. I’ll be interested to see what your thoughts are after you can take a closer look.

Oh no, I want nothing to do with this! :laughing:

You are quite likely right that the variable frame rate is messing things up, though.

@ruttiger If you simply remux the disc without transcoding at all, does that play better? That would also probably give optimal playback quality (at the cost of a much larger file).

Would that be just copying the entire DVD rip over to the drive? I’ve avoided that for the space considerations you mention.

I tried ripping the same episode twice, once with peak framerate selected and once with constant bitrate selected and the constant one seemed to be better. I messed with myself a bit by doing some testing on my Vero V, which appears to play the variable one fine. When I tried them on my Vero 4k, the audio sync issue was present in the peak framerate one and absent in the constant framerate one, so I think I’m just going to re-encode them all (sigh).