[FFmpeg-devel] [PATCH]Add -skip_initial_bytes option (-sb)

Nicolas George nicolas.george at normalesup.org
Fri Nov 16 17:33:08 CET 2012


Le sextidi 26 brumaire, an CCXXI, Carl Eugen Hoyos a écrit :
> I absolutely wanted to call the option "-sb" but it seems that this is already 
> used for "subtitle bitrate"...

It seems too short and obscure a name for an option that is rarely useful
anyway.

> +    SpecifierOpt *skip_initial_bytes;
> +    int        nb_skip_initial_bytes;
>  } OptionsContext;
>  
>  typedef struct InputFilter {
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index 0baa3b1..98fe923 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -775,6 +775,10 @@ static int opt_input_file(void *optctx, const char *opt, const char *filename)
>      ic->flags |= AVFMT_FLAG_NONBLOCK;
>      ic->interrupt_callback = int_cb;
>  
> +    if (o->nb_skip_initial_bytes)
> +        av_dict_set(&format_opts, "skip_initial_bytes",
> +                    o->skip_initial_bytes[o->nb_skip_initial_bytes - 1].u.str, 0);
> +
>      /* open the input file with generic avformat function */
>      err = avformat_open_input(&ic, filename, file_iformat, &format_opts);
>      if (err < 0) {
> @@ -2369,6 +2373,8 @@ const OptionDef options[] = {
>          "extract an attachment into a file", "filename" },
>      { "debug_ts",       OPT_BOOL | OPT_EXPERT,                       { &debug_ts },
>          "print timestamp debugging info" },
> +    { "skip_initial_bytes", HAS_ARG | OPT_STRING | OPT_EXPERT | OPT_SPEC, { .off = OFFSET(skip_initial_bytes)},
> +        "skip initial bytes", "bytes" },

Why is it needed? Adding to lavf/options_table.h should be enough, unless I
am completely mistaken.

Regards,

-- 
  Nicolas George
-------------- 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/20121116/a83fb51c/attachment.asc>


More information about the ffmpeg-devel mailing list