[FFmpeg-devel] [PATCH] ffmpeg: accept "chapters" as forced key frames.

Michael Niedermayer michaelni at gmx.at
Wed Jan 2 21:11:55 CET 2013


On Wed, Jan 02, 2013 at 07:18:47PM +0100, Nicolas George wrote:
> Allow to force a key frame at the beginning of each chapter.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  doc/ffmpeg.texi |    9 ++++++++-
>  ffmpeg.c        |   52 +++++++++++++++++++++++++++++++++++++++++++++-------
>  2 files changed, 53 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index d0fe327..576ed0c 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -548,9 +548,16 @@ Deprecated see -bsf
>  @item -force_key_frames[:@var{stream_specifier}] @var{time}[, at var{time}...] (@emph{output,per-stream})
>  Force key frames at the specified timestamps, more precisely at the first
>  frames after each specified time.
> +If one of the time is "@code{chapter}[@var{delta}]", it is expanded into the
> +time of the beginning of all chapters in the file, shifted by @var{delta}.
>  This option can be useful to ensure that a seek point is present at a
>  chapter mark or any other designated place in the output file.
> -The timestamps must be specified in ascending order.
> +
> +For example, to insert a key frame at 5 minutes plus 0.1 second before the
> +beginning of each chapter:
> + at example
> +-force_key_frames 0:05:00,chapters-0.1
> + at end example
>  
>  @item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
>  When doing stream copy, copy also non-key frames found at the
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 977218f..93150ab 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c

> @@ -1929,19 +1929,25 @@ static InputStream *get_input_stream(OutputStream *ost)
>      return NULL;
>  }
>  
> +static int compare_int64(const void *a, const void *b)
> +{
> +    int64_t d = *(int64_t *)a - *(int64_t *)b;

this can overflow, but probably doesnt matter in reality


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130102/d7f779a2/attachment.asc>


More information about the ffmpeg-devel mailing list