[FFmpeg-soc] vsrc_ppm

Bobby Bingham uhmmmm at gmail.com
Thu Dec 20 17:40:29 CET 2007


On Thu, 20 Dec 2007 15:17:29 +0100
Vitor <vitor1001 at gmail.com> wrote:

> Hi
> 
> Vitor wrote:
> > Vitor wrote:
> >> Víctor Paesa wrote:
> >>> On Dec 4, 2007 4:24 AM, jgh lrhg <nguyenbamanh31 at yahoo.com> wrote:
> >>>>  Hi all!
> >>>>  I was built successed ffmpeg with vsrc_ppm but i don't know how
> >>>> to add logo to video using vsrc_ppm.
> >>>>  Anyone tell me agrs to add logo or watermark to video using
> >>>> vsrc_ppm. Thanks!
> >>> It should be a command alike to this one:
> >>>
> >>> ffmpeg -i input.avi -vfilters graph_file=ppm.desc output.avi
> >>>
> > 
> > [...]
> > 
> >>> But it did not work as expected, as the output.avi has only two
> >>> frames:
> >> [...]
> >>
> >>> Bobby, Vitor, could you please shed some ligth on this result?
> >> The problem is with my ffmpeg patch. ffplay works fine. I'll look
> >> into it soon...
> > 
> > Just an update on this: the problem don't seems to be in the FFmpeg 
> > patch but something to do with miscalculating the timestamp of the 
> > filtered frame (FFplay is just less sensible to the problem)...
> > 
> 
> Looks like the problem was in the overlay filter. Bobby, can you give
> a look at this patch?
> 
> -Vitor
>
>
> diff -u libavfilter2/vf_overlay.c libavfilter/vf_overlay.c
> --- libavfilter2/vf_overlay.c	2007-11-06 20:52:43.000000000
>+0100
> +++ libavfilter/vf_overlay.c	2007-12-20 13:59:45.000000000
> +0100
> @@ -141,7 +141,7 @@
>      if(!over->pics[1][0]) return 1;
> 
>      if(over->pics[0][0]->pts == over->pics[1][0]->pts) return 2;
> -    return !!(over->pics[0][0]->pts < over->pics[1][0]->pts);
> +    return (over->pics[0][0]->pts > over->pics[1][0]->pts);
>  }

Aren't these lines equivalent?

>  
>  static void copy_image(AVFilterPicRef *dst, int x, int y,
> diff -u libavfilter2/vsrc_ppm.c libavfilter/vsrc_ppm.c
> --- libavfilter2/vsrc_ppm.c	2007-12-20 15:09:44.000000000 +0100
> +++ libavfilter/vsrc_ppm.c	2007-12-20 15:11:27.000000000 +0100
> @@ -85,7 +85,7 @@
>  
>          fclose(ppm->in);
>          ppm->in = NULL;
> -    } else ppm->pic->pts += 30;
> +    } else ppm->pic->pts += 40000;

Ideally this would be made configurable, but since vsrc_ppm was just a
quick hack made for testing, it doesn't really matter.

>  
>      out = avfilter_ref_pic(ppm->pic, ~AV_PERM_WRITE);
>      avfilter_start_frame(link, out);


-- 
Bobby Bingham
Never trust atoms.  Or anything made of atoms.
このメールは再利用されたバイトでできている。



More information about the FFmpeg-soc mailing list