blackframe and blackdetect

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

blackframe and blackdetect

LsBender
Hello,
I'm new with ffmpeg and your help is welcome
I would like to have a line command that allows me to detect black-frames in my avi files.
And, if it's possible, I would like to be inform (with timestamps?) when black-frames occurr in the video and their duration.

Thanks a lot
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

LsBender
I had a look at:
http://ffmpeg.org/ffmpeg.html#blackframe
That's why I tried something like that:
ffmpeg blackframe=98:32 test.avi


But I have this error:

lefebvre@lefebvre-laptop:~/Bureau$ ffmpeg blackframe=98:32 test.avi
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Dec 21 2011 18:37:21, gcc: 4.4.3
Unable to find a suitable output format for 'blackframe=98:32'


I didn't understand this line of the ffmpeg documentation :
"In order to display the output lines, you need to set the loglevel at least to the AV_LOG_INFO value"

Thanks for your time
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

Clément Bœsch
On Wed, Mar 14, 2012 at 02:11:50AM -0700, LsBender wrote:
> I had a look at:
> http://ffmpeg.org/ffmpeg.html#blackframe
> http://ffmpeg.org/ffmpeg.html#blackframe 
> That's why I tried something like that:
> /ffmpeg blackframe=98:32 test.avi/
>

You may try ffmpeg -i test.avi -vf blackframe=... -f null -

[...]

--
Clément B.

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

LsBender
This post was updated on .
Thanks for your help Clement,
I tried your command but i have this: "unrecognized option '-vf'":

lefebvre@lefebvre-laptop:~/Bureau$ ffmpeg -i test.avi -vf blackframe=98:32 -f null-
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Dec 21 2011 18:37:21, gcc: 4.4.3
Input #0, avi, from 'test.avi':
  Duration: 01:02:12.22, start: 0.000000, bitrate: 1012 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 704x576 [PAR 1:1 DAR 11:9], 12.50 tbr, 12.50 tbn, 12.50 tbc
    Stream #0.1: Audio: mp2, 32000 Hz, stereo, s16, 64 kb/s
ffmpeg: unrecognized option '-vf'


I already saw some post about blackframe and how to list them, but there are listing blackframe while ffmpeg is encoding. And in my case, I don't want to encode. I just want to collect blackframe informations about my video without encoding. Is it possible?!

Thanks,
Marc
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

Clément Bœsch
On Wed, Mar 14, 2012 at 03:07:31AM -0700, LsBender wrote:
> Thank for your help Clement,
> I tried your command but i have this: "unrecognized option '-vf'":

FFmpeg 0.5 was release years ago, you need a recent version for the video
filters, and even more recent for the blackframe filter.

Check http://ffmpeg.org/download.html and
https://launchpad.net/~jon-severinsson/+archive/ffmpeg

[...]

--
Clément B.

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

attachment0 (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

Lou Logan
In reply to this post by LsBender
On Wed, 14 Mar 2012 03:07:31 -0700 (PDT)
LsBender <[hidden email]> wrote:

> Thank for your help Clement,
> I tried your command but i have this: "unrecognized option '-vf'":
> /
> lefebvre@lefebvre-laptop:~/Bureau$ ffmpeg -i test.avi -vf blackframe=98:32
> -f null-
> FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.3, Copyright (c) 2000-2009
> Fabrice Bellard, et al.
>   configuration: --extra-version=4:0.5.1-1ubuntu1.3 --prefix=/usr
> --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib
> --enable-libgsm --enable-libschroedinger --enable-libspeex
> --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib
> --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl
> --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394
> --enable-shared --disable-static
>   libavutil     49.15. 0 / 49.15. 0
>   libavcodec    52.20. 1 / 52.20. 1
>   libavformat   52.31. 0 / 52.31. 0
>   libavdevice   52. 1. 0 / 52. 1. 0
>   libavfilter    0. 4. 0 /  0. 4. 0
>   libswscale     0. 7. 1 /  0. 7. 1
>   libpostproc   51. 2. 0 / 51. 2. 0
>   built on Dec 21 2011 18:37:21, gcc: 4.4.3
> Input #0, avi, from 'test.avi':
>   Duration: 01:02:12.22, start: 0.000000, bitrate: 1012 kb/s
>     Stream #0.0: Video: mpeg4, yuv420p, 704x576 [PAR 1:1 DAR 11:9], 12.50
> tbr, 12.50 tbn, 12.50 tbc
>     Stream #0.1: Audio: mp2, 32000 Hz, stereo, s16, 64 kb/s
> ffmpeg: unrecognized option '-vf'/
>
> I already saw some post about blackframe and how to list them, but there are
> listing blackframe while ffmpeg is encoding. And in my case, I don't want to
> encode. I just want to collect blackframe informations about my video
> without encoding. Is it possible?!
>
> Thanks,
> Marc

Your version of ffmpeg from the Ubuntu repository does not have
filtering capability. You can compile the most recent FFmpeg to gain
filtering, bug fixes, and other features. For step-by-step compiling
instructions see:

HOWTO: Install and use the latest FFmpeg and x264 on Ubuntu
http://ubuntuforums.org/showthread.php?t=786095

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

LsBender
Thanks Clement and Lou-2.
Effectively you were right, my version was out of date.
As you recommended me, I upgraded my ubuntu version from 10.04 to 11.10 and my ffmpeg version from 0.5 to 0.9.1

I now have the blackdetect filter and I think this one is better than the blackframe filter for what I want to do.

But I still have to understand how to use this filter, in order to have a list of when blackframes occurs in my avi files (if it's possible without encoding).
As soon as I manage to get it work, I tell you.  

Once again, thanks for your help.

Marc
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

Carl Eugen Hoyos
LsBender <mlefe74 <at> gmail.com> writes:

> As you recommended me, I upgraded my ubuntu version from 10.04
> to 11.10 and my ffmpeg version from 0.5 to 0.9.1

0.9.1 is quite outdated, if you are a user (not a distributor of
FFmpeg), please use current git head, it contains more features
and less bugs than any released version.

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: blackframe and blackdetect

LsBender
This post was updated on .
Now I can find blackframes on my videos by using this command:
ffmpeg -i test.avi -vf blackdetect=d=1:pic_th=0.70:pix_th=0.10 -an -f null -

Thanks for your help!!

Marc