Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve VFR support ( 55a5d80 )
Manually calculate the duration of each frame and set
the PTS to that before submitting to the filtergraph.
This allows us to better support variable frame rates,
and is also better aligned with how ffmpeg does it.
This may change the number of frames output by the FPS
filter by +/- 1 frame. These aren't issues in themselves
but breaks a lot of test cases which will need to be updated.
Update testcases for VFR ( 1986cd4 )
Notes
Previously we were depending on a calculated frame rate (r_frame_rate)
but this isn't set to a sensible value for VFR streams. Packet duration also
can't be relied on (see the new VFR test case where each duration is N/A),
so we need to do some manual bookkeeping to calculate the timestamp
difference between frames ourselves.
I haven't yet fully understood what happens with the FPS filter during the
transition between segments but the behavior seems okay and the
timestamps don't change too much, aside from the +/- 1 frame difference.
Most unit tests pass on my machine, except I did not test GPU or non-H264
codecs. I don't think things would be much different there, but someone with
a GPU should check. The tests in
ffmpeg/sign_test.go
all timed out for meand there is a segmenter test that seems flaky, but these are probably unrelated.