[FFmpeg-devel] [PATCH 2/2] ffmpeg: add an option to fix subtitles durations.

Clément Bœsch ubitux at gmail.com
Mon Aug 6 11:31:23 CEST 2012


On Mon, Aug 06, 2012 at 12:34:23AM +0200, Nicolas George wrote:
> With this option, transcoding DVB subtitles becomes possible.
> 

It would be nice to add a test for this... :)

> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  doc/ffmpeg.texi |   15 +++++++++++++++
>  ffmpeg.c        |   36 +++++++++++++++++++++++++++++++++++-
>  2 files changed, 50 insertions(+), 1 deletion(-)
> 
> 
> Rebased on top of current head.
> 
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index 1ee42d8..ae30164 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -620,6 +620,21 @@ Disable subtitle recording.
>  Deprecated, see -bsf
>  @end table
>  
> + at section Advanced Subtitle options:
> +
> + at table @option
> +
> + at item -fix_sub_duration
> +Fix subtitles durations. For each subtitle, wait for the next packet in the
> +same stream and adjust the duration of the first to avoid overlap. This is
> +necessary with some subtitles codecs, especially DVB subtitles, because the
> +duration in the original packet is only a rough estimate and the end is
> +actually marked by an empty subtitle frame. Failing to use this option when
> +necessary can result in exaggerated durations or muxing failures due to
> +non-monotonic timestamps.
> +
> + at end table
> +

Any reason it is not set by default?

>  @section Audio/Video grab options
>  
>  @table @option
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 21516a6..9ec95a0 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -249,6 +249,14 @@ typedef struct InputStream {
>      int      resample_channels;
>      uint64_t resample_channel_layout;
>  
> +    int fix_sub_duration;
> +    struct { /* previous decoded subtitle and related varialbes */

variables

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120806/94c817b5/attachment.asc>


More information about the ffmpeg-devel mailing list