Skip to content

Conversation

@stronk-dev
Copy link
Contributor

@stronk-dev stronk-dev commented Oct 15, 2025

This PR:

  • Tracks first seen PTS, accumulated duration and last seen PTS for the decode & encode
  • Tracks accumulated duration for the decode & encode
  • Aborts if we run out of 'frame budget' (if we have a known constant framerate) as well as if the output duration grows too far compared to the input duration.
  • Instead of doing a avfilter_graph_create_filter (which is incompatible with FFMPEG 8), use the more universal avfilter_graph_alloc_filter + avfilter_init_str

Note that:

  • We probably don't need to track both start/end timestamp AND the accumulated duration. Since we already fallback on LibAV's best_effort_timestamp (or the frame duration if even that is null). I've left both in for now and just take the biggest one for the guard.
  • Slack for frame count or duration is fairly arbitrary at the moment.
  • We should take extra care for inputs that have timestamps gaps in them... We don't want to trigger the guards for any segment that IE has a 100ms jump.

This PR definitely needs more testing and code review, but is put up here for brave guinea pigs in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant