History

avfilter/framesync: add a new option to set how to sync streams based on secondary input timestamps

Include two values for it, a default one that sets/keeps the current behavior, where the frame event generated by the primary input will have a timestamp equal or higher than frames in secondary input, plus a new one where the secondary input frame will be that with the absolute closest timestamp to that of the frame event one. Addresses ticket #9689, where the new optional behavior produces better frame syncronization.

James Almer committed 4 years ago

Commit 0c3e3fd1 parent d9315542 files · +42 −0Browse files

Showing the changes to libavfilter/framesync.h (1 of 2 files). Show all

Unified · Split

libavfilter/framesync.h+23−0
@@ -75,6 +75,27 @@ enum FFFrameSyncExtMode { · 74 unmodified lines
7575 EXT_INFINITY,
7676 };
7777
78+/**
79+ * Timestamp syncronization mode
80+ *
81+ * Describe how the frames of a stream are syncronized based on timestamp
82+ * distance.
83+ */
84+enum FFFrameTSSyncMode {
85+
86+ /**
87+ * Sync to frames from secondary input with the nearest, lower or equal
88+ * timestamp to the frame event one.
89+ */
90+ TS_DEFAULT,
91+
92+ /**
93+ * Sync to frames from secondary input with the absolute nearest timestamp
94+ * to the frame event one.
95+ */
96+ TS_NEAREST,
97+};
98+
7899 /**
79100 * Input stream structure
80101 */
@@ -138,6 +159,7 @@ typedef struct FFFrameSyncIn { · 57 unmodified lines
138159 */
139160 unsigned sync;
140161
162+ enum FFFrameTSSyncMode ts_mode;
141163 } FFFrameSyncIn;
142164
143165 /**
@@ -205,6 +227,7 @@ typedef struct FFFrameSync { · 61 unmodified lines
205227 int opt_repeatlast;
206228 int opt_shortest;
207229 int opt_eof_action;
230+ int opt_ts_sync_mode;
208231
209232 } FFFrameSync;
210233

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t