[FFmpeg-soc] [RFC] vrsc_movie with looping

Vitor Sessak vitor1001 at gmail.com
Wed May 27 21:45:37 CEST 2009


zeger at customsoft.nl wrote:
> Hi,
> 
> Since I needed a looping overlay I patched vsrc_movie and added
> an extra timestamp option where the overlay movie should stop 
> and restart at the given start timestamp.


> 
> Index: vsrc_movie.c
> ===================================================================
> --- vsrc_movie.c    (revision 4305)
> +++ vsrc_movie.c    (working copy)
> @@ -30,6 +30,7 @@
>  typedef struct {
>      // Filter parameters
>      int64_t           seek_point; //< seekpoint in microseconds
> +    int64_t           loop; //< start loop in microseconds
>      char              format_name[16];
>      char              file_name[255];
>      // Needed to load movies
> @@ -38,7 +39,7 @@
>      AVCodecContext   *codec_ctx;
>      int               is_done;
>      AVFrame          *frame;
> -
> +    int loop_cnt, pck_cnt;
>      int w, h;
>      AVFilterPicRef *pic;
>  } MovieContext;
> @@ -131,9 +132,9 @@
>      MovieContext *mv = ctx->priv;
>  
>      if(args) {
> -        int num_fields = sscanf(args, "%"PRId64":%15[^:]:%255s",
> -                            &mv->seek_point, mv->format_name, mv->file_name);
> -        if (3 == num_fields)
> +        int num_fields = sscanf(args, "%"PRId64":%15[^:]:%255[^:]:%"PRId64,
> +                            &mv->seek_point, mv->format_name, mv->file_name, &mv->loop);
> +        if (num_fields > 2)

Hmmm... This is a bit ugly, but I have no better idea (Stefano, maybe 
you might want to comment?).

Also I'd it is missing an update to doc/vfilters.tex

-Vitor


More information about the FFmpeg-soc mailing list