Commit graph

201 commits

Author SHA1 Message Date
Stéphane Cerveau
62d914b5b4 x264: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/79>
2021-03-29 19:13:36 +00:00
Sebastian Dröge
951e2604e7 x264: Update for gst_video_transfer_function_*() function renaming
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/68>
2020-09-07 12:14:13 +03:00
Sebastian Dröge
60337ffed9 x264enc: Allow maximum quantizer value of 63 instead of 51
QP_MAX_SPEC in x264 is set to 63 nowadays and in theory it allows even
up to 81 (QP_MAX) but that seems to be outside the spec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/67>
2020-08-24 23:23:43 +01:00
Jan Alexander Steffens (heftig)
05bb87ea0f x264enc: Separate high-10 video formats from 8-bit formats
If downstream is constrained to an 8-bit profile, caps queries would
still allow I420_10LE as input. If upstream actually sends such a caps
event, downstream would fail to accept the high-10 profile.

The following pipeline now fails earlier, during the negotiation phase
instead of the stream start:

    gst-launch-1.0 videotestsrc ! video/x-raw,format=I420_10LE \
        ! x264enc ! video/x-h264,profile=constrained-baseline \
        ! fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/59>
2020-07-21 15:41:52 +02:00
Thibault Saunier
de77207bfa x264enc: Forward downstream colorimetry and chroma-site upstream
So that the value can be used by upstream converters when necessary.

This whole logic has been copied from `__gst_video_element_proxy_caps`
but those 2 fields were missing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/60>
2020-07-10 08:47:29 -04:00
Mathieu Duponchelle
bc1ab5e8e0 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:41:38 +02:00
Sebastian Dröge
dddf71b18d plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 22:44:20 -04:00
Nicolas Dufresne
15440f2ddc x264enc: Fix 'ref' property range and default
The --ref option indicate the size of the DPB, hence should be in the range of
0 to 16. This patch also fix the default to match x264enc default 3. This
change isn't a behaviour change since we don't enforce the reported default.
2020-04-02 20:26:07 +00:00
Thibault Saunier
9273903286 x264enc: Respect Youtube bitrate recommandation
Properly follow google recommendations[0] concerning bitrate when the
user wants to use the youtube profile.

[0]: https://support.google.com/youtube/answer/1722171?hl=en
2020-01-07 21:21:42 +00:00
Dmitry Shusharin
0dd89a1dd2 x264enc: fixed codestyle 2019-12-14 18:49:54 +07:00
Dmitry Shusharin
9d3b96e5f7 x264enc: corrected em_data value in CEA-708 CC SEI message (fixes #28)
Section 4.4 of CEA-708-D specification (table 2) requires all bits to be
set inside em_data field. h264parse element (and possible third-party
decoders such as libav) also follows this requirement.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/issues/28
2019-12-14 17:24:33 +07:00
Aaron Boxer
3f24460e37 documentation: fix some typos 2019-09-02 09:33:15 -04:00
Seungha Yang
f31f085e7b x264enc: Port to color_{primaries,transfer,matrix}_to_iso
... with more color value mapping
2019-07-15 17:06:23 +00:00
Thibault Saunier
2df9f6e5ce docs: Port all docstring to gtk-doc markdown 2019-04-26 20:32:26 -04:00
Mathieu Duponchelle
c4456d574f x264enc: inject CEA708 closed captions 2019-02-28 16:24:39 +01:00
Sebastian Dröge
2942f7d931 x264: Only enable dynamic loading code for x264 < 253
Otherwise we get some compiler warnings:

../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:200:1: warning: ‘unload_x264’ defined but not used [-Wunused-function]
 unload_x264 (GstX264EncVTable * vtable)
 ^~~~~~~~~~~
../subprojects/gst-plugins-ugly/ext/x264/gstx264enc.c:154:1: warning: ‘load_x264’ defined but not used [-Wunused-function]
 load_x264 (const gchar * filename)
 ^~~~~~~~~
2019-01-25 14:38:05 +02:00
Seungha Yang
7e63943361 x264enc: Avoid format decision per frame
Avoid switch/case per frame for format decision and detect the format
only if where it could be changed. Note that, whenever encoder->input_state
is changed, gst_x264_enc_init_encoder() is called.

https://bugzilla.gnome.org/show_bug.cgi?id=797164
2018-09-22 12:42:34 +01:00
Jan Alexander Steffens (heftig)
cf385f20cf x264enc: Set bit depth for x264 ≥ 153
https://bugzilla.gnome.org/show_bug.cgi?id=796975
2018-08-16 16:43:01 +03:00
Jan Alexander Steffens (heftig)
484ee3e032 x264enc: Remove superfluous x264_param_default
https://bugzilla.gnome.org/show_bug.cgi?id=796973
2018-08-16 16:42:51 +03:00
Tim-Philipp Müller
83c38dc446 x264enc: fix build with newer x264 with support for multiple bit depths
libx264 used to be built for one specific bit depth, and if we
wanted to support multiple bit depths we would have to dynamically
load the right .so from different paths. That has changed now, and
libx264 can include support for multiple depths in the same lib,
so we don't need to do the dlopen() dance any more. We'll keep
the vtable stuff around until we can drop support for older x264.

gstx264enc.c:2927:36: error: ‘x264_bit_depth’ undeclared

https://bugzilla.gnome.org/show_bug.cgi?id=792111
2018-02-28 10:07:13 +00:00
Alicia Boya García
725de9b92e x264enc: Add format example for option-string
https://bugzilla.gnome.org/show_bug.cgi?id=793879
2018-02-27 13:51:19 -05:00
Justin Kim
8100d781b7 x264enc: add 'insert-vui' property for users to choose
VUI(Video Usability Information) parameters should be set
according to the specification. However, some of the existing
hardware decoders refuse to decode in certain combinations of
the resolution and VUI parameters. To support the legacy
decoders, this patch provides 'insert-vui' to skip the settings.

https://bugzilla.gnome.org/show_bug.cgi?id=791331
2017-12-08 15:40:47 -05:00
Mark Nauwelaerts
fc826ac6dc x264enc: add FIXME note for future configuration cleanup 2017-08-09 19:31:56 +02:00
Tim-Philipp Müller
0d73cb55b1 x264enc: fix indentation 2017-07-15 15:01:09 +01:00
Tim-Philipp Müller
58a23c99e9 x264enc: fix caps leak
Move creation of supported sink pads into class_init function
which is also the only place where they're used. Unref the
caps when no longer needed, the pad template will take its
own ref.

https://bugzilla.gnome.org/show_bug.cgi?id=784982
2017-07-15 14:59:42 +01:00
Mark Nauwelaerts
7074d31cb6 x264enc: relax bframes upper limit count to maximum encoder supported 2017-06-24 17:52:09 +02:00
Víctor Manuel Jáquez Leal
c15a00537f x264: fix memory leak
When the allowed caps are the same of template caps the allowed
caps are not unrefed, leaking memory.

https://bugzilla.gnome.org/show_bug.cgi?id=784060
2017-06-21 21:26:53 +02:00
Nirbheek Chauhan
184351ae48 x264: Initialize function vtable in plugin_init()
These values are defined in the x264.h header and are not const on
Windows due to the way DLLs work. See:
https://msdn.microsoft.com/en-us/library/619w14ds.aspx
https://msdn.microsoft.com/en-us/library/zw3za17w.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=777903
2017-02-01 12:38:01 +02:00
Vivia Nikolaidou
c40b40b36f x264enc: Add information for mixed mode
https://bugzilla.gnome.org/show_bug.cgi?id=775411
2016-11-30 18:54:20 +02:00
Vivia Nikolaidou
dae49907e2 x264enc: Correctly pass interlacing/TFF information
Give the interlacing information correctly to the encoder. Also parse
TFF/BFF information from the caps and pass it too.

https://bugzilla.gnome.org/show_bug.cgi?id=775411
2016-11-30 18:54:20 +02:00
Vivia Nikolaidou
f7d82312bb x264enc: Auto-detect interlace mode from caps
If the caps are interlaced, interlacing is always enabled on the
encoder. If the interlace-mode field is missing or if it's progressive,
the encoder uses the "interlaced" property.

https://bugzilla.gnome.org/show_bug.cgi?id=775228
2016-11-28 15:22:44 +02:00
Sebastian Dröge
7bf576b238 x264enc: Add configure parameter to specify additional x264 libraries with e.g. different depth configuration
x264 has to be compiled specifically for a target bit depth.
Distributions currently ship various libraries in their packages, with
different bit depths.

This change now allows to provide them all at configure time and have
the x264enc element dynamically switch between them based on the bit
depth of the input format.

https://bugzilla.gnome.org/show_bug.cgi?id=763297
2016-11-14 18:26:04 +02:00
Sebastian Dröge
590aa41bf5 x264enc: Set colorimetry and chroma-site information
https://bugzilla.gnome.org/show_bug.cgi?id=772159
2016-09-29 12:39:56 +03:00
Vineeth TM
eacdaa56b3 ugly: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763082
2016-03-24 14:38:13 +02:00
Arjen Veenhuizen
f037e7e59e x264enc: increase bitrate limit from 100Mbps to 2Gbps
Don't artificially limit the bitrate, x264enc allows much
higher bitrates, and for intra-only 4k AVC they are needed.
x264 clips to 2Gbps internally, so use that as limit for now.

https://bugzilla.gnome.org/show_bug.cgi?id=758620
2015-11-26 15:49:47 +00:00
Reynaldo H. Verdejo Pinochet
7d7bab4640 x264enc: drop unnecessary NULL check before g_free 2015-11-18 23:20:59 -08:00
Jan Schmidt
05aa763561 x264: Add bitrate info to the tags output.
Makes it possible for muxers to know the target bitrate as soon
as encoding starts, which flvmux now uses.
2015-09-05 23:34:45 +10:00
Thiago Santos
7fef2de2d8 x264enc: actually return TRUE from accept-caps handler
The query was handled
2015-08-18 02:23:55 -03:00
Thiago Santos
ba5e19706d x264enc: implement accept-caps handling
Implement accept-caps handling without doing caps queries downstream
2015-08-16 14:27:44 -03:00
Matej Knopp
43d6ca85a0 x264enc: Use gst_video_encoder_set_min_pts
This method replace the manual adjustment of PTS and DTS to avoid
negative DTS issues. Using this method will also update the segment so
we don't loos sync.

https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-06-11 10:29:25 -04:00
Jan Schmidt
c6958c158f x264enc: Add support for stereoscopic video
Provide new frame-packing property to directly set
x264enc frame packing, or pass through upstream settings

The explicit layout from the frame-packing property is
preferred over any info from the caps.
2015-06-11 11:01:38 +10:00
Tim-Philipp Müller
c3c306b486 x264enc: don't artificially limit max allowed value of "threads" property
In auto mode it will happily chose much higher values anyway,
and a limit of 4 seems a bit low these days.
2015-05-26 17:58:18 +01:00
Tim-Philipp Müller
f034f77b73 docs: update example pipelines in element docs
Mostly gst-launch -> gst-launch-1.0, but also
use autoaudiosink/autovideosink in more places
and update pipelines a little or flesh out
descriptions.
2015-05-10 11:34:33 +01:00
Sebastian Dröge
7dc03df3de Improve and fix LATENCY query handling
This now follows the design docs everywhere, especially the maximum latency
handling.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 13:56:48 +01:00
Sebastian Dröge
5dd1a28906 x264enc: Don't set max latency to the same value as the encoder latency
The meaning of the max latency is *not* the maximum latency this element will
introduce. It is the maximum latency this element can endure without
overflowing any buffers, which is infinite for x264enc.

Fixes latency configuration in zero latency mode, where max latency was
becoming 0... which usually won't work well if something else introduces
latency as then max < min in the end, and latency configuration just fails.
2015-02-06 19:04:32 +01:00
Vincent Penquerc'h
5f075f3361 x264enc: set annexb=1 in byte stream mode when downstream has ANY caps
This matches what is done when downstream caps are not ANY, and fixes
prerolling in byte stream mode when typefind is downstream.
2015-02-02 14:28:33 +00:00
Nicolas Dufresne
acc9529a36 x264enc: Don't set an allocation maximum
There is no reason x264enc should enforce a maximum allocation size.
The maximum is normally set by buffer pool which cannot grow, but we
don't offer a buffer pool. This would lead to stall when used with
element that don't implement allocation query.

Related to: https://bugzilla.gnome.org/show_bug.cgi?id=738302
2015-01-18 11:07:43 -05:00
Tim-Philipp Müller
5872a1454e x264: fix colour inversion with YV12 format
It's the same as I420 but with the U/V planes swapped.
2014-08-05 19:47:26 +01:00
Nicolas Dufresne
8aea88d261 x264enc: Request buffers in allocation query
https://bugzilla.gnome.org/show_bug.cgi?id=732288
2014-07-25 14:29:21 -04:00
Nicolas Dufresne
698714fc97 x264enc: Shift both PTS and DTS to ensure positive timestamp
Currently we only shift DTS to compensate that we don't support negative
timestamp. This cause a problem that PTS is no longer >= DTS and may
make muxers live much harder. Instead, shift both PTS/DTS forward. Also
remove all the hack to handle this which seems the result of thinking libx264
is bugged.

https://bugzilla.gnome.org/show_bug.cgi?id=731351
2014-07-19 12:59:05 -04:00