Commit graph

2306 commits

Author SHA1 Message Date
Sebastian Dröge
6c3fc7a16d avdemux: Pass the URI from the URI query to avformat_open_input()
Some demuxers make use of it in various ways, for example the HLS
demuxer.
2020-01-23 11:58:29 +02:00
Alicia Boya García
b7d450b118 gstavviddec: Limit default number of decoder threads
When the `max-threads` property is not specified, GStreamer defaults to
the amount of CPU threads in the system.

The number of threads used in avdec has a direct impact on the latency
of the decoder, which is of as many frames as threads. Therefore, big
numbers of threads can make latency levels that can be problematic in
some applications.

For this reason, ffmpeg emits a warning when more than 16 threads are
requested.

This patch limits the default number of threads to 16. This affects only
computers with more than 16 CPU threads when using avviddec without
setting `max-threads`.
2019-12-19 21:59:44 +00:00
Tim-Philipp Müller
77f63c2457 pkgconfig: remove unused file
Was never hooked up to meson build it seems, and only ever used
by the uninstalled autotools dev env to locate gst-libav plugins
for use in unit tests in other modules.
2019-12-02 19:06:04 +00:00
Edward Hervey
5a9f3d4bf1 avvidenc: Fix error propagation
Instead of returning the default return value (GST_FLOW_OK), actually
return an error one (res vs ret).
2019-11-29 11:33:41 +01:00
Kevin JOLY
9e56619b10 avdemux: Fix segmentation fault if long_name is NULL
Some plugins (like libcdio) registers empty long_name field. Calling strncmp on this field leads to a segmentation fault.

Signed-off-by: Kevin Joly <joly.kevin25@gmail.com>
2019-11-04 16:14:05 +01:00
Seungha Yang
07f33470b3 avviddec: Fix huge leak caused by circular reference
AVBufferRef -> GstFFMpegVideoDecVideoFrame -> GstVideoCodecFrame -> AVBufferRef

Instead of holding additional ref there, set read-only which would not be
reused by ff_reget_buffer()

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/63
2019-10-29 16:29:46 +09:00
Seungha Yang
30d0674e7d avvideenc,avvidedec: Filtering hardware en/decoder by flag
... instead of filtering them by hardcoded string compare.
2019-10-25 19:48:15 +09:00
Seungha Yang
80c8c05457 avviddec: Enforce allocate new AVFrame per input frame
... if ffmpeg would reuse the allocated AVBuffer. Reused AVFrame by
the ffmpeg seems to break our decoding flow since the reused AVFrame
holds the initial opaque data (GstVideoCodecFrame in this case), so
we couldn't trace the our in/out frames.
To enforce get_buffer() call per output frame, hold another reference
to the AVBuffer in order to mark the AVBuffer as not writable.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/62
2019-10-24 00:25:28 +09:00
Tim-Philipp Müller
ca478e7546 Remove autotools build system 2019-10-13 14:36:06 +01:00
Seungha Yang
40f5953828 avviddec,avcodemap: Use new helper function for map color space information
... between GStreamer and FFmpeg. Note that FFmpeg follows ISO/IEC 23001-8
defined color{matrix,transfer,primaries} values.
2019-09-24 23:52:11 +09:00
Marc Leeman
f4859ff73d docs: do not require gst-plugins-doc-cache-generator
Do not require the cache generator. This is in line with the other
gstreamer modules
2019-09-11 15:59:42 +00:00
Mathieu Duponchelle
06c249cabb avvidenc: timestamp output buffers
Same approach as x264enc, with the one hour offset
2019-08-13 20:32:47 +00:00
Doug Nazar
6382be0996 avauddec: Don't warn if drain is successful 2019-08-01 16:27:35 -04:00
Mathieu Duponchelle
1e8e040fbc avviddec: improve latency calculation
When thread_type is set to FF_THREAD_FRAME, per the documentation
a latency of one frame per thread is introduced:

<https://ffmpeg.org/ffmpeg-codecs.html>, search for thread_type.

Additionally, we need in that case to calculate the automatic
number of threads ourselves, so as to accurately calculate the
latency.
2019-07-18 00:26:50 +02:00
Seungha Yang
e8f21b510a avviddec: Add thread-type property
The thread-type property allows specifying preferred
multithreading methods by user. Note that FF_THREAD_FRAME
may introduce additional latency especially on non-filesrc usecase,
since it introduces a decoding delay of (number of threads) frames.

https://bugzilla.gnome.org/show_bug.cgi?id=797254
2019-07-18 00:05:21 +02:00
Sebastian Dröge
4d3cd3983a avvidenc: Close reference context before freeing it
Otherwise we'll leak some memory.

See https://gitlab.freedesktop.org/gstreamer/gst-libav/merge_requests/32
2019-07-15 10:42:42 +03:00
Knut Andre Tidemann
456e812c28 avaudenc: fix memory leak of refcontext after finalize. 2019-07-12 14:44:12 +02:00
Sebastian Dröge
2596e5bd6f avvidenc: Also set the repeat_pict flag correctly and take the TFF flag from caps if available 2019-06-19 15:44:49 +03:00
Sebastian Dröge
6359385df5 avvidenc: Correctly signal interlaced input to ffmpeg when the input caps are interlaced
Regression from 1e4529ced2
2019-06-19 15:43:42 +03:00
Niels De Graef
8e948f9e14 meson: Bump minimal GLib version to 2.44
This means we can use some newer features and get rid of some
boilerplate code using the G_DECLARE_* macros.

As discussed on IRC, 2.44 is old enough by now to start depending on it.
2019-06-02 21:45:19 +02:00
Guillaume Desmottes
2e59973cca avviddec: remove cdgraphics element
It was never usable as we don't have a parser and we now have 'cdgdec'
in gst-plugins-rs.
2019-05-29 11:49:38 +05:30
Tim-Philipp Müller
0bf5b537d6 configure: pass -Wno-attributes to fix build against broken ffmpeg headers
libavutil/mem.h:342:1: error: ‘alloc_size’ attribute ignored on a function returning ‘int’
 av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
 ^~~~~~~~~~~~~

Hopefully fixes build on jenkins.
2019-05-25 13:36:40 +02:00
Seungha Yang
2b50a0ce93 avcodecmap,avviddec: Map bt2020-10, PQ and HLG transfer functions
Map more transfer functions between Gstreamer and ffmpeg
2019-05-24 20:44:12 +09:00
Arun Raghavan
597578ca41 codecmap: Add caps for aptX and aptX-HD 2019-05-24 09:51:44 +00:00
Thibault Saunier
e3e99ddfa0 docs: Stop building the doc cache by default
Fixes https://gitlab.freedesktop.org/gstreamer/gst-docs/issues/36
2019-05-16 09:35:11 -04:00
Thibault Saunier
93d1d9ec71 docs: Update plugins documentation cache 2019-05-13 22:58:09 -04:00
Thibault Saunier
357a9b4a19 docs: Port to hotdoc 2019-05-13 17:00:00 -04:00
Christoph Reiter
5705e4ea7d autotools: add bcrypt to win32 libs
The included libav requires it now. Otherwise the builds fails with:

  CCLD     libgstlibav.la
build-i686-w64-mingw32/gst-libs/ext/.libs/libavutil.a(random_seed.o): In function `av_get_random_seed':
gst-libav-1.16.0/gst-libs/ext/libav/libavutil/random_seed.c:126: undefined reference to `BCryptOpenAlgorithmProvider@16'
gst-libav-1.16.0/gst-libs/ext/libav/libavutil/random_seed.c:129: undefined reference to `BCryptGenRandom@16'
gst-libav-1.16.0/gst-libs/ext/libav/libavutil/random_seed.c:130: undefined reference to `BCryptCloseAlgorithmProvider@8'
collect2.exe: error: ld returned 1 exit status
2019-05-05 09:38:01 +02:00
Seungha Yang
8d9b30695b avviddec: Extract HDR information if any
Convert mastering display information (a.k.a HDR static metadata) and
content light level information provided by FFMPEG to Gstreamer.
2019-05-01 23:24:56 +09:00
Yeongjin Jeong
603c78b1a1 gstav: Use libavcodec util function for version check
The version of libavutil is printed in the log instead of libavcodec
because avutil_version() returns LIBAVUTIL_VERSION_INT. This can be confusing,
so we should be replace it with avcodec_version().
2019-04-29 16:02:05 +00:00
Yeongjin Jeong
472f2ef104 avauddec: Ensure drain even if codec has not delay capabilities
There are decoders that need to be drained if they work on multi-threads,
even if AV_CODEC_CAP_DELAY is not set.
2019-04-29 15:40:08 +09:00
Yeongjin Jeong
93e2466115 avviddec: Ensure drain even if codec has not delay capabilities
There are decoders that need to be drained if they work on multi-threads,
even if AV_CODEC_CAP_DELAY is not set.
2019-04-29 15:38:42 +09:00
Tim-Philipp Müller
2b6e9d303d Back to development 2019-04-19 11:00:07 +01:00
Tim-Philipp Müller
d6c61e69b3 Release 1.16.0 2019-04-19 00:33:23 +01:00
Tim-Philipp Müller
1ef16a7ca1 Update docs 2019-04-19 00:33:22 +01:00
Sebastian Dröge
724c7c2b2a libav: Update to ffmpeg n4.1.3 2019-04-12 10:06:43 +03:00
Tim-Philipp Müller
b83229f73b Release 1.15.90 2019-04-11 00:34:12 +01:00
Tim-Philipp Müller
7de9fee26d Update docs 2019-04-11 00:34:12 +01:00
Sebastian Dröge
935c21a9a9 avcfg: Override type of bitrate property from int64 to int
See https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/41#note_142808

The switch to the new ffmpeg property system changed the type of the
bitrate property from int to int64, which potentially breaks many
existing applications at runtime as properties are usually set via
g_object_set().

As such, override the type to int until GStreamer 2.0.
2019-04-09 16:56:20 +03:00
Aaron Boxer
b2cc8a57d4 avviddec: do not add 708 caption meta if already exists
(this is only used for CEA 708 raw data). another element
such as mpegvideoparse may have already added the meta.
2019-04-01 17:11:36 -04:00
Mathieu Duponchelle
be579c426d avvidenc: pass Closed Caption metadata to libav 2019-03-23 00:27:55 +01:00
Tim-Philipp Müller
ef8a1bdd90 avauddec: fix decoding of APE and Cook audio
.. and other formats where ffmpeg gives us multiple
subframes per input frame.

Since we now support non-interleaved audio, we can't
just concat buffers any more. Also, audio metas won't
be combined when buffers are merged, so when we push
out the combined buffer we'll look at the meta describing
only the first subframe and think it covers the whole
frame leading to stutter/gaps in the output.

We could fix this by copying the output data into a new
buffer when we merge buffers, but that's suboptimal, so
let's add some API to GstAudioDecoder to push out subframes
and use that instead.

https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/49
2019-03-04 11:54:15 +00:00
Tim-Philipp Müller
caf953bd5d Back to development 2019-03-04 09:12:35 +00:00
Tim-Philipp Müller
c693e62a44 Release 1.15.2 2019-02-26 11:57:15 +00:00
Tim-Philipp Müller
88166aeb78 Update docs 2019-02-26 11:57:15 +00:00
Guillaume Desmottes
1d293764e5 avdemux: fix negative pts if start_time is bigger than the ts
The start time is supposed to be the ts of the first frame.
FFmpeg uses fractions to represent timestamps and the start time may use a
different base than the frame pts. So we may end up having the start
time bigger than the pts because of rounding when converting to gst ts.

See https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/51
for details.
2019-02-21 08:56:34 +01:00
Sebastian Dröge
1e01f2764b configure: Only disable dxva2 once 2019-02-12 17:23:55 +02:00
Sebastian Dröge
43d3c883fb Update to ffmpeg n4.1.1 2019-02-12 10:57:24 +02:00
Tim-Philipp Müller
240cb809a9 Release 1.15.1 2019-01-17 02:21:50 +00:00
Tim-Philipp Müller
c94c6555c3 Update docs 2019-01-17 02:21:35 +00:00