summaryrefslogtreecommitdiff
path: root/fftools/ffprobe.c
Commit message (Collapse)AuthorAge
* ffprobe: Support AV_FRAME_DATA_DOVI_METADATAJan Ekström2022-01-04
| | | | | Co-authored-by: Niklas Haas <git@haasn.dev> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffprobe: add missing separator when printing side data in compact outputJames Almer2021-12-22
| | | | | | Should fix ticket #7153 Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffprobe: print size of attachment streams (extradata_size)softworkz2021-11-29
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools: Constify values from av_dict_get()Chad Fraleigh2021-11-18
| | | | | | | | 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>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffprobe: Don't access AVProgram.(start|end)_timeAndreas Rheinhardt2021-09-14
| | | | | | | These are internal fields. Reviewed-by: Tobias Rapp <t.rapp@noa-archive.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: add a Film Grain codec property flagJames Almer2021-08-24
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* ffprobe: remove references to frame->pkt_ptsJames Almer2021-08-07
| | | | | | The field was removed during the last major bump. Signed-off-by: James Almer <jamrial@gmail.com>
* ffprobe: Rename Audio Service Type 'type' field to 'service_type'Derek Buitenhuis2021-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 677a030b26045acb50353d7954ae984ceefcd807 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>
* fftools: Don't set default swscale flags in ffmpeg/ffprobe/ffplayLinjie Fu2021-08-05
| | | | Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
* avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffprobe: use quotation marks in the xml header outputJames Almer2021-07-15
| | | | | | | | 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>
* fftools/ffprobe: Remove redundant check before avcodec_free_context()Andreas Rheinhardt2021-06-08
| | | | | | | | 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>
* ffprobe: support printing more packet side data typesAnton Khirnov2021-05-09
| | | | | Specifically WebVTT subtitle data, CPB properties, audio service type and mpegts stream id.
* ffprobe: only hash extradata when it is presentAnton Khirnov2021-05-09
| | | | | Passing zero-sized/NULL buffers to av_hash_update() is invalid and may crash with certain hashes.
* ffprobe: add option to control optional fields displayGyan Doshi2021-05-05
|
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-27
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify the API wrt AV(In|Out)putFormatAndreas Rheinhardt2021-04-27
| | | | | | | Also constify AVProbeData. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffprobe: Remove check on show_frames and show_packets in XML writerTobias Rapp2021-04-16
| | | | | | | | The "packets_and_frames" element has been added to ffprobe.xsd in 0c9f0da0f7656059e9bd41931d250aafddf35ea3 but apparently removing the check in ffprobe.c has been forgotten. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* ffprobe: only print exported private decoder optionsJames Almer2021-04-14
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffprobe: Add missing dispositionsAndreas Rheinhardt2021-03-31
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffprobe: use av_packet_alloc() to allocate packetsJames Almer2021-03-17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* ffprobe: switch to av_bprint_escape for XML escapingJan Ekström2021-03-05
| | | | | | Additionally update the result of the ffprobe XML writing test. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* fftools: Switch to const AVCodec * where possibleAndreas Rheinhardt2021-03-02
| | | | | | | | | | | 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>
* ffprobe: stop setting AVCodecContext.framerateAnton Khirnov2021-02-22
| | | | | That field is supposed to be exported by decoders, it makes no sense for a user to set it.
* ffprobe: stop printing deprecated fieldsAnton Khirnov2021-02-22
| | | | | | | | | | | 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
* ffprobe: drop code accessing deprecated AVStream.codecAnton Khirnov2021-02-22
|
* ffprobe: do not use deprecated AVStream.codec for max bitrateAnton Khirnov2021-02-22
| | | | Use the decoder context instead.
* ffprobe: remove an unnecessary deprecation guardAnton Khirnov2021-02-22
| | | | | | The code it is guarding is not accessing anything deprecated (disregarding the fact that a library caller must not use FF_API deprecation guards).
* fftools/ffprobe: add support for HDR10+ metadataMohammad Izadi2020-12-05
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffprobe: use av_timecode_make_smpte_tc_string2Marton Balint2020-09-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffprobe: Allow unknown format private AVOptionsDerek Buitenhuis2020-07-02
| | | | | | | | | | | | | | | | 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>
* fftools/ffprobe: show closed caption info in the stream dumpvectronic2020-05-02
| | | | | Signed-off-by: vectronic <hello.vectronic@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffprobe: support DOVI sidedataJun Zhao2020-04-23
| | | | | | support DOVI sidedata. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* remove CHAR_MIN/CHAR_MAX usagePaul B Mahol2020-03-17
| | | | It is not needed at all.
* fftools/ffprobe: Remove unneeded castsAndreas Rheinhardt2020-02-14
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffprobe: Fix fate tests for ffprobe in cases where TARGET_PATH differs from ↵Martin Storsjö2019-12-18
| | | | | | | | | | | | | | | | | | | the current path In these cases, we must pass the full path of the file to ffprobe (as the current working dir on the remote system, e.g. when invoked with "ssh remote ffprobe ..." isn't the wanted one). The input filename passed to ffprobe is also included in the output, which is part of the reference test data. Add a new option to ffprobe to allow overriding what path is printed, to keep the original relative path in the tests. An alternative approach could be an option to allow requesting omitting the file name from the dumped data, and updating the test references accordingly. Signed-off-by: Martin Storsjö <martin@martin.st>
* ffprobe: fix output of packets_and_frames section in JSON formatJames Almer2019-10-14
| | | | | | | | | The "type" entry was hardcoded with an trailing comma, even if it was the only entry in the section. Fixes ticket #8228. Signed-off-by: James Almer <jamrial@gmail.com>
* fftools: Use right function signature and pointersAndreas Rheinhardt2019-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option tables of the various fftools (in particular ffprobe) are arrays of OptionDef; said type contains a union of a pointer to void and a function pointer of type int (*)(void *, const char *, const char *) as well as a size_t. Some entries (namely the common entry for writing a report as well as several more of ffprobe's entries) used the pointer to void to store a pointer to functions of type int (*)(const char *) or type int (*)(const char *, const char *); nevertheless, when the functions are actually called in write_option (in cmdutils.c), it is done via a pointer of the first type. There are two things wrong here: 1. Pointer to void can be converted to any pointer to incomplete or object type and back; but they are nevertheless not completely generic pointers: There is no provision in the C standard that guarantees their convertibility with function pointers. C90 lacks a generic function pointer, C99 made every function pointer a generic function pointer and still disallows the convertibility with void *. 2. The signature of the called function differs from the signature of the pointed-to type. This is undefined behaviour in C99 (given that C90 lacks a way to convert function pointers at all, it doesn't say anything about such a situation). It only works because none of the functions this patch is about make any use of their parameters at all. Therefore this commit changes the type of the relevant functions to match the type used for the call and uses the union's function pointer to store it. This is legal even in C90. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffprobe: Fix memory leakDerek Buitenhuis2019-06-21
| | | | | | This packet was not necessarily unreferenced. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* fftools/ffprobe: Add S12M Timecode output as side data (such as SEI TC)Antonin Gouzer2019-05-27
| | | | | | Slightly modified by Marton Balint to produce valid json as well. Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffprobe: Indent the code.Jun Zhao2018-11-27
| | | | | | commit 196765a7cc4 missed the reindet. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* ffprobe: fix SEGV when new streams are addedAman Gupta2018-05-09
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* ffprobe: report unavailable SAR correctly in stream infoTimo Teräs2018-04-17
| | | | | | | | | av_guess_sample_aspect_ratio() will return undefined or missing value as {0,1}. This fixes show_stream() to check numerator to display 'N/A' when appropriate. show_frame() does this already correctly. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPALwm42018-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PSEUDOPAL pixel formats are not paletted, but carried a palette with the intention of allowing code to treat unpaletted formats as paletted. The palette simply mapped the byte values to the resulting RGB values, making it some sort of LUT for RGB conversion. It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8, GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap formats. The last one, GRAY8, is more common, but its treatment is grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming from typical Y video planes was not mapped to the correct RGB values. This cannot be fixed, because AVFrame.color_range can be freely changed at runtime, and there is nothing to ensure the pseudo palette is updated. Also, nothing actually used the PSEUDOPAL palette data, except xwdenc (trivially changed in the previous commit). All other code had to treat it as a special case, just to ignore or to propagate palette data. In conclusion, this was just a very strange old mechnaism that has no real justification to exist anymore (although it may have been nice and useful in the past). Now it's an artifact that makes the API harder to use: API users who allocate their own pixel data have to be aware that they need to allocate the palette, or FFmpeg will crash on them in _some_ situations. On top of this, there was no API to allocate the pseuo palette outside of av_frame_get_buffer(). This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes the pseudo palette optional. Nothing accesses it anymore, though if it's set, it's propagated. It's still allocated and initialized for compatibility with API users that rely on this feature. But new API users do not need to allocate it. This was an explicit goal of this patch. Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0. Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition, FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation functions manually changed to not allocating a palette.
* lav*,tests: remove several register_all callsJosh de Kock2018-04-02
| | | | | | | avdevice_register_all() is still required to register devices into lavf (this is required due to lavd being somewhat of a hack). Signed-off-by: Josh de Kock <josh@itanimul.li>
* ffprobe: fix infinite loop in subtitle decodingMarton Balint2018-03-12
| | | | | | | | | Fixes a regression since 2a88ebd096f3c748a2d99ed1b60b22879b3c567c which caused an infinite loop in the subtitle decoding. Fixes ticket #6796. Signed-off-by: Marton Balint <cus@passwd.hu>
* ffprobe: remove usage of deprecation warning removal pragmasJames Almer2018-02-02
| | | | | | Fixes compilation in non Windows targets. Signed-off-by: James Almer <jamrial@gmail.com>
* ffprobe: Initialize coded_width/heightZhong Li2018-02-02
| | | | | | | | | | coded_width/height are unnitialized and will be overwritten by dec_ctx->width/height in avcodec_open2() This fixes tiket #6958. Signed-off-by: Zhong Li <zhong.li@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
* fftools, tools, examples: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>