Commit Graph

2714 Commits

Author SHA1 Message Date
Paul B Mahol e5367b481b ffmpeg: fix loosing gaps between audio frame timestamps when filtering 2021-11-18 12:54:17 +01:00
Derek Buitenhuis 71fa14787b fate: Add test for Dolby Vision RPU side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-11-17 14:12:51 +00:00
Anton Khirnov bd55552d69 ffmpeg: rewrite setting the stream disposition
Currently, the code doing this is spread over several places and may
behave in unexpected ways. E.g. automatic 'default' marking is only done
for streams fed by complex filtergraphs. It is also applied in the order
in which the output streams are initialized, which is effectively
random.

Move processing the dispositions at the end of open_output_file(), when
we already have all the necessary information.

Apply the automatic default marking only if no explicit -disposition
options were supplied by the user, and apply it to the first stream of
each type (excluding attached pics) when there is more than one stream
of that type and no default markings were copied from the input streams.

Explicitly document the new behavior.

Changes the results of some tests, where the output file gets a default
disposition, while it previously did not.
2021-11-16 10:51:32 +01:00
Thilo Borgmann c42d513ede lavf/mov: Change default to prefer TFDT time and allow for fallback to SIDX or TFDT 2021-11-05 16:22:04 +01:00
Mark Reid d2379bd6a0 swscale/input: fix planar_rgb16_to_a for gbrap10be and gbrap12be formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-11-04 11:52:33 +01:00
James Almer ba0ba5539a fate: update ref files after a recent change
Missed in 3925b826df.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-10-29 15:43:14 -03:00
Paul B Mahol 97b5b9dbea avfilter: split negate filter from lut filter
Using luts for negating is suboptimal.

FATE test changes because filter no longer clips values into limited color range.
2021-10-27 11:29:29 +02:00
Zane van Iperen 9a2b9aafba
avformat/argo_asf: pass name through as metadata
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-10-15 23:40:15 +10:00
Paul B Mahol c336c7a9d7 fate: update histogram test results 2021-10-14 12:22:38 +02:00
Andreas Rheinhardt 6e859d2bdb fate/cover-art: Add test for muxing cover arts to FLAC
Also covers muxing and demuxing of nonstandard FLAC channel layouts
and the multi-dim-quant option of the FLAC encoder
(all of which was hitherto uncovered).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-07 22:09:04 +02:00
Andreas Rheinhardt 3e022d185c fate/subtitles: Add scc remux test
Provides coverage for the muxer.
(Thanks to tresh for modifying the whitespace commit hook
to allow to push this ref file with tabs.)

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-07 17:56:58 +02:00
Andreas Rheinhardt 66f4685910 fate/image: Modify aliaspix tests to also cover the encoder
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-07 11:56:53 +02:00
Andreas Rheinhardt 1307089523 fate/subtitles: Add remuxing test for lrc
It uses the test-lrc.lrc sample which was added years ago, but never
used until now.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-07 11:52:56 +02:00
Jan Ekström 7a446b1179 avformat/{isom,mov,movenc}: add support for CMAF DASH roles
This information is coded in a standard MP4 KindBox and utilizes the
scheme and values as per the DASH role scheme defined in MPEG-DASH.
Other schemes are technically allowed, but where multiple schemes
define the same concepts, the DASH scheme should be utilized.

Such flagging is additionally utilized by the DASH-IF CMAF ingest
specification, enabling an encoder to inform the following component
of the roles of the incoming media streams.

A test is added for this functionality in a similar manner to the
matroska test.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-10-04 17:55:27 +03:00
Derek Buitenhuis 68815d6791 lavf/movenc: Write 'dby1' minor brand if Dolby content is being muxed to MP4
This is as per:
   * mp4ra: http://mp4ra.org/#/brands
   * Dolby Vision muxing spec (which is public):
       https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolby_vision_bitstreams_within_the_iso_base_media_file_format_dec2017.pdf

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-10-01 20:29:25 +01:00
Paul B Mahol a7fc78c1a6 avfilter/vf_avgblur: switch to faster algorithm 2021-09-30 01:22:57 +02:00
Andreas Rheinhardt ffe9867bc2 fate/oma: Add remux tests for ATRAC3 and ATRAC3P
They already uncovered an uninitialized-value bug in the ATRAC3 code
in the demuxer; and provide coverage for ID3v2.3.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-27 07:08:59 +02:00
Andreas Rheinhardt 3a47e87d55 fate/caf: Add remux tests
These test both the muxer as well as the demuxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-27 07:08:53 +02:00
Andreas Rheinhardt e02447e41e fate/demux: Move caf test to its own file
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-27 06:12:54 +02:00
Manuel Stoeckl 32329397e2 swscale: add input/output support for X2BGR10LE
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 16:26:10 +02:00
Manuel Stoeckl 0760d9153c lavu/pix_fmt: add pixel format for x2bgr10
The new format (given in big/little endian forms) matches the
existing X2RGB10 format, except with B and R channels switched.

AV_PIX_FMT_X2BGR10 data often is created by OpenGL programs
whose buffers use the GL_RGB10 internal format.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 16:26:10 +02:00
Manuel Stoeckl ca594df622 swscale/yuv2rgb: fix conversion to X2RGB10
This resolves a problem where conversions from YUV to X2RGB10LE
would produce color values a factor 4 too small, because an 8-bit
value was placed in a 10-bit channel.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 16:26:10 +02:00
Maryla 9f4708c22d webp: fix transforms after a palette with pixel packing.
When a color indexing transform with 16 or fewer colors is used,
WebP uses "pixel packing", i.e. storing several pixels in one byte,
which virtually reduces the width of the image (see WebPContext's
reduced_width field). This reduced_width should always be used when
reading and applying subsequent transforms.

Updated patch with added fate test.
The source image dual_transform.webp can be downloaded by cloning
https://chromium.googlesource.com/webm/libwebp-test-data/

Fixes: 9368
Signed-off-by: James Zern <jzern@google.com>
2021-09-25 15:31:36 -07:00
Andreas Rheinhardt 0a6eed319d fate/subtitles: Add JACOsub remuxing test
This muxer was untested up until now; had it been tested, it would
have been obvious that it has been broken for years.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-25 23:26:38 +02:00
Nicolas Gaullier 8a3f8afa4e avformat/mov: Set AVSTREAM_PARSE_HEADERS flag for H264
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-23 10:35:09 -03:00
Nicolas Gaullier fad459b5a6 avcodec/h264_parser: Set AVCodecContext.framerate
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-23 10:35:08 -03:00
Anton Khirnov d6742bb7b6 Revert "fate: Add test for ticket 6024, truncated decoding mode"
This reverts commit 47cd8effea.
AV_CODEC_FLAG_TRUNCATED is now deprecated.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 00:23:52 +02:00
Nicolas George 449ba49a9f tests/concat-demuxer: add stream_meta test 2021-09-16 10:17:59 +02:00
bnnm 19802d170a avcodec/wmadec: fix WMA gapless playback
Fixes trac issue #7473.

Removes encoder delay (skip samples) and writes remaining frame samples after EOF to get correct sample count.

Output is now accurate vs players that use Microsoft's codecs (Windows Media Format Runtime).

Tested vs encode>decode WMAv2 with MS's codecs and most sample rate/bit rate/channel/mode combinations in ASF/XWMA.
WMAv1 appears to use the same delay, from FFmpeg samples.

Signed-off-by: bnnm <bananaman255@gmail.com>
2021-09-12 22:23:35 +02:00
Paul B Mahol 0b4d009587 fate: fix silenceremove test 2021-09-09 23:45:52 +02:00
Anton Khirnov 03f3680080 fate/pixfmt: test xyz12le 2021-08-29 18:44:46 +02:00
Paul B Mahol a6f00d4e82 avfilter/aeval: fix forgotten EOF case for activate
Bring fate test how it was previously.
2021-08-26 19:23:03 +02:00
Jan Ekström d48232fb4c tests/fate: move TTML-in-MP4 tests from subtitles.mak to mov.mak
subtitles.mak's fate-sub tests utilize a more strict comparator
("rawdiff"), which causes the tests fail in case of white space
differences, such as CRLF vs LF. This in turn causes these
ffprobe-using TTML-in-MP4 tests to fail on non-LF systems such as
Windows or wine.
2021-08-25 23:17:53 +03:00
Jan Ekström e41bd075dd avformat/movenc: add support for TTML muxing
Includes basic support for both the ISMV ('dfxp') and MP4 ('stpp')
methods. This initial version also foregoes fragmentation support
in case the built-in sample squashing is to be utilized, as this
eases the initial review.

Additionally, add basic tests for both muxing modes in MP4.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-08-25 09:26:46 +03:00
James Almer fbbca7b8fa fate: update some missing refs
Forgotten in 590a7e02f0

Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-24 12:22:36 -03: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
Andreas Rheinhardt 750631b098 avformat/matroskaenc: Pass dispositions through unchanged by default
Up until now, the Matroska muxer did not use the dispositions it is
given as-is; instead it by default overrode the disposition of the first
track of a kind (audio, video, subtitles) if no track of this kind has
the default disposition set. And up until recently, it also enforced
by default that no more than one track of each kind be marked as
default.

The rationale for the former is that there are lots of containers which
lack the concept of default streams, so that it is not uncommon for no
stream to be marked as default at all; the rationale for the latter was
that up until recently, it was dubious whether the Matroska specification
allowed more than one default stream for track type (e.g. mkvmerge
disallowed it). It was this point which led to the implementation of
the above mentioned behaviour inspired by mkvmerge.

Yet the Matroska specifications have changed and now explicitly allow
to set more than one track of each type as default, so that the main
reason of not using the dispositions as-is was rendered moot. Therefore
this commit changes the default to pass the disposition through.

The matroska-mpegts-remux FATE-test has been updated to still use the
old "infer" mode so that it is still covered by FATE; the
matroska-zero-length-block test has also been updated to cover
the infer_no_subs mode. The references for lots of other FATE tests
needed to be updated because of a newly added FlagDefault element with
value zero (whereas a FlagDefault with value 1 needn't be coded at all,
as it coincided with the default value of said element).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-24 04:23:29 +02:00
Andreas Rheinhardt beb60abab5 avformat/matroskaenc: Allow to set multiple streams as default
The Matroska specifications have evolved and now allow to mark
multiple tracks of the same kind as default (whether this was legal or
not before was dubious; e.g. mkvmerge disallowed it). Yet when the
Matroska muxer is set to infer default dispositions if absent, it also
enforced the now outdated restriction. So update this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-24 03:11:01 +02:00
Gyan Doshi d905af0c24 avformat/mov: add AVFMT_SHOW_IDS flag
The MOV muxer can store streamids as track ids but they aren't
visible when probing the result via lavf/dump or ffprobe due to
lack of this flag in the demuxer.
2021-08-22 17:55:31 +05:30
Paul B Mahol 99ccad843f avfilter/aevalsrc: switch to activate
Allow to set the EOF timestamp.

FATE test is updated, as last 2 frames were duplicated.
2021-08-21 16:43:21 +02:00
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