Commit Graph

69 Commits

Author SHA1 Message Date
Anton Khirnov bd0cbebf3e fftools: drop the fake "default" option from ffplay/ffprobe
It tries to process any unhandled options as AVOptions. Handle this
directly in cmdutils.c, without resorting to a confusing fake option
definition (which is currently visible to the users in -help output).
2022-03-22 18:49:43 +01:00
Anton Khirnov 1dd6363581 fftools/ffprobe: drop -show_format_entry
Deprecated since 2012.
2022-03-22 18:49:43 +01:00
Anton Khirnov a545cb2b9d fftools/cmdutils: split common option handlers into their own file 2022-03-22 18:49:43 +01:00
Martin Storsjö 288313a8b2 libavfilter: Split version.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:05:26 +02:00
Martin Storsjö 6cd2ac388d libswscale: Split version.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:05:26 +02:00
Martin Storsjö 4332d6c4d5 libswresample: Split version.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:05:26 +02:00
Martin Storsjö 0f8b0b9ce2 libpostproc: Split version.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:05:26 +02:00
Martin Storsjö 884c597659 libavdevice: Split version.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:05:26 +02:00
Martin Storsjö 4eb9232c6e libavformat: Split version.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:05:26 +02:00
Martin Storsjö f2da2e1458 libavcodec: Split version.h
This avoids including version.h in all source files, avoiding
unnecessary rebuilds when the version number is bumped. Only
version_major.h is included by the main header, which defines
availability of e.g. FF_API_* macros, and which is bumped much
less often.

This isn't done for libavutil/version.h, because that header needs
to be included essentially everywhere due to LIBAVUTIL_VERSION_INT
being used wherever an AVClass is constructed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:04:35 +02:00
James Almer a8b885f294 ffprobe: convert to new channel layout-API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:46 -03:00
Limin Wang 316e0ff752 fftool/ffprobe: support for CUVA HDR Vivid metadata
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-03-01 09:08:43 +08:00
Andreas Rheinhardt 047a4e580e fftools/ffprobe: Remove redundant checks
A decoder is only opened if there is a decoder for the codec,
so every AVCodecContext here has AVCodecContext.codec set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-23 11:50:48 +01:00
Andreas Rheinhardt 26cce232d7 fftools/ffprobe: Flush decoder after draining
This is a prerequisite to continue using the decoder at all
to decode the next interval (if any).
This fixes a regression introduced in commit
2a88ebd096 and reported in ticket #8657.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-23 11:50:48 +01:00
Gyan Doshi e1a14479a8 ffprobe: allow side-data selection by element
At present, side data printing forces display for all levels i.e.
stream, packets and frames. This can bloat output and also force
decode of all frames in selected streams.

Now, stream_side_data[=type], packet_side_data[=type] &
frame_side_data[=type] can be used with -show_entries to specify carrier
element.
2022-02-03 16:04:24 +05:30
Jan Ekström a3f4148319 ffprobe: Support AV_FRAME_DATA_DOVI_METADATA
Co-authored-by: Niklas Haas <git@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-04 11:59:41 +01:00
James Almer 131dbb9a7a ffprobe: add missing separator when printing side data in compact output
Should fix ticket #7153

Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-22 09:41:13 -03:00
softworkz 939711905a fftools/ffprobe: print size of attachment streams (extradata_size)
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-11-29 21:30:11 +01:00
Chad Fraleigh a185b526a9 fftools: Constify values from av_dict_get()
Treat values returned from av_dict_get() as const, since they are
internal to AVDictionary.

Signed-off-by: Chad Fraleigh <chadf@triularity.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-18 19:43:32 +01:00
Andreas Rheinhardt 1ea3650823 Replace all occurences of av_mallocz_array() by av_calloc()
They do the same.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:52 +02:00
Andreas Rheinhardt 6b08ed9f95 fftools/ffprobe: Don't access AVProgram.(start|end)_time
These are internal fields.

Reviewed-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 19:17:19 +02:00
James Almer 590a7e02f0 avcodec: add a Film Grain codec property flag
Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-24 10:00:06 -03:00
James Almer 44d5e12c8f ffprobe: remove references to frame->pkt_pts
The field was removed during the last major bump.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-07 10:16:07 -03:00
Derek Buitenhuis e6754d2ad2 ffprobe: Rename Audio Service Type 'type' field to 'service_type'
677a030b26 introduced more printable
side data types in ffprobe, however the Audio Service Type side data
'type' field that was introduced aliases an existing field of the same
name within the side data array, which can lead to JSON output like:

    "side_data_list": [
        {
            "side_data_type": "Audio Service Type",
            "type": 0
        },
        {
            "side_data_type": "Stereo 3D",
            "type": "side by side",
            "inverted": 1
        }
    ]

This, while technically valid JSON, is considered bad practice, since it
forces all downstream users to manually parse it and check all types;
it makes simple deserialization impossible. Worse, in som loosely
type languages, it can lead to silent bugs if exising code assumed
it was a different type.

As such, rename this second "type" field to "service_type".

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-08-06 15:48:31 +01:00
Linjie Fu 5b0e6b0d82 fftools: Don't set default swscale flags in ffmpeg/ffprobe/ffplay
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2021-08-05 22:23:49 +08:00
Andreas Rheinhardt 1be3d8a0cb avcodec/avcodec: Stop including channel_layout.h in avcodec.h
Also include channel_layout.h directly wherever used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 11:14:31 +02:00
James Almer 022e50c002 ffprobe: use quotation marks in the xml header output
xmllint (silently) replaces the ' with " when fixing and validating the output
of ffprobe in fate-ffprobe_xsd.

Reviewed-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-15 23:46:40 -03:00
Andreas Rheinhardt d29541c90a fftools/ffprobe: Remove redundant check before avcodec_free_context()
Besides being unnecessary it is also safer: If the error for an
unrecognized option were triggered (which seems to be impossible right
now), it might be that the stream whose codecpar is accessed is NULL.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-06-08 12:52:50 +02:00
Anton Khirnov 677a030b26 ffprobe: support printing more packet side data types
Specifically WebVTT subtitle data, CPB properties, audio service type
and mpegts stream id.
2021-05-09 10:59:21 +02:00
Anton Khirnov 544631cab1 ffprobe: only hash extradata when it is present
Passing zero-sized/NULL buffers to av_hash_update() is invalid and may
crash with certain hashes.
2021-05-09 10:59:21 +02:00
Gyan Doshi 7c451b609c ffprobe: add option to control optional fields display 2021-05-05 15:04:54 +05:30
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
Andreas Rheinhardt 56450a0ee4 avformat: Constify the API wrt AV(In|Out)putFormat
Also constify AVProbeData.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:08 -03:00
Tobias Rapp f10da58ec3 fftools/ffprobe: Remove check on show_frames and show_packets in XML writer
The "packets_and_frames" element has been added to ffprobe.xsd in
0c9f0da0f7 but apparently removing the
check in ffprobe.c has been forgotten.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2021-04-16 08:40:09 +02:00
James Almer 67ed3cddf1 ffprobe: only print exported private decoder options
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-14 20:05:16 -03:00
Andreas Rheinhardt 461d04d956 fftools/ffprobe: Add missing dispositions
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-03-31 11:51:58 +02:00
James Almer 4aa586944e fftools/ffprobe: use av_packet_alloc() to allocate packets
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-17 15:19:38 -03:00
Jan Ekström c8c6c9f5d9 ffprobe: switch to av_bprint_escape for XML escaping
Additionally update the result of the ffprobe XML writing test.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-03-05 19:45:00 +02:00
Andreas Rheinhardt 988deae6da fftools: Switch to const AVCodec * where possible
The obstacle to do so was in filter_codec_opts: It uses searches
the AVCodec for options via the AV_OPT_SEARCH_FAKE_OBJ method, which
requires using a void * that points to a pointer to a const AVClass.
When using const AVCodec *, one can not simply use a pointer that points
to the AVCodec's pointer to its AVClass, as said pointer is const, too.
This is fixed by using a temporary pointer to the AVClass.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-02 08:20:10 +01:00
Anton Khirnov 82a2cbf820 ffprobe: stop setting AVCodecContext.framerate
That field is supposed to be exported by decoders, it makes no sense for
a user to set it.
2021-02-22 11:14:40 +01:00
Anton Khirnov 313c91beb8 ffprobe: stop printing deprecated fields
The FF_API macros are private and must not be used by external callers.
As the fields in question are to be removed without replacement, just
drop them.
The fields are:
AVPacket.convergence_duration
AVCodecContext.time_base
AVCodecContext.timecode_frame_start
AV_PIX_FMT_FLAG_PSEUDOPAL pixel descriptor flag
2021-02-22 11:14:29 +01:00
Anton Khirnov 04f49645a5 ffprobe: drop code accessing deprecated AVStream.codec 2021-02-22 11:14:17 +01:00
Anton Khirnov cb789fd2b3 ffprobe: do not use deprecated AVStream.codec for max bitrate
Use the decoder context instead.
2021-02-22 11:13:50 +01:00
Anton Khirnov 65b08aa19c ffprobe: remove an unnecessary deprecation guard
The code it is guarding is not accessing anything deprecated
(disregarding the fact that a library caller must not use FF_API
deprecation guards).
2021-02-22 11:13:40 +01:00
Mohammad Izadi 6e6d4c75fc fftools/ffprobe: add support for HDR10+ metadata
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-05 19:20:11 -03:00
Marton Balint babbb5a4ba fftools/ffprobe: use av_timecode_make_smpte_tc_string2
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-09-13 17:51:57 +02:00
Derek Buitenhuis f43a8112dd ffprobe: Allow unknown format private AVOptions
This useful, because by ffprobe's very nature, you use it to probe
a file and find out what it is. Requiring every format private option
to be known to the demuxer forces one to run ffprobe twice, if one
wants to use ffprobe in a generic way.

For example, say one wants to probe all user-uploaded files, while
also ignoring edit lists for any MP4s that are uploaded. Currently,
you'd have to run ffprobe twice: once to identify the format, and
once again to actually probe the metadata you want. After this
patch, you could set -ignore_editlist 1 on every call and only
probe once.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-07-02 19:24:56 +01:00
vectronic a75924ec88 fftools/ffprobe: show closed caption info in the stream dump
Signed-off-by: vectronic <hello.vectronic@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-05-02 19:14:08 +02:00
Jun Zhao e689a759c6 fftools/ffprobe: support DOVI sidedata
support DOVI sidedata.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-04-23 08:06:07 +08:00
Paul B Mahol d64cbd4fda remove CHAR_MIN/CHAR_MAX usage
It is not needed at all.
2020-03-17 22:46:36 +01:00