Commit Graph

2674 Commits

Author SHA1 Message Date
Anton Khirnov 94170e0411 tools/venc_data_dump: factor out demux/decode code
It can be shared with other simple demux/decode tools.
2021-08-08 19:21:39 +02: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 9f14396a51 lavfi/vf_scale: use default swscale flags for scaler
Currently the default swscale flags for simple filter graph is bicubic,
however for complex filter graph it uses bilinear as decleared in scale
filter.

$ffmpeg -v verbose -i input.mp4 -vf format=yuv420p,scale=800x600 -an -f null -
[Parsed_scale_1 @ 0x7f86d2c160c0] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x4

$ffmpeg -v verbose -i input.mp4 -filter_complex format=yuv420p,scale=800x600 -an -f null -
[Parsed_scale_1 @ 0x7f8779e046c0] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x2

Use default swscale flags (bicubic currently) for scale filter.
- Remove flags="bilinear" from vf_scale
- Update the FATE refs

Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2021-08-05 22:23:49 +08:00
Yun Zhang a27853a730 lavd/lavfi.c: Set time_base for 608 cc to container time_base.
Suggested-By: ffmpeg@fb.com
2021-08-02 14:00:52 +02:00
Tobias Rapp f531a1a4e8 fate/ffprobe: Verify ffprobe XML output against schema file
Adds schema validation for ffprobe XML output so that updating the
ffprobe.xsd file upon changes to ffprobe is not forgotten. This was
suggested by Marton Balint in:
http://ffmpeg.org/pipermail/ffmpeg-devel/2021-March/278428.html

The schema FATE test is only run if xmllint command is available.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2021-07-13 08:57:23 +02:00
Guangyu Sun b53738bf90 fate/oggvorbis: Fix tests after fixing AV_PKT_DATA_SKIP_SAMPLES
After fixing AV_PKT_DATA_SKIP_SAMPLES for reading vorbis packets from ogg,
the actual decoded samples become fewer. Three fate tests are failing:

fate-vorbis-20:
The samples in 6.ogg are not frame aligned. 6.pcm file was generated by
ffmpeg before the fix. After the fix, the decoded pcm file does not match
anymore. Ideally the ref file 6.pcm should be updated but it is probably
not worth it including another copy of the same file, only smaller.
SIZE_TOLERANCE is added for this test case.

fate-webm-dash-chapters:
The original vorbis_chapter_extension_demo.ogg is transmuxed to dash-webm.
The ref file webm-dash-chapters needs to be updated.

fate-vorbis-encode:
This exposes another bug in the vorbis encoder that initial_padding is not
correctly set. It is fixed in the previous patch.

Signed-off-by: Guangyu Sun <gsun@roblox.com>
2021-07-12 09:55:21 +02:00
Marton Balint f597041d57 avformat/flvdec: use milisecond precision for parsing timestamps
Also use helper function to set the timestamp. Maybe we could also use
nanosecond precision, but there were some float rounding concerns.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-05-20 20:39:14 +02:00
James Almer a42d249c91 avformat/framecrcenc: print basic side data information again
This partially reverts c6ae560a18.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-18 10:18:49 -03:00
Anton Khirnov ef58f48d59 fate: add a more extensive test for APNG_DISPOSE_OP_BACKGROUND
Uses the sample from #9184.
2021-05-14 11:15:13 +02:00
Anton Khirnov 6a9a4f34bd lavf/flvdec: normalize exporting date metadata
Export them in UTC, not the local timezone. This way the output is
the same everywhere. The timezone information stored in the file is
still ignored, since there seems to be no simple way to export it
correctly.

Format them according to ISO 8601, which we generally use for exporting
dates.

Fixes fate-flv-demux, which was broken since
958bea5248 on some platforms.
2021-05-12 20:19:02 +02:00
Anton Khirnov c6ae560a18 lavf/framecrcenc: do not hash side data
There are no guarantees that all side data types have the same
representation on all platforms.

Tests that change output due to this:

id3v2-priv-remux, cover-art-mp3-id3v2-remux, gapless-mp3: SKIP_SAMPLES,
which is tested by fate-gapless-mp3-side-data

matroska-vp8-alpha-remux: MATROSKA_BLOCKADDITIONAL, which is tested by
remux itself (side data is written into output)

matroska-mastering-display-metadata: MASTERING_DISPLAY_METADATA and
CONTENT_LIGHT_LEVEL, which are tested by ffprobe invocation in the same
test

matroska-spherical-mono-remux: STEREO3D and SPHERICAL, which are tested
by ffprobe invocation in the same test

segment-mp4-to-ts: MPEGTS_STREAM_ID, which is tested by ts remuxing
tests

webm-webvtt-remux: WEBVTT_IDENTIFIER/SETTINGS, which is tested by the
ffprobe invocation in the same test

mxf-d10-user-comments: CPB_PROPERTIES, which is tested by mxf-probe-d10

mov-cover-image: SKIP_SAMPLES, which is tested for mov by
mov-aac-2048-priming

copy-trac3074: AUDIO_SERVICE_TYPE, which is tested by fate-hls-fmp4_ac3
2021-05-09 11:07:20 +02:00
Anton Khirnov 4d28a6756c fate: drop the vp8-alpha test
It is redundant with matroska-vp8-alpha-remux.
2021-05-09 11:07:20 +02:00
Anton Khirnov af607a8838 fate-run.sh: print stream side data in probeaudiostream()
Adds a test for reading AUDIO_SERVICE_TYPE in fate-hls-fmp4_ac3
2021-05-09 11:07:20 +02:00
Anton Khirnov 1b3bd52e54 fate-webm-webvtt-remux: print packet side data in ffprobe output 2021-05-09 11:07:20 +02:00
Anton Khirnov 958bea5248 fate/demux: convert flv-demux to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:20 +02:00
Anton Khirnov 471a9e706b fate-ts-demux: convert to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:20 +02:00
Anton Khirnov c89460f096 fate-ts-opus-demux: convert to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:20 +02:00
Anton Khirnov 99fb6ffd82 fate-ts-small-demux: convert to ffprobe
It can handle side data cleanly.
2021-05-09 11:07:19 +02:00
Anton Khirnov 40b33ee693 fate/gapless: add a test for skip samples side data 2021-05-09 11:07:17 +02:00
Anton Khirnov b8041fb838 fate-oggopus-demux: convert to ffprobe
It can print side data cleanly.
2021-05-09 10:59:21 +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
James Almer e27e80edcd tests/image: remove colorspace conversion from jpegls tests
It's not needed after 011006874c.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-03 18:32:01 -03:00
Zane van Iperen ab38a48c48
fate: add adpcm_ima_ws test in a VQA v3 file
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-29 23:52:46 +10:00
Andreas Rheinhardt 985c0dac67 avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPAL
Deprecated in d6fc031caf.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 7b6012efaa avformat/mov, movenc: Stop exporting rotation via metadata
Deprecated in ddef3d902f.

(The reference file of the mov-zombie test needed to be updated, because
a rotate metadata tag is no longer exported; the side-data is of course
still present.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt f0c7fa2c48 avcodec: Switch AVCPBProperties to 64bits
Announced in 2e8b0446c6.
Two FATE-tests needed to be updated because the checksums of
side data containing an AVCPBProperties struct changed.

buffer_size has also been switched to 64bits because it is a bitsize.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:07 -03:00
Jan Ekström b24488e727 avcodec/ttmlenc: add support for region positioning and sizing
The ASS margins are utilized to generate percentual values, as
the usage of cell-based sizing and offsetting seems to be not too
well supported by renderers.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-04-26 16:40:31 +03:00
Jan Ekström 3ef5a8ba2b avcodec/ttmlenc: add initial support for regions and styles
Attempts to utilize the TTML cell resolution as a mapping to the
reference resolution, and maps font size to cell size. Additionally
sets the display and text alignment according to the ASS alignment
number.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-04-26 16:40:31 +03:00
Zane van Iperen 2da033be10
fate: add adpcm_ima_ws test
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-26 19:56:33 +10:00
Aidan Richmond 50442540d0
avcodec/adpcm: Fixes output from Westwood ADPCM.
Fixes bug #9198

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Aidan Richmond <aidan.is@hotmail.co.uk>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-26 19:56:32 +10:00
James Almer a5f996de4f fate: add tests for JPEG-LS PAL8
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-24 12:32:06 -03:00
Anton Khirnov 878e45e0fb tests/fate: add a test for APNG_DISPOSE_OP_BACKGROUND 2021-04-24 13:02:54 +02:00
Andreas Rheinhardt 8068f2fcf3 avformat/id3v2: Don't reverse the order of id3v2 APICs
When parsing ID3v2 tags, special (non-text) metadata is not applied
directly and unconditionally; instead it is stored in a linked list
in which elements are prepended. When traversing the list to add APICs
(or private tags) at the end, the order is reversed. The same also
happens for chapters and therefore the chapter parsing code already
reverses the chapters.

This commit changes this: By keeping pointers to both head and tail
of the linked list one can preserve the order of the entries and
remove the reordering code for chapters. Only the pointer to head
will be exported: No current caller uses a nonempty list, so exporting
both head and tail is unnecessary. This removes the functionality
to combine the lists of special metadata read from different ID3v2 tags,
but that doesn't make really much sense anyway (and would be trivial
to implement if desired) and allows to remove the now unnecessary
initializations performed by the callers.

The FATE-reference for the id3v2-priv test had to be updated
because the order of the tags read into the dict is reversed;
for id3v2-priv-remux only the md5 and not the ffprobe output
of the remuxed file changes because the order of the private tags
has up until now been reversed twice.

The references for the aiff/mp3 cover-art tests needed to be updated,
because the order of the attached pics is reversed upon reading.
It is still not correct, because the muxers write the pics in the order
in which they arrive at the muxer instead of the order given by
pkt->stream_index.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-18 02:24:44 +02:00
Andreas Rheinhardt b0afa10c8c fate/id3v2: Add test for id3v2 chapters
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-18 02:20:30 +02:00
Andreas Rheinhardt 8364643f68 fate/id3v2: Add a test for remuxing id3v2 private tags
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-18 02:19:42 +02:00
Andreas Rheinhardt 2f4ef9cbdf fate/cover-art: Add test for writing id3v2 tags and apic with AIFF/MP3
Notice that the order of the APIC tracks is currently wrong. This is
a superposition of two bugs: (i) Both muxers write the attached
pictures in the order they arrive in the muxer and not in the
stream_index order, leading to attached pictures that are copied being
written earlier because their timestamp is AV_NOPTS_VALUE, whereas the
timestamp of the encoded pictures is 0. (ii) A bug in the id3v2 parsing
code reverses the order of the parsed pictures.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-18 02:18:22 +02:00
Andreas Rheinhardt 3d76d4bf7f fate/mov: Add test for muxing cover images
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-18 02:04:42 +02:00
James Almer 03e767790c avformat/mpegts: set correct extradata size for Opus streams
map_type 0 is always 19 bytes, whereas map_type 1 and 255 are 21 + channel
count bytes.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-16 11:08:40 -03:00
James Almer c1fd4033dc avformat/mpegts: add missing sample_rate value to Opus extradata
Finishes fixing ticket #9190.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-16 11:08:40 -03: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
James Almer ebdc7d78c9 avcodec/h264dec: add missing flags to is_avc and nal_length_size AVOptions
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-14 20:04:42 -03:00
Anton Khirnov 8e4390de48 tests/fate: add tests for PNG side/meta data 2021-04-08 11:03:15 +02:00
Marton Balint fb4da90fec avformat/url: add ff_make_absolulte_url2 to be able to test windows path cases
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-07 22:14:56 +02:00
Andreas Rheinhardt 0c7d02844c tests/matroska: Add test for remuxing annex B H.264 into Matroska
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-01 10:45:28 +02:00
Andreas Rheinhardt d4575982f4 tests/matroska: Add test for WebVTT in WebM
Specifically test that the WebVTT flavour is correctly mapped to
the Matroska/WebM CodecID and back; and test that dispositions
unsupported by WebM are discarded even when they would be supported
by Matroska.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-03-31 11:51:58 +02: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
Andreas Rheinhardt 47d0b86cf3 avformat/s337m: Use and test Dolby-E-parser
This makes av_read_frame() return packets with proper timestamps.
As a result, seeking now works in combination with streamcopy.
A FATE-test for this has been added.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-23 01:05:17 +01:00
Derek Buitenhuis e668c55649 FATE: Add test for probing MOV/MP4 files with extended box sizes
The test sample has to have no file extension, otherwise probing
happens to work, based off file extension alone, and we want to
test the actual probing function.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-03-21 14:14:36 +00:00