[FFmpeg-user] Question for using blackdetect video filter

Wu-bin Zhen vvubin at gmail.com
Fri Jan 25 20:04:18 CET 2013


My apologies. Actually my input source is a http stream, not a static file.
After few more tests I found that blackdetect works fine with a static file
but not with a http stream. I will appreciate any advise to detect
blackvideo without saving to a static video file. The info log and debug
log is shown as below:

1. INFO LOG
-------------------
ffmpeg version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 25 2013 11:40:44 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration:
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
Input #0, flv, from 'http://<local_streaming_server>/blackvideo.flv':
  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuvj420p, 1280x720 [SAR 1:1 DAR 16:9],
2000 kb/s, 30 tbr, 1k tbn, 30 tbc
    Stream #0:1: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf54.59.106
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuvj420p, 1280x720
[SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 30 tbc
    Stream #0:1: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
  Stream #0:1 -> #0:1 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
[null @ 0x3223a40] Encoder did not produce proper pts, making some up.
frame=  150 fps= 39 q=0.0 Lsize=N/A time=00:00:05.00 bitrate=N/A
video:14kB audio:431kB subtitle:0 global headers:0kB muxing overhead
-100.004831%


2. DEBUG LOG
-----------------------
ffmpeg version 1.1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 25 2013 11:40:44 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration:
  libavutil      52. 13.100 / 52. 13.100
  libavcodec     54. 86.100 / 54. 86.100
  libavformat    54. 59.106 / 54. 59.106
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 32.100 /  3. 32.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level)
with argument 'debug'.
Reading option '-i' ... matched as input file with argument 'http://
<local_streaming_server>/blackvideo.flv'.
Reading option '-vf' ... matched as option 'vf' (video filters) with
argument 'blackdetect=d=2'.
Reading option '-t' ... matched as option 't' (record or transcode
"duration" seconds of audio/video) with argument '5'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'null'.
Reading option '-' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file http://
<local_streaming_server>/blackvideo.flv.
Successfully parsed a group of options.
Opening an input file: http://<local_streaming_server>/blackvideo.flv.
[flv @ 0x216b7e0] Format flv probed with size=2048 and score=100
[flv @ 0x216b7e0] File position before avformat_find_stream_info() is 13
[flv @ 0x216b7e0] All info found
rfps: 29.666667 0.016443
    Last message repeated 1 times
rfps: 29.750000 0.009264
    Last message repeated 1 times
rfps: 29.833333 0.004141
    Last message repeated 1 times
rfps: 29.916667 0.001075
    Last message repeated 1 times
rfps: 30.000000 0.000065
rfps: 30.083333 0.001112
rfps: 30.166667 0.004215
rfps: 30.250000 0.009374
rfps: 30.333333 0.016590
    Last message repeated 1 times
rfps: 59.666667 0.016564
    Last message repeated 1 times
rfps: 59.750000 0.009403
    Last message repeated 1 times
rfps: 59.833333 0.004299
    Last message repeated 1 times
rfps: 59.916667 0.001251
    Last message repeated 1 times
rfps: 60.000000 0.000260
rfps: 29.970030 0.000191
    Last message repeated 1 times
rfps: 59.940060 0.000765
    Last message repeated 1 times
[flv @ 0x216b7e0] File position after avformat_find_stream_info() is 211695
Input #0, flv, from 'http://<local_streaming_server>/blackvideo.flv':
  Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
    Stream #0:0, 41, 1/1000: Video: h264 (Main), yuvj420p, 1280x720 [SAR
1:1 DAR 16:9], 1/30, 2000 kb/s, 30 tbr, 1k tbn, 30 tbc
    Stream #0:1, 40, 1/1000: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Successfully openened the file.
Parsing a group of options: output file -.
Applying option vf (video filters) with argument blackdetect=d=2.
Applying option t (record or transcode "duration" seconds of audio/video)
with argument 5.
Applying option f (force format) with argument null.
Successfully parsed a group of options.
Opening an output file: -.
Successfully openened the file.
[blackdetect @ 0x215e960] Setting entry with key 'd' to value '2'
[buffer @ 0x215ecc0] Setting entry with key 'video_size' to value '1280x720'
[buffer @ 0x215ecc0] Setting entry with key 'pix_fmt' to value '12'
[buffer @ 0x215ecc0] Setting entry with key 'time_base' to value '1/1000'
[buffer @ 0x215ecc0] Setting entry with key 'pixel_aspect' to value '1/1'
[buffer @ 0x215ecc0] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0x215ecc0] Setting entry with key 'frame_rate' to value '30/1'
[graph 0 input from stream 0:0 @ 0x215e760] w:1280 h:720 pixfmt:yuvj420p
tb:1/1000 fr:30/1 sar:1/1 sws_param:flags=2
[blackdetect @ 0x215e960] black_min_duration:2 pixel_black_th:0.100000
pixel_black_th_i:25 picture_black_ratio_th:0.980000
[abuffer @ 0x217fd40] Setting entry with key 'time_base' to value '1/44100'
[abuffer @ 0x217fd40] Setting entry with key 'sample_rate' to value '44100'
[abuffer @ 0x217fd40] Setting entry with key 'sample_fmt' to value 's16'
[abuffer @ 0x217fd40] Setting entry with key 'channel_layout' to value '0x4'
[graph 1 input from stream 0:1 @ 0x21804e0] tb:1/44100 samplefmt:s16
samplerate:44100 chlayout:0x4
[aformat @ 0x2180760] Setting entry with key 'sample_fmts' to value 's16'
[h264 @ 0x21745e0] detected 4 logical cores
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf54.59.106
    Stream #0:0, 0, 1/90000: Video: rawvideo (I420 / 0x30323449), yuvj420p,
1280x720 [SAR 1:1 DAR 16:9], 1/30, q=2-31, 200 kb/s, 90k tbn, 30 tbc
    Stream #0:1, 0, 1/90000: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> rawvideo)
  Stream #0:1 -> #0:1 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
[h264 @ 0x21817a0] Using externally provided dimensions
[Parsed_blackdetect_0 @ 0x215e840] frame:0 picture_black_ratio:1.000000
pos:385 pts:0 t:0 type:I
[null @ 0x2175a40] Encoder did not produce proper pts, making some up.
[Parsed_blackdetect_0 @ 0x215e840] frame:1 picture_black_ratio:1.000000
pos:10844 pts:33 t:0.033 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:2 picture_black_ratio:1.000000
pos:16955 pts:66 t:0.066 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:3 picture_black_ratio:1.000000
pos:17321 pts:100 t:0.1 type:P
--------cut here--------
frame:131 picture_black_ratio:1.000000 pos:771585 pts:4366 t:4.366 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:132 picture_black_ratio:1.000000
pos:778633 pts:4400 t:4.4 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:133 picture_black_ratio:1.000000
pos:779937 pts:4433 t:4.433 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:134 picture_black_ratio:1.000000
pos:787173 pts:4466 t:4.466 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:135 picture_black_ratio:1.000000
pos:788665 pts:4500 t:4.5 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:136 picture_black_ratio:1.000000
pos:796089 pts:4533 t:4.533 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:137 picture_black_ratio:1.000000
pos:797769 pts:4566 t:4.566 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:138 picture_black_ratio:1.000000
pos:805381 pts:4600 t:4.6 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:139 picture_black_ratio:1.000000
pos:807249 pts:4633 t:4.633 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:140 picture_black_ratio:1.000000
pos:815049 pts:4666 t:4.666 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:141 picture_black_ratio:1.000000
pos:817105 pts:4700 t:4.7 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:142 picture_black_ratio:1.000000
pos:825093 pts:4733 t:4.733 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:143 picture_black_ratio:1.000000
pos:827336 pts:4766 t:4.766 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:144 picture_black_ratio:1.000000
pos:835511 pts:4800 t:4.8 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:145 picture_black_ratio:1.000000
pos:837942 pts:4833 t:4.833 type:P
frame:146 picture_black_ratio:1.000000 pos:846305 pts:4866 t:4.866 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:147 picture_black_ratio:1.000000
pos:848924 pts:4900 t:4.9 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:148 picture_black_ratio:1.000000
pos:857475 pts:4933 t:4.933 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:149 picture_black_ratio:1.000000
pos:860282 pts:4966 t:4.966 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:150 picture_black_ratio:1.000000
pos:869021 pts:5000 t:5 type:P
No more output streams to write to, finishing.
[Parsed_blackdetect_0 @ 0x215e840] frame:151 picture_black_ratio:1.000000
pos:872016 pts:5033 t:5.033 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:152 picture_black_ratio:1.000000
pos:880943 pts:5066 t:5.066 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:153 picture_black_ratio:1.000000
pos:884126 pts:5100 t:5.1 type:P
[Parsed_blackdetect_0 @ 0x215e840] frame:154 picture_black_ratio:1.000000
pos:893241 pts:5133 t:5.133 type:P
frame=  150 fps= 39 q=0.0 Lsize=N/A time=00:00:05.00 bitrate=N/A
video:14kB audio:431kB subtitle:0 global headers:0kB muxing overhead
-100.004831%
Statistics: 896596 bytes read, 0 seeks
---------

On Fri, Jan 25, 2013 at 1:14 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Wu-bin Zhen <vvubin <at> gmail.com> writes:
>
> > ./ffmpeg -v info -i ./blackvideo.flv -vf blackdetect=d=2 -t 10 -f null -
>
> Complete, uncut console output (at least the first 50
> and the last 50 lines) missing.
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list