Commit Graph

99 Commits

Author SHA1 Message Date
Limin Wang 254652a34c avfilter/vf_showinfo: minor adjustment for the dump format of ROI
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-08 10:11:59 +08:00
Andreas Rheinhardt 8be701d9f7 avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilter
Up until now, an AVFilter's lists of input and output AVFilterPads
were terminated by a sentinel and the only way to get the length
of these lists was by using avfilter_pad_count(). This has two
drawbacks: first, sizeof(AVFilterPad) is not negligible
(i.e. 64B on 64bit systems); second, getting the size involves
a function call instead of just reading the data.

This commit therefore changes this. The sentinels are removed and new
private fields nb_inputs and nb_outputs are added to AVFilter that
contain the number of elements of the respective AVFilterPad array.

Given that AVFilter.(in|out)puts are the only arrays of zero-terminated
AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads
are not zero-terminated and they already have a size field) the argument
to avfilter_pad_count() is always one of these lists, so it just has to
find the filter the list belongs to and read said number. This is slower
than before, but a replacement function that just reads the internal numbers
that users are expected to switch to will be added soon; and furthermore,
avfilter_pad_count() is probably never called in hot loops anyway.

This saves about 49KiB from the binary; notice that these sentinels are
not in .bss despite being zeroed: they are in .data.rel.ro due to the
non-sentinels.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-20 12:53:58 +02:00
James Almer 1cd43d8a5e avfilter/vf_showinfo: add support for H.274 Film Grain Characteristics frame side data
Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-06 09:56:44 -03:00
Andreas Rheinhardt a04ad248a0 avfilter: Constify all AVFilters
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
Andreas Rheinhardt ef6a9e5e31 avutil/buffer: Switch AVBuffer API to size_t
Announced in 14040a1d91.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Guo, Yejun e942b4bbaa lavfi: show side data of detection bounding boxes 2021-04-17 17:27:02 +08:00
James Almer 13f35782b9 avfilter/vf_showinfo: include the correct Dynamic HDR10+ header
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-06 12:08:58 -03:00
Mohammad Izadi 6f2d6e3efd avfilter/vf_showinfo: add support for HDR10+ metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-05 19:20:11 -03:00
Limin Wang 0ea2bda099 avfilter/vf_showinfo: add const to the AVFrameSideData instance
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-09-17 18:52:11 +08:00
Marton Balint 172af0ee51 avfilter/vf_showinfo: use av_timecode_make_smpte_tc_string2
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-13 17:51:57 +02:00
Limin Wang f9277cd796 avfilter/vf_showinfo: add dump_s12m_timecode() helper function
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-07-08 23:14:04 +08:00
Limin Wang 3ede8acba6 avfilter/vf_showinfo: check sd->size before reference the sd->data
Or it'll cause null pointer dereference if size < sizeof(uint32_t), also
in case tc[0] > 3, the code will report error directly.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-07-08 23:12:48 +08:00
Limin Wang 12c42c709e avfilter/vf_showinfo: add a \n for end of ERROR and WARNNING log
Note for info level, one extra \n will be print after the log.

Reviewed-by:   Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 09:00:28 +08:00
Limin Wang 567d571b20 avfilter/vf_showinfo: display H.26[45] user data unregistered sei message
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-15 07:19:55 +08:00
Anton Khirnov b84a2b91fd vf_showinfo: support AV_FRAME_DATA_VIDEO_ENC_PARAMS 2020-05-12 09:37:47 +02:00
Limin Wang 585ac1ff5b avfilter/vf_showinfo: limit the max number of timecode
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-28 19:21:11 +01:00
Limin Wang aa822007a4 avfilter/vf_showinfo: check if the s12m data size is valid
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-27 01:42:16 +01:00
Limin Wang 9519c8dbb7 avfilter/vf_showinfo: fix the integer handling issues
Fixes CID 1457606 and 1457607

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-10 17:52:14 +01:00
Limin Wang d31a1266a7 avfilter/vf_showinfo: Fix erroneous results for mean and stdev with pixel bits >8
Have tested with be and le pixel format on be and le system for >8bit.
System:
lmwang@ubuntu:~/ffmpeg.git.mips$ grep HAVE_BIGENDIAN config.h
ffmpeg.git git:(showinfo) ✗ grep HAVE_BIGENDIAN config.h

Test result:
1, yuv420p
./ffmpeg -f lavfi  -i color=black:duration=1:r=1:size=1280x720,format=yuv420p,showinfo
Master:
mean:[16 128 128] stdev:[0.0 0.0 0.0]
After applied the patch:
 mean:[16 128 128] stdev:[0.0 0.0 0.0]

2, yuv420p10le
./ffmpeg -f lavfi  -i color=black:duration=1:r=1:size=1280x720,format=yuv420p10le,showinfo
Master:
mean:[32 1 1] stdev:[32.0 1.0 1.0]
After applied the patch:
mean:[64 512 512] stdev:[0.0 0.0 0.0]

3, yuv420p10be
./ffmpeg -f lavfi  -i color=black:duration=1:r=1:size=1280x720,format=yuv420p10be,showinfo
Master:
mean:[32 1 1] stdev:[32.0 1.0 1.0]
After applied the patch:
mean:[64 512 512] stdev:[0.0 0.0 0.0]

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-07 02:49:44 +01:00
Limin Wang ede15bf2e3 avfilter/vf_showinfo: display GOP timecode side data
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-06 22:06:12 +02:00
Limin Wang 6866c54ee4 avfilter/showinfo: support Content Light Level information
show real information instead of the unknown side data type message for HDR10 stream

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-17 14:47:13 -03:00
Jun Zhao e282b7ed7b lavf/showinfo: use error level when get invalid sidedata
Use error level when get invalid sidedata, and remove a unnecessary
newline in error message.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-08-08 17:57:25 +08:00
Jun Zhao 6f6769f3ec lavf/showinfo: support mastering display sidedata
support mastering display sidedata.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-08-08 17:57:12 +08:00
Jun Zhao 7eec3d22fc lavfi/showinfo: support regions of interest sidedata
support regions of interest sidedata

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-07-21 10:05:27 +08:00
Kieran Kunhya 2ff7af563a vf_showinfo: Fix timecode display 2019-03-09 18:42:34 +00:00
Paul B Mahol 8be56ee211 avfilter/vf_showinfo: allow checksums calculation to be disabled
Fixes #6987.
2018-12-09 18:46:36 +01:00
Martin Vignali 66974311b1 avfilter/show_info : add print of color information (range, color_primaries, color_trc, colorspace) 2018-10-24 21:21:05 +02:00
Josh de Kock 0ac82eed6f lavfi/vf_showinfo: support displaying S12M timecode sidedata 2018-10-23 15:46:30 +01:00
Carl Eugen Hoyos 9b79c65ec0 lavu/lavc/lavf/lavfi: Do not use type modifier %zu on Windows MSVCRT. 2017-12-17 18:05:42 +01:00
James Almer 0acb18d298 Merge commit '883ce264d9ffc5bdaf477e09ee155b03339c46a6'
* commit '883ce264d9ffc5bdaf477e09ee155b03339c46a6':
  vf_showinfo: Display spherical properties

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:51:34 -03:00
James Almer 69bb3f7bff Merge commit '3f128fc4a3fa1ef8a87974eb5484a997a84868fe'
* commit '3f128fc4a3fa1ef8a87974eb5484a997a84868fe':
  vf_showinfo: Simplify reporting stereo3d information

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:49:22 -03:00
Muhammad Faiz 6af050d7d0 avfilter: do not use AVFrame accessor
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-04-23 14:40:30 +07:00
Vittorio Giovara 883ce264d9 vf_showinfo: Display spherical properties 2017-03-23 10:09:18 +01:00
Vittorio Giovara 3f128fc4a3 vf_showinfo: Simplify reporting stereo3d information 2017-03-23 10:09:18 +01:00
Nicolas George 183ce55b0d lavfi: split frame_count between input and output.
AVFilterLink.frame_count is supposed to count the number of frames
that were passed on the link, but with min_samples, that number is
not always the same for the source and destination filters.
With the addition of a FIFO on the link, the difference will become
more significant.

Split the variable in two: frame_count_in counts the number of
frames that entered the link, frame_count_out counts the number
of frames that were sent to the destination filter.
2016-11-13 10:41:16 +01:00
Derek Buitenhuis 21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Hendrik Leppkes 51a3e52593 Merge commit '1339009c4924a20e872aa62897097bf5d071157c'
* commit '1339009c4924a20e872aa62897097bf5d071157c':
  vf_showinfo: show timebase & framerate too

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-11 15:01:15 +01:00
Michael Niedermayer 1339009c49 vf_showinfo: show timebase & framerate too
(cherry picked from ffmpeg commit fdb9399681)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-11-09 08:15:23 +01:00
Peter Cordes 44d3477264 vf_showinfo: minimum widths for some early fields
Depending on FPS, the pts_time string often changes length:
... pts_time:36.1 ...
... pts_time:36.1333 ...
etc.

 The length changes make the output bounce around horribly, making it
hard to scan down a column farther right than pts_time.

The solution is to set minimum widths for n, pts, pts_time, and pos.
This patch doesn't touch any of the fields in mean / stddev.

 The widths aren't intended to be wide enough that they're never
exceeded, but you'll see only an occasional ripple to a new alignment,
rather than bouncing.  (Some fields, like pos, increase monotonically,
which is why I left the minimum width for the field be smaller than it
often gets to.)

Signed-off-by: Peter Cordes <peter@cordes.ca>
2015-03-04 21:43:42 +01:00
Michael Niedermayer fdb9399681 avfilter/vf_showinfo: show timebase & framerate too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-21 21:21:00 +01:00
Michael Niedermayer 3a4c22f806 Merge commit '6d96c7ea89600655b1f18a3b12f3f041fa714152'
* commit '6d96c7ea89600655b1f18a3b12f3f041fa714152':
  vf_showinfo: Forward the av_image_get_linesize error

Conflicts:
	libavfilter/vf_showinfo.c

See: 2aecfd4f20
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18 21:50:34 +02:00
Vittorio Giovara 6d96c7ea89 vf_showinfo: Forward the av_image_get_linesize error
CC: libav-stable@libav.org
Bug-Id: CID 1087086
2014-10-18 16:15:10 +01:00
Michael Niedermayer 71d008ebe4 Merge commit '1ef9e8376466bb1e2c147e47554b94cab9c8b04a'
* commit '1ef9e8376466bb1e2c147e47554b94cab9c8b04a':
  avcodec: Deprecate dtg_active_format field in favor of avframe side-data

Conflicts:
	doc/APIchanges
	libavcodec/avcodec.h
	libavcodec/mpeg12dec.c
	libavcodec/version.h
	libavfilter/vf_showinfo.c
	libavutil/frame.h
	libavutil/version.h

See: 2a3c36e920
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 06:11:34 +02:00
Kieran Kunhya 2a3c36e920 Deprecate AFD field and add AFD as side-data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 05:36:44 +02:00
Kieran Kunhya 1ef9e83764 avcodec: Deprecate dtg_active_format field in favor of avframe side-data
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-03 15:43:02 -07:00
Michael Niedermayer 593dc5aed9 Merge commit '5a69ded12aaf2bd3baed5d1d644ef23cfecef87f'
* commit '5a69ded12aaf2bd3baed5d1d644ef23cfecef87f':
  vf_showinfo: print display transformation values

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-16 12:09:20 +02:00
Vittorio Giovara 5a69ded12a vf_showinfo: print display transformation values 2014-06-14 00:19:14 -04:00
Michael Niedermayer 09725c1d2b avfilter/vf_showinfo: also calculate and show mean and standard deviation
Fixes Ticket3013

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-03 06:02:42 +02:00
Vittorio Giovara 58400ac133 lavfi: name anonymous structs 2014-04-19 16:20:57 +02:00
Michael Niedermayer 15fe694e5c Merge commit 'b4679ecdbd80ae050094733f137ccd7ebf1316ab'
* commit 'b4679ecdbd80ae050094733f137ccd7ebf1316ab':
  {v,a}f_showinfo: print frame side data

Conflicts:
	libavfilter/af_ashowinfo.c
	libavfilter/vf_showinfo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-24 15:32:48 +01:00