[FFmpeg-devel] [PATCH]lavf/matroskaenc: Do not write 0 duration for subtitles

Jerome Martinez jerome at mediaarea.net
Fri Nov 24 14:30:42 EET 2017

On 23/11/2017 20:02, John Stebbins wrote:
> [...] It's not practical to
> know the duration of the previous subtitle before writing it because you can't know it till you have seen this empty
> PGS.  Once you've seen the empty PGS, it is often too late to properly interleave the previous PGS in the output file.

I argued that on CELLAR mailing list (this is especially true in the 
case of live streaming) but did not find consensus about the need to 
have a different semantic for "clear" compared to "display empty 
subtitle", so for "clear" you have to use "display empty subtitle" thing 
as a workaround. It may change in the future.

> Your suggestion (0 means up to next frame) however works I believe.  I.e. display the "empty" PGS up to the next frame.

Right. I actually don't change the code in the patch, just the reason.

More information about the ffmpeg-devel mailing list