[FFmpeg-devel] [PATCH] vf_mp: remove blackframe filter wrapper

Stefano Sabatini stefano.sabatini-lala at poste.it
Thu Jul 21 13:43:38 CEST 2011


On date Sunday 2011-07-17 23:54:56 +0200, Stefano Sabatini encoded:
> On date Sunday 2011-07-17 20:30:09 +0200, Michael Niedermayer encoded:
> > On Sun, Jul 17, 2011 at 05:10:34PM +0200, Stefano Sabatini wrote:
> > > blackframe is integrated as a native filter, also the wrapper doesn't
> > > seem to work fine.
> > > ---
> > >  doc/filters.texi                        |    1 -
> > >  libavfilter/Makefile                    |    1 -
> > >  libavfilter/libmpcodecs/vf_blackframe.c |  148 -------------------------------
> > >  libavfilter/vf_mp.c                     |    2 -
> > >  4 files changed, 0 insertions(+), 152 deletions(-)
> > >  delete mode 100644 libavfilter/libmpcodecs/vf_blackframe.c
> > 
> > LGTM if our filter was tested against the mplayer filter in
> > mencoder/mplayer
> 
> $ ffplay INPUT -vf mp=blackframe
> [...]
> [mp @ 0x9ab00c0] This is a unholy filter, it will be purified by the ffmpeg exorcist team
> which will change its syntax from dark -vf mp to light -vf.
> Thou shalst not make spells or scripts that depend on it
> 
> NO OUTPUT...
> 
> $ ffplay INPUT -vf blackframe
> [...]
> [blackframe @ 0xb3400b40] bamount:98 bthresh:32
> [blackframe @ 0xb3400b40] frame:0 pblack:100 pos:67 pts:0 t:0.000000 type:I last_keyframe:0
> [blackframe @ 0xb3400b40] frame:1 pblack:100 pos:6290 pts:1201 t:1.201000 type:P last_keyframe:0
> [blackframe @ 0xb3400b40] frame:2 pblack:100 pos:7007 pts:1235 t:1.235000 type:I last_keyframe:2
> [blackframe @ 0xb3400b40] frame:3 pblack:100 pos:9214 pts:1268 t:1.268000 type:I last_keyframe:3
> [blackframe @ 0xb3400b40] frame:4 pblack:100 pos:12187 pts:1335 t:1.335000 type:I last_keyframe:4
> [blackframe @ 0xb3400b40] frame:5 pblack:100 pos:14775 pts:1368 t:1.368000 type:P last_keyframe:4
> [blackframe @ 0xb3400b40] frame:6 pblack:100 pos:15161 pts:1401 t:1.401000 type:P last_keyframe:4
> [blackframe @ 0xb3400b40] frame:7 pblack:99 pos:15702 pts:1435 t:1.435000 type:I last_keyframe:7
> ...
> 
> $ mplayer INPUT -vf mp=blackframe
> [...]
> vf_blackframe: 0, 100%, I (I:0)
> vf_blackframe: 1, 100%, P (I:0)t:  0.000   0/  0 ??% ??% ??,?% 0 0 
> vf_blackframe: 2, 100%, I (I:2)t:  0.018   0/  0 15%  0%  0.7% 1 0 
> vf_blackframe: 3, 100%, I (I:3)t:  0.034   0/  0 15%  0%  0.7% 1 0 
> vf_blackframe: 4, 100%, P (I:3)t:  0.049   0/  0 15%  0%  0.7% 1 0 
> vf_blackframe: 5, 100%, I (I:5)t:  0.062   0/  0 14%  0%  0.7% 1 0 
> vf_blackframe: 6, 100%, P (I:5)t:  0.074   0/  0 14%  0%  0.7% 1 0 
> vf_blackframe: 7, 100%, P (I:5)t:  0.085   0/  0 14%  0%  0.7% 1 0 
> vf_blackframe: 8, 99%, I (I:8)ct:  0.095   0/  0 13%  0%  0.7% 1 0 
> A:   4.6 V:   4.6 A-V: -0.004 ct:  0.186   0/  0  4%  0%  0.9% 1 0 
> ...
> 
> lavfi blackframe output is consistent with that of showinfo:
> [showinfo @ 0xb2d00c00] n:0 pts:0 pts_time:0.000000 pos:67 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:928957811 plane_checksum:[900907278 732660267 732660267 0]
> [showinfo @ 0xb2d00c00] n:1 pts:1201 pts_time:1.201000 pos:6290 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:928957811 plane_checksum:[900907278 732660267 732660267 0]
> [showinfo @ 0xb2d00c00] n:2 pts:1235 pts_time:1.235000 pos:7007 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:2383302752 plane_checksum:[1592252780 4154258603 732660267 0]
> [showinfo @ 0xb2d00c00] n:3 pts:1268 pts_time:1.268000 pos:9214 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:2564156591 plane_checksum:[4108869898 3951822778 3879109611 0]
> [showinfo @ 0xb2d00c00] n:4 pts:1335 pts_time:1.335000 pos:12187 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:1175562317 plane_checksum:[825423641 2075608186 2346413227 0]
> [showinfo @ 0xb2d00c00] n:5 pts:1368 pts_time:1.368000 pos:14775 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:375761864 plane_checksum:[2174810437 980632878 3000003910 0]
> [showinfo @ 0xb2d00c00] n:6 pts:1401 pts_time:1.401000 pos:15161 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:3711640053 plane_checksum:[2441571687 1206339077 1027632762 0]
> [showinfo @ 0xb2d00c00] n:7 pts:1435 pts_time:1.435000 pos:15702 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:4248739321 plane_checksum:[1932719749 2442216058 2970707179 0]
> 
> Now there are some differences between mplayer/blackframe and
> lavfi/blackframe, but I don't feel like I want to debug MPlayer to
> understand what's the difference, and mp=blackframe is not working at
> all, so I see no point at keeping it.

Using -loglevel debug:

$ ffplay INPUT -vf showinfo,mp=blackframe
[showinfo @ 0xb2d006c0] n:0 pts:0 pts_time:0.000000 pos:67 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:928957811 plane_checksum:[900907278 732660267 732660267 0]
vf_blackframe: 0, 100%, unknown (I:0)
[showinfo @ 0xb2d006c0] n:1 pts:1201 pts_time:1.201000 pos:6290 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:928957811 plane_checksum:[900907278 732660267 732660267 0]
vf_blackframe: 1, 100%, unknown (I:0)
[showinfo @ 0xb2d006c0] n:2 pts:1235 pts_time:1.235000 pos:7007 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:2383302752 plane_checksum:[1592252780 4154258603 732660267 0]
vf_blackframe: 2, 100%, unknown (I:0)
[showinfo @ 0xb2d006c0] n:3 pts:1268 pts_time:1.268000 pos:9214 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:2564156591 plane_checksum:[4108869898 3951822778 3879109611 0]
vf_blackframe: 3, 100%, unknown (I:0)
[showinfo @ 0xb2d006c0] n:4 pts:1335 pts_time:1.335000 pos:12187 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:1175562317 plane_checksum:[825423641 2075608186 2346413227 0]
vf_blackframe: 4, 100%, unknown (I:0)
[showinfo @ 0xb2d006c0] n:5 pts:1368 pts_time:1.368000 pos:14775 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:375761864 plane_checksum:[2174810437 980632878 3000003910 0]
vf_blackframe: 5, 100%, unknown (I:0)
[showinfo @ 0xb2d006c0] n:6 pts:1401 pts_time:1.401000 pos:15161 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:3711640053 plane_checksum:[2441571687 1206339077 1027632762 0]
vf_blackframe: 6, 100%, unknown (I:0)
[showinfo @ 0xb2d006c0] n:7 pts:1435 pts_time:1.435000 pos:15702 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:4248739321 plane_checksum:[1932719749 2442216058 2970707179 0]
vf_blackframe: 7, 99%, unknown (I:0)

$ ffplay INPUT -vf showinfo,blackframe
[blackframe @ 0x8ee65a0] bamount:98 bthresh:32
[showinfo @ 0x8ee9510] n:0 pts:0 pts_time:0.000000 pos:67 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:928957811 plane_checksum:[900907278 732660267 732660267 0]
[blackframe @ 0x8ee65a0] frame:0 pblack:100 pos:67 pts:0 t:0.000000 type:I last_keyframe:0
[showinfo @ 0x8ee9510] n:1 pts:1201 pts_time:1.201000 pos:6290 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:928957811 plane_checksum:[900907278 732660267 732660267 0]
[blackframe @ 0x8ee65a0] frame:1 pblack:100 pos:6290 pts:1201 t:1.201000 type:P last_keyframe:0
[showinfo @ 0x8ee9510] n:2 pts:1235 pts_time:1.235000 pos:7007 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:2383302752 plane_checksum:[1592252780 4154258603 732660267 0]
[blackframe @ 0x8ee65a0] frame:2 pblack:100 pos:7007 pts:1235 t:1.235000 type:I last_keyframe:2
[showinfo @ 0x8ee9510] n:3 pts:1268 pts_time:1.268000 pos:9214 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:2564156591 plane_checksum:[4108869898 3951822778 3879109611 0]
[blackframe @ 0x8ee65a0] frame:3 pblack:100 pos:9214 pts:1268 t:1.268000 type:I last_keyframe:3
[showinfo @ 0x8ee9510] n:4 pts:1335 pts_time:1.335000 pos:12187 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:1175562317 plane_checksum:[825423641 2075608186 2346413227 0]
[blackframe @ 0x8ee65a0] frame:4 pblack:100 pos:12187 pts:1335 t:1.335000 type:I last_keyframe:4
[showinfo @ 0x8ee9510] n:5 pts:1368 pts_time:1.368000 pos:14775 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:375761864 plane_checksum:[2174810437 980632878 3000003910 0]
[blackframe @ 0x8ee65a0] frame:5 pblack:100 pos:14775 pts:1368 t:1.368000 type:P last_keyframe:4
[showinfo @ 0x8ee9510] n:6 pts:1401 pts_time:1.401000 pos:15161 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:0 type:P checksum:3711640053 plane_checksum:[2441571687 1206339077 1027632762 0]
[blackframe @ 0x8ee65a0] frame:6 pblack:100 pos:15161 pts:1401 t:1.401000 type:P last_keyframe:4
[showinfo @ 0x8ee9510] n:7 pts:1435 pts_time:1.435000 pos:15702 fmt:yuv420p sar:0/1 s:320x240 i:P iskey:1 type:I checksum:4248739321 plane_checksum:[1932719749 2442216058 2970707179 0]
[blackframe @ 0x8ee65a0] frame:7 pblack:99 pos:15702 pts:1435 t:1.435000 type:I last_keyframe:7

Since mp=blackframe and blackframe agree (and mp=blackframe is missing
information) I'm going to apply soon.
-- 
FFmpeg = Funny and Frenzy Maxi Pitiless Earthshaking Game


More information about the ffmpeg-devel mailing list