[FFmpeg-devel] [PATCH] avfilter: add EIA-608 line extractor

Tobias Rapp t.rapp at noa-archive.com
Wed Jan 18 09:50:40 EET 2017


On 17.01.2017 20:43, Paul B Mahol wrote:
> Signed-off-by: Dave Rice <dave at dericed.com>
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  doc/filters.texi            |  70 ++++++++++++
>  libavfilter/Makefile        |   1 +
>  libavfilter/allfilters.c    |   1 +
>  libavfilter/vf_readeia608.c | 268 ++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 340 insertions(+)
>  create mode 100644 libavfilter/vf_readeia608.c
>
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 94548b1..57170e3 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -11249,6 +11249,76 @@ less than @code{0}, the filter will try to use a good random seed on a
>  best effort basis.
>  @end table
>
> + at section readeia608
> +
> +Read closed captioning (EIA-608) information from the top lines of a video frame.
> +
> +This filter adds frame metadata for @code{lavfi.readeia608.cc.X} and
> + at code{lavfi.readeia608.line.X}, where @code{X} is the number of the identified line
> +with EIA-608 data (starting from 0). A description of each metadata value follows:
> +
> + at table @option
> + at item lavfi.readeia608.cc.X
> +The two bytes stored as EIA-608 data (printed in hexadecimal).
> +
> + at item lavfi.readeia608.line.X
> +The number of the line on which the EIA-608 data was identified and read.
> + at end table

 From what I see this is a pair of values that belong together.

lavfi.readeia608.X.cc
lavfi.readeia608.X.line

would indicate that better, IMHO.

> +
> +This filter accepts the following options:
> +
> + at table @option
> + at item start
> +Set the line to start scanning for EIA-608 data. Default is @code{0}.
> +
> + at item end
> +Set the line to end scanning for EIA-608 data. Default is @code{29}.

What about naming them "scan_min/scan_max" for alignment with "readvitc" 
filter?

> +
> + at item mac
> +Set minimal acceptable amplitude change for sync codes detection.
> +Default is @code{0.2}. Allowed range is @code{[0.001 - 1]}.
> +
> + at item spw
> +Set the ratio of width reserved for sync code detection.
> +Default is @code{0.27}. Allowed range is @code{[0.01 - 0.7]}.
> +
> + at item mhd
> +Set the max peaks height difference for sync code detection.
> +Default is @code{0.1}. Allowed range is @code{[0.0 - 0.5]}.
> +
> + at item mpd
> +Set max peaks period difference for sync code detection.
> +Default is @code{0.1}. Allowed range is @code{[0.0 - 0.5]}.
> +
> + at item msd
> +Set the first two max start code bits differences.
> +Default is @code{0.02}. Allowed range is @code{[0.0 - 0.5]}.
> +
> + at item bhd
> +Set the minimum ratio of bits height compared to 3rd start code bit.
> +Default is @code{0.75}. Allowed range is @code{[0.01 - 1]}.
> +
> + at item wth
> +Set the white color threshold. Default is @code{0.35}. Allowed range is @code{[0.1 - 1]}.
> +
> + at item bth
> +Set the black color threshold. Default is @code{0.15}. Allowed range is @code{[0.0 - 0.5]}.

"thr_w/thr_b"?

> +
> + at item chp
> +Enable checking the parity bit. In the event of a parity error, the filter will output
> + at code{0x00} for that character. Default is false.
> + at end table
> +
> + at subsection Examples
> +
> + at itemize
> + at item
> +Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
> + at example
> +ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pkt_pts_time:frame_tags=lavfi.readeia608.cc.0,lavfi.readeia608.cc.1 -of csv
> + at end example
> + at end itemize
> +
>  @section readvitc
>
>  Read vertical interval timecode (VITC) information from the top lines of a
>
> [...]

BTW: Do you have some example file available for testing?

Regards,
Tobias



More information about the ffmpeg-devel mailing list