[MPlayer-dev-eng] Smeared video with screenshot and unsharp filter
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Apr 9 22:16:34 CEST 2013
On 07.04.2013, at 17:18, Nicolas George <nicolas.george at normalesup.org> wrote:
> L'octidi 8 germinal, an CCXXI, Nicolas George a écrit :
>> I can confirm the same problem with "-vf screenshot,pp=hb:c/vb:c/lb" (or
>> other pp options), but it also happens with rectangle=10:10:10:10, mirror,
>> etc. The common culprit seems to be screenshot before a frame-modifying
>> filter.
>>
>> It can be reproduced using a test video from ffmpeg (the first artifact is
>> visible at the fourth image):
>>
>> ffmpeg -filter_complex '
>> color=c=black:d=20:r=2,
>> drawtext=text=@:x=32:y=-24+10*t:fontsize=240:fontcolor=yellow
>> ' -g 2 -y t.avi
>>
>> I have not yet had time to investigate further, but I know from a fact that
>> I do not understand the various image types MPlayer uses. If someone could
>> write a bit of documentation, that would be a great help.
>
> After a few more checks, I find that the following trivial change fixes the
> problem:
>
> diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
> index 4a7de22..2f6593a 100644
> --- a/libmpcodecs/vd_ffmpeg.c
> +++ b/libmpcodecs/vd_ffmpeg.c
> @@ -787,7 +787,7 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
> avctx->draw_horiz_band=NULL;
> if(ctx->vo_initialized && !(flags&3) && !dr1){
> mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE |
> - (ctx->do_slices?MP_IMGFLAG_DRAW_CALLBACK:0),
> + 0*(ctx->do_slices?MP_IMGFLAG_DRAW_CALLBACK:0),
> sh->disp_w, sh->disp_h);
> if(mpi && mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){
> // vd core likes slices!
>
> I have no idea what MP_IMGFLAG_DRAW_CALLBACK actually does, but it works.
It says "this is not a real frame, you already got all the data via some other means, now prepare for displaying it".
By removing it you end up copying the data once more.
> This also gives a temporary solution for the problem: -noslices, that I just
> temporarily added to my config file.
Most likely slices are broken once more in FFmpeg. Would help to know which commit broke it.
You can also change the default for -slices/-noslices so it at least works again by default for everyone else.
More information about the MPlayer-dev-eng
mailing list