[Libav-user] Pulling valid subtitle from lavfi

Peter Krefting peter at softwolves.pp.se
Tue Dec 19 09:36:32 EET 2023


Hi!

> The video and audio comes out just fine, but the subtitle packets all have a 
> length of 30 bytes, and the data appears to be garbage (well, could be raw 
> data I've not explored that).

Are you getting bitmap subtitles? If AVSubtitle::format == 0, you have 
bitmap subtitles.

The format is not immediately obvious, have a look at these posts for 
some help on how to use them:

https://stackoverflow.com/a/54143538
https://stackoverflow.com/a/60560764

The former has a code snippet that lets you convert an AVSubtitle into 
an AVFrame that can be input into an encoder to make an image or video 
stream for overlay.

-- 
\\// Peter - http://www.softwolves.pp.se/


More information about the Libav-user mailing list