Replies: 1 comment
-
I think this should be possible without the use of filters. We do already use a startOffset in each MediaSampleProvider to offset stream timestamps for AV sync. It is used in the two ConvertPosition methods, which convert stream timestamps to output timestamps and back. We could introduce an additional, configurable delay here and add it on top in the ConvertPosition methods. I do not believe that we need to create empty frames for this to work. It is pretty common to use a (positive or negative) delay when muxing streams. All popular muxer tools support this. Playback engines are built to handle such situations (they even handle worse issues such as gaps inside streams and stuff like that). So I do not expect any problems if we apply an offset to sample positions internally. It won't be any different to a file which has the same offset added during muxing. |
Beta Was this translation helpful? Give feedback.
-
It would appear we can change the timestamps of audio and video frames using the setpts, asetpts filters.
This should allow us to at least easily build audio synchronization in the library. For video it becomes tricky cause we will lose hardware support.
I am still not sure how this will work if we delay timestamps, we might need to pair it with something like 8.11 adelay to make sure we have empty frames to fill the gaps.
Beta Was this translation helpful? Give feedback.
All reactions