Repository navigation
Description
What happened?
VC-1 Advanced Profile content played through AetherEngine's software decode path judders, reproducibly, on Apple TV 4K (via Sodalite/Jellyfin or Moonfin/Jellyfin) and does not judder in mpv or other FFmpeg-based players on the same files on AppleTV. The interlace/deinterlace subsystem, container transport, and file bitrate have all been ruled out. The most likely cause is that AetherEngine's software decoder reads AVFrame.pts directly rather than FFmpeg's best_effort_timestamp, and AVFrame.pts is unset (AV_NOPTS_VALUE) on every I and P frame in affected files — only B-frames carry a valid raw pts. AVSampleBufferDisplayLayer, which the software path uses for presentation, has no independent pacing/cadence model, so it presents strictly on whatever CMTime it's given — any inaccurate fallback timestamp for the 60% of frames lacking raw PTS becomes visible, periodic judder.
Steps to reproduce
Play a VC-1 file in Sodalite
It will exhibit significant (unwatchable) video judder
AetherEngine version or commit SHA
as embedded in Sodalite 1.0.0 (20)
Host app
Sodalite
Platform
tvOS
OS version
tvos 26
Device / chip
Apple TV 4k 3g
Playback path
Software (dav1d) host
Source media (for playback bugs)
vc1 (Advanced) (WVC1 / 0x31435657), yuv420p(progressive), 1920x1080, 23.98 fps, 23.98 tbr, 1k tbn, Matroska container, TimecodeScale default (ms granularity)
Error codes / log lines
Anything else
From Claude based on extensive analysis of video files, logs, and testing across devices and media types. I also have separate analysis of why this is an issue with AetherEngine and not mpv and other ffmpeg based media players.
Environment
- Repo:
github.com/superuser404notfound/AetherEngine, HEAD examined4219e140(2026-08-22), release tag6.34.1 - Clients: Sodalite and AetherPlayer both pin
f4bebc0fd3c66f656ef18d2c7c0b3243df3ac86d= tag6.34.1(current release, not stale) - Playback target: Apple TV 4K
- Reproduces via: Jellyfin/Sodalite over 1 Gbps, and direct SMB mount over 10 Gbps — identical judder both ways
- Sample file: 1920x1080 VC-1 (Advanced), progressive, 23.98 fps, ~19.7 Mb/s, Matroska container, B-frames present
What's been ruled out
- Profile-conditional interlace assumption. No code path branches on VC-1 profile;
VideoRoutingPolicy.requiresSoftwarePathroutes all VC-1 to software unconditionally regardless of field order (VideoRoutingPolicy.swift:29-47), androutesSoftwareForDeclaredInterlaceis hard-gated to H.264 only (VideoRoutingPolicy.swift:58). - Deinterlace filter engaging on progressive content.
DeinterlaceFilteronly activates on the decoded frame's actualAV_FRAME_FLAG_INTERLACEDflag, checked per-frame (SoftwareVideoDecoder.swift:235-269). Confirmed via directffprobe -show_framesagainst the reproducing file:repeat_pict=0on every frame in a 37.5s sample — no pulldown/interlace signaling present in the bitstream at all. - Historical PTS-doubling bug (
eedaa5b5). Fixed since 3.11.2, and in any case only fires whenDeinterlaceFilteris active — moot here since the deinterlacer never engages for progressive content. - Transport/bitrate. Identical judder over both a 1 Gbps Jellyfin stream and a 10 Gbps local SMB mount rules out network throughput and IO buffering as a cause.
- Container/demuxer-level timestamp irregularity.
ffprobe -show_entries frame=pts_time,best_effort_timestamp_time,pkt_dts_time,pict_type,repeat_pictagainst the actual reproducing file showsbest_effort_timestamp_timepopulated on 100% of frames, evenly spaced at the expected ~41.7/41.6/41.7ms cadence for 23.976fps, with no gaps or discontinuities across the full sample. The source data and FFmpeg's own reconstruction of it are both clean.
The finding
In the same ffprobe output, raw pts_time (i.e., AVFrame.pts as the VC-1 decoder set it, before any FFmpeg-side reconstruction) is N/A on every I-frame and every P-frame in the sample — only B-frames carry a valid raw PTS. This split is total and consistent across the entire 37.5s capture (GOP pattern I B P B P; 3 of every 5 frames have no raw PTS). best_effort_timestamp, which FFmpeg computes specifically to paper over exactly this kind of gap using DTS/reorder-depth reconstruction, is complete and correct for the same frames.
This means: whatever timestamp AetherEngine's software decoder hands to the renderer for 60% of frames in this file depends entirely on which field it reads. If it reads raw pts (matching SoftwareVideoDecoder.swift's apparent per-frame handling in drainDecodedFrames, SoftwareVideoDecoder.swift:235-269) rather than best_effort_timestamp, most frames arrive with no usable timestamp and whatever fallback is used — extrapolation, last-known-PTS reuse, arrival-time estimation — is a strong candidate for the judder's actual source.
This is also why the symptom is AetherEngine-specific despite shared FFmpeg internals: mpv and other FFmpeg-based players never consume raw frame->pts for exactly this reason, always using best_effort_timestamp instead. And it's why the software-decode presentation path is unusually sensitive to any timestamp error in the first place — AVSampleBufferDisplayLayer presents each sample strictly at the CMTime it's given, with no vsync-aware cadence model or interpolation to absorb an inaccurate value the way mpv's own pacing loop would.
(Why VC-1's decoder produces this split — B-frames tagged, I/P frames losing their association during internal reference-picture buffering — is a plausible mechanism based on the observed pattern, not something confirmable without libavcodec source access. It doesn't change the recommended fix.)
Recommended fix
- In
SoftwareVideoDecoder.swift's frame emission path, switch from reading the decoded frame's rawptsto itsbest_effort_timestamp(bridged viaav_frame_get_best_effort_timestamp()if not already exposed as a Swift-accessible property). This is confirmed complete and correctly-paced for the reproducing file and should need no additional reconstruction logic. - Audit whatever fallback currently runs when
pts == AV_NOPTS_VALUE— that code path is exercised on the majority of frames in files like this one and is the immediate suspect for the visible judder. - Once switched, set an explicit
durationon eachCMSampleTimingInfo(not justpresentationTimeStamp), soCMSampleBufferMake/AVSampleBufferDisplayLayerhas the intended per-frame duration rather than inferring it from enqueue timing.
Supporting data
ffprobe -show_framesoutput against the reproducing file (pts_time,pkt_dts_time,best_effort_timestamp_time,pict_type,repeat_pict), ~900-frame / 37.5s sample — available on request, confirms the 100%-consistent I/Ppts_time=N/Apattern and fully cleanbest_effort_timestamp_timesequence.- Stream metadata:
vc1 (Advanced) (WVC1 / 0x31435657), yuv420p(progressive), 1920x1080, 23.98 fps, 23.98 tbr, 1k tbn, Matroska container,TimecodeScaledefault (ms granularity).
Activity
superuser404notfound commentedon Aug 24, 2026
Thanks for the depth here. The ffprobe capture is real and I reproduced the exact split on my own fixtures, but it does not describe what the engine sees, and I would rather say that now than have you spend another session on the timestamp path.
Fixtures I measured on, both public, both
V_MS/VFW/FOURCCVC-1 Advanced in Matroska like yours:fate-suite.ffmpeg.org/vc1/SA10143.vc1remuxed with-c copy, andsamples.ffmpeg.org/V-codecs/WVC1/Test_1440x576_WVC1_6Mbps.wmv(progressive,I B P B P, the same GOP shape as your file).The split is at the container, not at the decoder
Your output shows raw
pts_time=N/Aon I and P pictures. That pattern is already there one layer lower, at the packet level, before any decoder touches it:The reason is in
libavformat/matroskadec.c:4103of n8.1.2, the FFmpeg AetherEngine links:ms_compatis set forV_MS/VFW/FOURCCtracks (matroskadec.c:2897), which is exactly how WVC1 is stored, and it is why ffprobe prints a fourcc for your stream at all (vc1 (Advanced) (WVC1 / 0x31435657)). The Matroska block time becomes DTS,pkt->ptsis never written, and libavformat's generic reorder then recovers a PTS for the non-reference pictures and not for the rest. So the mechanism is not the VC-1 decoder losing the association during reference-picture buffering; it is a container rule that applies to every VFW-tagged Matroska track regardless of codec.The engine never sees it
Demuxer.applyDemuxerOptionsopens every source withfflags=+genpts, and filling exactly these gaps is that flag's entire job. Bothavformat_open_inputsites inDemuxer.swiftgo through it (lines 392 and 489).Same file, same ffprobe, one flag apart:
And through the engine's own demuxer, under the playback open profile:
NOPTS_pts=0. No packet reaches the decoder untimed, so no frame reaches the renderer untimed, and the fallback you identified is never entered on this path.What that failure would actually look like
This is the part worth having, because it rules the hypothesis out by shape rather than by argument. I suppressed
+genptsin a local build to force exactly the state your analysis describes, and played the same VC-1 file:An untimed frame is not presented at a slightly wrong moment, it is refused. The render synchronizer cannot pace a sample whose PTS reads back as NaN, and a NaN also breaks the reorder buffer's ordering (every comparison against NaN is false), so the gate drops it outright rather than let it reorder its neighbours. The result is no picture at all and a 58 s file drained in 2.5 seconds, because nothing is left to pace the demux loop. Your report is judder on a picture that is there, which is a different failure.
Sanity check that macOS is not papering over it: a normal run of the same file reads
enq=+25per second on a 25 fps source withdelay=0.00, and measures identically to an MPEG-2 control on the same software path.Shipped anyway, but not as the fix
Your point 1 is right as hardening even though it is not the cause here, so I took it. Branch
fix/ae407-best-effort-ptsreadsbest_effort_timestampwhen the decoder set no PTS, placed directly afteravcodec_receive_frameso captions, the deinterlace graph and the emit path all see one repaired timestamp rather than each reading the raw field separately. With+genptssuppressed, the session above now runs at 25 enq/s with an advancing clock instead of dying; with+genptson it never fires. The value is that the drop becomes a genuine last resort instead of the only behaviour, which matters for live MPEG-TS, where untimed pictures do arrive on their own.I did not take point 3 (an explicit
CMSampleTimingInfo.duration). Not refusing it, but I have no measurement that it changes anything, and I would rather not ship a second unmeasured change into an open judder report.The lead I would chase instead
libavcodec grants the VC-1 decoder no decode parallelism at all. Same machine, same 8-core request, one codec apart:
Confirmed independently with ffmpeg's own benchmark on the VC-1 file:
utime=3.352s / rtime=3.336s, one core saturated, and-threads 0produces the same numbers. The vc1 decoder supports neither frame threading nor, on a single-slice stream, slice threading.Your source is 1920x1080 at 19.7 Mb/s, which is 2.5x the pixels of my sample at 3.3x the bitrate, decoding on one Apple TV core, with a CPU YUV to NV12 conversion per frame on top, next to FLAC 7.1 24-bit also decoded in software on the same box. If that does not sustain 23.976 fps, the picture judders while every other indicator looks healthy, and it judders in the reproducible periodic way you describe.
What would settle it
Sodalite, Settings > Diagnostic Log. It is not gated on a diagnostic build, so it is there in your 1.0.0 (20). Play until it judders, then send these three lines:
[SWDecoder] Opened: 1920x1080, codec=vc1, threads=N, ...and N is the parallelism your stream actually got.[SWDiag] clk=... enq=+N layerDrop=...(+N) delay=...(+...) status=..., one per second, ideally a run of ten or so taken while it is juddering. This is the line that decides it.enqbelow 24 means the decoder is not keeping up and the cause is upstream of presentation;enqat 24 withlayerDropclimbing ordelaygrowing means the frames exist and the problem is where they are put on screen.[DisplayCriteria] mode check (software): content=... requested=... panel=...Hz ..., which says whether Match Frame Rate landed on 23.976. A panel sitting at 60.000 under 23.976 content is 3:2 pulldown, periodic judder on its own, and nothing downstream can hide it.And two A/B questions that split the space faster than any log:
Separately, a Sodalite change is queued so the in-player overlay carries this vocabulary too:
[SWDiag],[SWDecoder],[SWHost]and[Renderer]were all filtered out of its focused view, which is why a software-path report had nothing screenshottable there. Settings > Diagnostic Log is unfiltered and works today.One note on the analysis you attached, offered as a pointer rather than a complaint: it reads
SoftwareVideoDecoder.swiftaccurately, but every claim about what the engine receives was derived from a default ffprobe open rather than from the engine's. That single substitution is what inverted the conclusion, and it is cheap to guard against next time, since the same reasoning also predicts a black screen where you are seeing judder.superuser404notfound commentedon Aug 24, 2026
Shipped in 6.38.0, and both consumers are pinned to it.
To be clear about what that does and does not cover: the frame-level
best_effort_timestamprepair is in, so an untimed picture is recovered instead of refused. Your judder is still open, because nothing measured so far says the timestamp path was ever the one it took.The three log lines and the two A/B questions above are what moves it next, and the
[SWDiag]enqueue rate is the one that decides between a decoder that cannot keep up and a presentation problem. Take them while it is juddering, from Settings > Diagnostic Log.superuser404notfound commentedon Aug 24, 2026
Correction to my own lead, before it costs you a measurement session.
I pointed at the single-threaded VC-1 decoder as the likely cause. I have now measured the throughput instead of reasoning about it, and it does not hold up.
Full engine software path (release build,
aetherctl swdecode, so decode plus the YUV to NV12 conversion plus the pixel-buffer allocation, all of it), on a 1280x720 VC-1 Advanced stream at 13.4 Mb/s:Decode-only cross-check with ffmpeg on the same file: 5799 frames in 8.95 s, 648 fps, single core.
Your source needs 1920x1080 at 23.976, which is 49.7 Mpixel/s. That is about 8 percent of one core on this machine, roughly 12x headroom. This is an M1 rather than the A15 in the Apple TV, but those two cores are in the same class, so even halving the number leaves about 6x. Single-threaded or not, the decoder is not the thing that is late.
So both hypotheses on the table are now measured and dead: the timestamp path (never entered, the engine opens with
+genpts) and decode starvation (12x headroom). What is left is all on the presentation side, and none of it is testable off tvOS, which is why the log lines still matter.The three lines from my earlier comment are unchanged, but read them differently now:
[SWDiag] ... enq=+N ...should read at the content rate (24). If it does, that is the confirmation that the frames exist and arrive on time, and the answer is downstream of the decoder. If it reads below 24, that contradicts the measurement above and is by itself the most interesting result in this thread.enqat rate,layerDropanddelayare the discriminators: drops climbing means frames are being refused at the display queue,delaygrowing means they are being shown late.[DisplayCriteria] mode check (software): content=... panel=...Hzis now the first thing I would look at. A panel at 60.000 under 23.976 content is 3:2 pulldown, which is periodic judder on its own and nothing in the engine can hide it.And the A/B that splits this fastest is still the one worth doing first, because it needs no logs at all: play a 23.976 MPEG-2 or VP9 file. Both take the identical software path with the identical presentation code. If that judders too, this is not about VC-1 at all, and the search narrows to what the software path does with 23.976 content. If only VC-1 judders, I am wrong about where to look and the decoder is back in scope despite the numbers above.
fix(decoder): repair a decoded frame's timestamp from best_effort_tim…
classicjazz commentedon Aug 27, 2026
Captured all three lines from Settings > Diagnostic Log on the Apple TV 4K while a high-bitrate VC-1 title was visibly juddering. tvOS only surfaces these on-screen, so this is OCR'd from screenshots, with a couple of gaps (the 1450s tick is missing), and playback was from a resume point ~1444s into a 3034s file, not from the start.
Claude's read it against your decision tree:
panel=23.976Hz, content and request both 23.976. Match Frame Rate landed, so 3:2 pulldown isn't it.enqholds at the content rate (23–25, avg 24; the +29 is the startup settle),parkedsits steady at ~86 decoded frames,rebuf=n,dclk=1.00every tick.On-device, the single-threaded decoder is keeping up — consistent with your headroom retraction.
enqat rate, butlayerDropis flat at 2 (all during the 5-frame startup settle, +0 every tick after) anddelaystays0.00(+0.00).corr=0.So every discriminator reads healthy while the picture is juddering. Since
enqis a per-second frame count rather than a measure of inter-frame spacing, this looks like a cadence problem the current counters can't see: ~24 frames/sec handed toAVSampleBufferDisplayLayerwith uneven presentation intervals or without an explicit per-framedurationwould present as periodic judder and still showenq=24 / layerDrop=0 / delay=0.Given that, would you reconsider point 3 (explicit
CMSampleTimingInfo.duration), or at least add inter-frame presentation-interval variance to[SWDiag]so cadence is actually observable?Two other things in the capture I can't interpret, in case they're signals:
parkedpinned at ~86 frames (~3.6s at 23.976) withaLead≈4.0s— is that the intended lead? If the video queue is that deep and drained against an audio master clock, an uneven drain would also leave all these counters looking clean.cueEnd≈4296420sagainst acueStartof ~1452s —cueEnd − cueStartis 4294967.3s,i.e. exactly 2^32 ms. Claude says this looks like an unsigned-32-bit millisecond overflow in PGS end-timestamp parsing, so forced cues never clear. Probably its own bug, but if an always-active overlay forces per-frame recompositing it's steady work on the presentation path.
To your other requests:
Merge branch 'diag/ae407-cadence'
superuser404notfound commentedon Aug 28, 2026
That capture is the one that moves this, thank you. It settles three things, and it exposes a fourth: the line I asked you to read cannot answer the question I asked it.
What the capture settles
panel=23.976Hzunder 23.976 content, measured by a display link rather than reported by the mode. No pulldown.enqat the content rate,rebuf=n,dclk=1.00on every tick. Consistent with the throughput retraction.layerDropflat after the startup settle,delay=0.00(+0.00),corr=0.Two readings I have to correct, one of them mine
parkedcounts undecoded PACKETS, not frames. It is the demux FIFO ahead of the video decoder, cap 256, and 86 of them is about 3.6 s of unread-ahead work, not a 3.6 s queue of decoded pictures. It says nothing about how deep the pipeline is in time, which is what your reading of it was reaching for. It isparkedPktsnow, and the depth you wanted has its own field.enqis not a delivery count. It is bumped in the decoder callback, which sits on the far side of the reorder buffer, the unschedulable-timestamp gate and the sample-buffer build. Anything lost in that stretch is invisible in it, and invisible inlayerDroptoo, because that counter is the layer's verdict on frames it received. On top of that it is a count per wall second, so an even 23.976 timeline, one carrying a doubled interval, one carrying a duplicate timestamp and one missing a frame all read+24.So your conclusion is right, and it is broader than you put it: nothing on that line could have shown a cadence fault, and one field could not even have shown a missing frame.
6.51.0
Four fields, all on the software line, all in 6.51.0:
disp=+Nframes the renderer actually handed to the display layer. A gap betweenenqanddispis a frame the decoder produced and the layer never saw.lost=N(+n)names that class directly, cumulative and per second.dpts=min/maxshortest and longest gap in milliseconds between the timestamps handed over during the interval. A hole, a duplicate or a reordering fault shows here and nowhere else.vLeadhow far ahead of the clock the newest admitted frame sat, at its lowest over the interval. This is the video cushion, next to the audio cushionaLeadalready carried. Taken as a minimum over the 4 Hz tick rather than sampled once, so a dip inside the second is not averaged away.Reference reading, 1080p23.976 VP9 with FLAC, macOS:
dpts=41.0/42.0is what an even 23.976 timeline on a millisecond timebase looks like: the frame interval is 41.7083 ms and the container can only carry whole milliseconds, so the gaps alternate. Anything else there is a finding. ThevLeadfigure comes from a headless layer, so treat it as indicative rather than a target; on your box it is the number that says whether the picture had cushion or was being handed over at its deadline.Your point 3 is in as well.
CMSampleTimingInfo.durationwas.invalidon every software-path frame. The reorder buffer is already holding the successor when a frame goes out, so the exact length costs nothing and adds no latency, and I would rather it be exact than absent. I still have no measurement saying it changes what you see, which is why I would not ship it alone in August; it ships now next to the instrumentation that can say so. The last frame of a stream keeps an invalid duration on purpose, since that is the frame that stays on screen at the end.The PGS end timestamps
Not an overflow, and the arithmetic that produced 2^32 ms is the giveaway. A PGS composition carries no end of its own: the presentation set says "show this", and a later set says "clear". FFmpeg's decoder therefore stamps every composition with
end_display_time = UINT32_MAX, and the engine closes it when the successor arrives (pgsTrimAt, plus a 3600 s threshold that tells an authored duration from the placeholder). The cue you saw logged open-ended does clear on screen.The line was still misleading, so it now prints
cueEnd=open-ended (closed by the successor)instead of a date 49.7 days out.It also costs nothing per frame. The compositor that would burn cues into decoded frames is gated on picture-in-picture and is a straight passthrough in fullscreen, so an always-active cue does not touch the video path.
But there is something in that observation worth having. With the subtitle picker on "Off", Sodalite still decodes a forced source silently. It is disc parity, it is automatic, and there is no switch for it, which is why you have PGS cue lines in a session you watched with subtitles off. Look for
[PlayerVM] forced-subtitle fallback:in the same log and it will name which mode it picked. That is an entire subtitle demux and decode path running in your session that mpv with subtitles off does not have, and it is one of the few structural differences between the two players on your file.What I would do next
One experiment, and it is the one you already offered:
Transcode two minutes of the same title to MPEG-2, keep the audio, drop the subtitles.
MPEG-2 direct-plays and takes the identical software path with the identical presentation code, the audio track is bit-identical so the master clock is unchanged, and
-snremoves the forced-subtitle path from the comparison. Three suspects fall out at once:-c:s copyto put the PGS track back.Please capture the new line while it is juddering, whichever way it goes.
dpts,dispagainstenq, andlostsay whether anything upstream of the display layer is uneven; if all three read clean while the picture does not, the remaining ground is the layer itself, and that is worth knowing precisely.The stereo-track question is still open but I would rank it below this one now. The 8-channel FLAC drives the master clock, and your capture shows that clock advancing at 1.00 per tick with a 4 s cushion, so it is not obviously the one that is late.
diag(swplayback): the 1 Hz line describes cadence, not only a frame c…
diag(subtitles): name the open-ended PGS placeholder instead of print…
classicjazz commentedon Sep 1, 2026
I have additional insights after a lot of additional testing. Please see below:
#407 — root cause identified: the software path starts decoding mid-GOP after every reposition
Summary. VC-1 Advanced in Matroska plays smoothly from a cold start and juddes permanently after
any seek, fast-forward, or stop-and-resume. The cause is not timestamps, not throughput, not the
panel, and not the renderer. It is that on a
V_MS/VFW/FOURCC(ms_compat) Matroska track everyblock is flagged as a sync sample, so neither libavformat's index, nor the packet flag, nor the
engine can identify a real VC-1 entry point — and the software playback path begins decoding at
whatever packet
avformat_seek_filereturns, without ever checking it.The discriminating test: seek to position 0 → clean. 22 of 22 seeks to arbitrary positions →
judder. The reposition is byte-for-byte identical in both cases. The only variable is the landing
packet.
Everything measured before this point in the thread was measured inside the failure state, from a
resume point ~1444 s into the file, with no from-start baseline. That is why every counter read
healthy while the picture juddered.
1. What was tested
Devices and hosts
dd99bf4)Two independent hosts, four platforms, at least two VC-1 titles, one 64 GB desktop and three
appliances. The failure is byte-identical everywhere.
Instrumented captures
A. Sodalite / Apple TV — from-start control vs post-seek, same title.
24
[SWDiag]ticks from a cold start (smooth), a programmatic seek to 399.57 s, then 23 tickspost-seek (juddering).
Across all 47 ticks the two states are numerically indistinguishable:
dclkaLeadvLeadparkedPktsenq/dispdptslost/layerDrop/delay/corrAlso: no
[SWDecoder] repaired … from best_effort_timestampline in either state, and no[Renderer] dropped … no usable timestampline. The only anomaly is on the seek tick itself:dpts=41.0/84.0, one missing frame position, once.B. AetherPlayer / Mac Studio — 24 seeks in one session.
Two targeted position 0. Twenty-two targeted arbitrary positions.
layerDrop (+0)throughout.[vc1] warning: first frame is no keyframefires within ~200 ms of every one of the 22midpoint seeks, and after neither seek to 0 (next occurrence 37 s and 15 s later, unrelated).
C. Container control (new). Converting the source to MPEG with the standard script and playing
the result: no judder — neither from a cold start nor after stop/start or fast-forward. The fault
does not survive leaving the
ms_compatMatroska carriage.2. What this rules out
Each of these was a live hypothesis in this thread. Each is now closed, with the evidence that closed
it.
vLeadnever dips in either statepanel=23.976Hzclosure was itself a from-start measurement and was not valid evidence — but the platform matrix closes it properly)AVSampleBufferDisplayLayerbehaviour+genpts,best_effort_timestamp)dpts=41.0/42.0post-seek, identical to control; thebest_effort_timestamprepair never fires; and seek-to-0 restarts+genptsexactly as any other seek does, yet plays cleanguess_correct_ptsstate carried acrossavcodec_flush_buffersAVCodecContextand never flushes, yet reproducesvLeadis deeper post-seek,dclk=1.00,aLeadpinned at the 4.0 s policy ceilingenq=+24, not+48; no untimestamped-field log linesubActive=falseparkedPkts87–90,rebuf=n,lost=0,layerDrop=0,delay=0.00in both statesWhy every counter reads clean.
enqcounts decoder callbacks,dispcounts layer handoffs,lostcounts refusals, andlayerDrop/delay/corrare the layer's verdict relative to thetimestamps the samples carry. A decoder started mid-GOP emits frames at full rate carrying the
container's own correct timestamps. Every instrument agrees, and the pictures are wrong.
dptscannot see it either: the reorder buffer sorts by PTS before
dptsis computed, so a picture ↔timestamp mispairing survives the sort invisibly.
Also worth correcting for the record:
corris not a drift correction count. It isvideoPerformanceMetrics.numberOfCorruptedFrames. There is no drift correction anywhere on thispath, armed or otherwise, so
corr=0carries no information about pacing. (r4dislayer.isReadyForDisplay.)3. Root cause
The software VOD playback path has no post-reposition entry-point gate, and on this container it
has nothing it could gate on.
AV_PKT_FLAG_KEYat all. Every use of the flag in the engine isbehind
if isLive, on the VideoToolbox path, or in the HLS producer.skipUntilPTS): it discards frames below the target. Ithas no opinion on whether the decoder was given a valid entry point to start from.
min_ts = Int64.min, flag word0,anchor
-1— so nothing asks the demuxer to land early enough to guarantee an entry point beforethe target.
aetherctl pktdumpon a VC-1 Matroska fixture previously reportedvideo packets=300 keyframes=300on a stream containing B-frames. 0 clean landings out of 22 is consistent withthe seek index carrying an entry for every block, so the seek resolves to the nearest frame and
the nearest frame is almost never an I-frame. Position 0 is the sole exception, because it is the
stream's first packet.
Two other paths in the same codebase already handle this.
HLSSegmentProducerscans forward to areal keyframe after a reposition and names the hazard in its own comment — "matroska seek can land
100+ ms early and SimpleBlock keyframe bit can be off".
FrameDecodeContextdocuments the mid-GOPlanding outright — "
AVDISCARD_NONKEYbreaks streams whose seek lands mid-GOP past a sparsekeyframe". The software playback path is the odd one out.
4. What is still open
Why it is permanent. Broken reference pictures should heal at the next real I-frame.
Something does not heal here. The most likely explanation is a phase error in the decoder's
output-reorder pipeline, initialised against a picture that is not an anchor, which would present
correct timestamps paired with pictures one step out of order indefinitely. This is libavcodec
internals; FFmpeg is a prebuilt binary dependency, so it cannot be settled from the engine tree.
It does not block the fix — the remedy is to stop handing the decoder a non-entry-point.
The real I-frame spacing on affected sources. This is the pre-roll distance any fix has to
cover, and it is the one number needed before writing the fix.
Whether the MPEG control was a remux or a re-encode (see §1C).
Confirmation on the current engine. AetherPlayer 0.16.1 predates the
dpts/vLead/disp/lostinstrumentation, so the Mac captures carry no cadence data.Separate defects surfaced along the way — each deserves its own issue, none is this bug
layerDroprun on the Mac: 5–12 frames/second for ~54 s during playback that wasvisually fine, never recurring across 20 subsequent seeks. Most plausibly
FrameDecodeContextthumbnail-decoder contention.
dpts=41.0/84.0on the seek tick withlost=+0.aLeadacross a seek on the older engine (aLead=475.49on the first post-seek tick).corris a misnomer in the[SWDiag]line and has misled this thread.surf=932x430on tvOS — a fullscreen player drawing 1920×1080 into a 932×430-point layer.threads=1(libavcodec clamps it; the decoder advertises no frame/slice threading),which means the ~660 fps headroom figure in this thread was a single-core measurement.
5. Recommended next step
Do this first — one command, sizes the fix
Read the
Kcolumn across the sample lines. Two things come out of it: confirmation that the flag isuniversally set (so no consumer can distinguish an entry point), and — the number actually needed —
how far apart the real I-frames are. Run it at a midpoint too. This is now practical on the Mac
Studio;
aetherctlis a macOS target built withswift buildin the AetherEngine checkout.Then: the fix direction
The cheapest correct remedy reuses machinery that already exists.
skipUntilPTSalready discardsevery frame below the target, so repositioning to
target − preRollwhile leaving the skipthreshold at
targetcosts only decode time and guarantees the decoder passes a real entry pointbefore it reaches any frame the viewer will see. Nothing downstream changes.
preRollcomes from themeasurement above; it should be applied on both repositioning paths — the transport seek and
load(startPosition:)— since both reproduce the bug.One thing to state explicitly before anyone starts
A scan-forward-to-keyframe gate cannot work here. It is the obvious fix, the engine already has
one on the HLS producer path, and it gates on
AV_PKT_FLAG_KEY— which on this container is alwaystrue. Backing off the seek target is the only approach that does not depend on information the
container refuses to provide.
Worth adding while in here
Nothing in the current instrumentation can see this class of fault, which is why it survived so long.
Two cheap additions would have caught it: a log line when the first packet after a reposition is not
a sync sample (even if the flag is unreliable, the decoder's verdict is available), and surfacing
the existing silent
frameDurationrejection — the code already detects impossible successor gapsand voids the duration without counting or logging it.
superuser404notfound commentedon Sep 1, 2026
That platform matrix is what made this solvable, thank you. Four platforms, two independent hosts and a container control narrowed it to something structural in the software path, and the from-start baseline you added is what exposed that the earlier
panel=23.976Hzclosure had been measured inside the failure state. Also correct and worth keeping:corrisnumberOfCorruptedFramesand carries no pacing information, and the reorder-buffer sort really does hide a picture / timestamp mispairing.The cause turned out to be one step earlier than the entry-point gate, and it is now fixed in 6.59.0. Both consumers are already pinned to it.
The container carries no presentation timestamps at all
A Matroska track written as
V_MS/VFW/FOURCChas no PTS.matroskadecputs the block timecode onpkt->dtsand leavespkt->ptsunset:That is the carriage of every VC-1 remux, because VC-1 has no native Matroska mapping.
The engine opens every source with
fflags=+genpts, so libavformat fills the gap. Its reconstruction takes a following packet's DTS as this packet's PTS, which assumes decode order and presentation order are the same sequence. With B pictures they are not, and out comes a uniformpts = dts + one frameladder.libavcodec hands its pictures out in presentation order, but each carries the timestamp of the packet it came from. So the B picture wears the following P picture's time, and
SampleBufferRenderersorts its reorder buffer by PTS and puts the pictures back into decode order. Forward, back, forward, back, for the whole title.That is why every counter you captured read healthy. Nothing is dropped, nothing is late, nothing is corrupt, and
dptsstays 41.0/42.0 because the timestamps genuinely are evenly spaced. Your own §2 explains it exactly, just about a different mispairing than the one we were both looking for.Measured, on the WVC1 sample from samples.ffmpeg.org remuxed with a plain
ffmpeg -c copy0.040 0.120 0.080 0.200 0.1600.040 0.080 0.120 0.160 0.200Picture types across that run are
I B P B P. Every B/P pair was transposed.Your MPEG container control stands as evidence for this: that container carries real PTS, so
+genptsnever fires.Where the entry-point diagnosis does not hold
Two of your observations are real and I reproduced both. The conclusion drawn from them is what does not survive.
The keyframe flag really is destroyed, 1451 of 1451 packets flagged on that sample. But it happens in the parser path, not the container:
matroskadec.cforcesneed_parsingon every non-HEVC video track anddemux.cthen rewrites the packet flags. That runs afterav_add_index_entry, which uses the real block bit. The file on disk is correctly marked in two independent places, 10 SimpleBlock keyframe bits and 10 Cues, matching the 10 decoded I pictures exactly.So the seek index is intact and the landing is a real I picture.
aetherctl pktdump --at 20on that file lands atdts=15000, which is Cue #3.avformat_seek_filewithmin_ts = INT64_MINalso derivesAVSEEK_FLAG_BACKWARDby itself, so the backoff you proposed adding is already there. No pre-roll was added, because on this file it would have changed nothing.The thread's own loose end pointed here: a mid-GOP start produces macroblock damage that heals at the next I picture, and you flagged that "why it is permanent" was unexplained. A structural transposition is permanent by construction.
The instrument that was missing
You were right that nothing could see this class of fault, so
aetherctl swdecodenow prints the decoded ladder in output order with a backwards-step count and its own verdict. One command, no device round trip:What would help
These measurements show the transposition from the first frame, not only after a reposition, so your start-versus-seek asymmetry is not yet explained. If a title still looks clean cold and juddes only after a seek on 6.59.0,
aetherctl swdecodeon that file, plus:A sawtooth in the first column against alternating picture types in the second is this defect; a clean ascending ladder means something else is left.
The separate items in your §4 are real and each will get its own issue rather than riding along here: the sustained
layerDroprun on the Mac, the one-frame gap at the seek boundary, the staleaLead, thecorrmisnomer, andsurf=932x430on tvOS.fix(demux): a VFW-carried track keeps the decoder's picture order, no…
superuser404notfound commentedon Sep 3, 2026
The §4 side findings are in #479, all six in one place rather than one issue each: measured against 6.67.0 first, and most of them did not need a tracker of their own. Short version: the one-frame gap at the seek boundary was real and reproduces on 6.57.1 and 6.58.0 (
dpts=0.0/40.0on a forward seek,40.0/80.0on a backward one, same fixture) and reads40.0/40.0from 6.59.0 on, so the main fix here covered it;corriscorrupt=on main (3f8ec8fd); the staleaLeaddid not show in ten seeks across five engine versions including the 6.34.0 that AetherPlayer 0.16.1 pins;surf=932x430is an iPhone Pro Max / Plus screen in points, not tvOS (the Apple TV capture above reads 1920x1080); andthreads=1is libavcodec's own clamp, the VC-1 decoder advertises no threading. The start-versus-seek asymmetry on 6.59.0 or later is still the open question in this thread.superuser404notfound commentedon Sep 3, 2026
Correction to the line above about the stale
aLead: it does reproduce, on a seek that lands PAUSED rather than a playing one, and the mechanism and measurement are in #479. Fixed in f38230c and released in 6.67.1 (c7d3a6b) together with thecorrupt=rename, so a 6.67.1 log carries a trustworthyaLeadon every tick after a scrub. Nothing about this touches the frame pacing this thread is about; the start-versus-seek asymmetry on 6.59.0 or later remains the open question here.classicjazz commentedon Sep 5, 2026
Update from AetherPlayer testing (build 0.17.0 (65), AetherEngine commit
f4bebc0fd3c66f656ef18d2c7c0b3243df3ac86d/ tag6.34.1— same commit cited in the original report):I ran diagnostics across a range of VC-1 (Advanced) files on the software decode path — progressive 23.976fps content, plus several interlaced 29.97i files that exercise the hardware deinterlace path — and could not reproduce the judder described here on any of them.
In every session,
SWDecoderlogs an explicit repair pass:firing continuously throughout playback (every ~250 frames), which is consistent with recommended fix #1 (reading
best_effort_timestampinstead of rawAVFrame.pts) already being in effect on this commit. Steady-state diagnostics (dpts, the inter-frame timestamp delta) hold at the expected 41.0/42.0ms cadence for 23.976fps content with no drift, andlayerDrop/corrupt/rebufstay flat outside of expected seek-boundary costs.Since AetherPlayer and Sodalite are pinned to the same engine commit per this issue's own environment section, this suggests the fix (or an equivalent safeguard) is present in Sodalite. I will verify on Sodalite when a build with this commit is posted to TestFlight. The host apps could still differ in ways outside the shared engine (e.g.
AVSampleBufferDisplayLayerconfiguration, tvOS vs macOS presentation timing).Separately — while testing across this file set I found a few other issues unrelated to this one (decoder failures and a timing bug on interlaced content, and elevated frame drops on the deinterlace path). Filing those separately so they don't get conflated with this report.
superuser404notfound commentedon Sep 5, 2026
Thanks for running the whole file set through this. The result is the counter-measurement this thread was waiting for, but the version line needs correcting first, because it changes what the result means.
AetherPlayer 0.17.0 does not run 6.34.1. That release is the one where the engine uptake landed:
c073677mergedfeat/engine-uptakewith the subject "the lip-sync offset, the audio-delivery fact and the DV composition switch (engine 6.34.1 to 6.68.0)". The pin in the 0.17.0 tag is16aac556c2049173fd99f9847d1294a4297563aa, which is 6.68.0. 0.17.1 is on4b529f23= 6.68.1. The environment section of this issue records the pin as it stood on the day it was filed, and AetherPlayer sat on 6.34.1 for fifty-two engine releases after that, which is exactly why it reads as unchanged.The log confirms it independently.
[SWDecoder] repaired N frame timestamp(s) from best_effort_timestampfirst shipped in 6.38.0 (8e8234b6), four releases after 6.34.1, so that line cannot appear in a 6.34.1 session at all. And on 6.34.1 it would not have fired even if it had existed:fflags=+genptswas set on every open, every frame therefore arrived carrying an invented PTS, andbest_effort_timestamphad nothing left to repair. The note in that commit said as much at the time.That repair firing continuously, every ~250 frames, is the 6.59.0 fix at work.
VFWDecodeOrderPTSRepairsets the invented PTS back toNOPTSon a Matroska track with a codec tag and a non-zerovideo_delay, which is the carrier form of every VC-1 remux, andbest_effort_timestampthen places the picture. So the steady 41.0/42.0dptswith no drift is the fixed path measured, not the reported one.Which makes this a clean negative on the fix, across progressive 23.976 and interlaced 29.97i, on both engines of the deinterlace path. Same for the Sodalite half: it is pinned to
4b529f23(6.68.1) today, so a TestFlight build carries the same repair. Worth a look when one is up, but nothing about the routing differs between the two hosts here.The one piece still open is from the original report rather than from this run: the start-versus-seek asymmetry. On my reproduction the pictures were mispaired from frame 1, not only after a reposition, so the shape reported originally was never fully explained by the cause that got fixed. If a 6.68.x session on the same title still shows a difference between a cold start and a post-seek stretch, that is the thing worth a sample. Otherwise this can be treated as answered.
The three new issues are useful and separate, and one of them has a fix on main already. Replies on each.
classicjazz commentedon Sep 5, 2026
With the new Sodalite 1.0.0 (27) test flight build, I also confirmed that none of the test files exhibit playback judder. So, I think we are good to close this issue and resolve remaining issues separately.
Thank you for all your hard work on this difficult issue.
superuser404notfound commentedon Sep 6, 2026
Closing it, and thank you for taking this one all the way through. It took a long route, and the file set you supplied is what made the cause findable at all.
For the record on the last run: build 27 puts the fix on the second host, so both hosts are now measured clean on the same titles, progressive 23.976 and interlaced 29.97i.
The start-versus-seek asymmetry goes with the issue rather than into a new one. It was never reproduced separately on my end, and my reproduction was mispaired from frame 1 rather than only after a reposition, so there is nothing left to chase until a session actually shows the difference again. If a 6.68.x build ever does, a fresh issue with the title and a timestamp is the fastest way back in.
The rest already lives in its own threads: #490 (cause is upstream in the VC-1 parser), #491 (round 2 shipped in 6.68.3), #492 (answered with the field rate A/B, the output frame rate accounts for it) and #494, which came out of that same measurement run and shipped in 6.68.4. A build cut from today carries both of the shipped ones.
#407: extend the generated-PTS repair to AVI
Merge fix/avi-decode-order-pts: the generated-PTS repair reaches AVI (#…
fix(renderer): the late-frame guard records a frame when it leaves th…
fix(demux): bound every demuxed timestamp once, at the Demuxer (audit…
perf(renderer): hold one frame for presentation-order decoders and gu…