After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726376 - x265enc: Add x265 encoder element
x265enc: Add x265 encoder element
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-14 21:51 UTC by Thijs Vermeir
Modified: 2014-10-15 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add x265enc element (42.10 KB, patch)
2014-03-14 21:52 UTC, Thijs Vermeir
needs-work Details | Review
add x265enc element (44.62 KB, patch)
2014-03-18 14:14 UTC, Thijs Vermeir
none Details | Review
add x265enc element (41.32 KB, patch)
2014-10-07 15:22 UTC, Thijs Vermeir
none Details | Review

Description Thijs Vermeir 2014-03-14 21:51:57 UTC
This patch adds the x265enc element. As x265 is based on x264, the code of this element is based on x264enc.
Comment 1 Thijs Vermeir 2014-03-14 21:52:29 UTC
Created attachment 271949 [details] [review]
add x265enc element
Comment 2 Sebastian Dröge (slomo) 2014-03-16 19:08:15 UTC
Review of attachment 271949 [details] [review]:

Thanks for the patch :) Just a very short review for now

::: configure.ac
@@ +818,3 @@
   IGraphBuilder *pGraph = NULL;
   HRESULT hr = CoInitialize(NULL);
+  hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,

Please remove all these whitespace changes from the diff :)

::: ext/x265/gstx265enc.c
@@ +171,3 @@
+        "width = (int) [ 4, MAX ], " "height = (int) [ 4, MAX ], "
+        "stream-format = (string) { avc, byte-stream }, "
+        "alignment = (string) au, " "profile = (string) { main }")

The stream formats are hvc1, hev1 and byte-stream. And the caps have profile, level and tier which need to be negotiated.

@@ +487,3 @@
+gst_x265_enc_start (GstVideoEncoder * encoder)
+{
+  //GstX265Enc *x265enc = GST_X265_ENC (encoder);

No C99 comments please

::: ext/x265/gstx265enc.h
@@ +74,3 @@
+  const gchar *peer_profile;
+  gboolean peer_intra_profile;
+  /*const x265_level_t *peer_level; */

You should probably have the profile, level and tier here and negotiate them
Comment 3 Thijs Vermeir 2014-03-18 14:14:23 UTC
Created attachment 272277 [details] [review]
add x265enc element

The comments are fixed in this new patch.

* For stream format only bytestream is supported for now, as it is the basic output of the x265 implementation. What is the preferred way to implement other stream formats, (without duplicating too much from the parser). Or should this task be for the parser element?

* Basic negotiation of profile/tier/level is implemented. As tier and level is not yet configurable in x265 it just checkes if the downstream caps are acceptable.
Comment 4 Songwater 2014-06-27 00:57:42 UTC
gst-plugins-bad
Version: 	1.3.3
x265 version: default branch - 7026

when I ported to this version, the gstreamer pipeline exit with an error as follows:

libv4l2: error dequeuing buf: invalid parameter
0:00:07.790512136  6151       0xad55e0 ERROR          v4l2allocator gstv4l2allocator.c:1326:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> failed dequeuing a mmap buffer: invalid parameter
0:00:07.790559574  6151       0xad55e0 ERROR          v4l2allocator gstv4l2allocator.c:1338:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator> The buffer type is not supported, or the index is out of bounds, or no buffers have been allocated yet, or the userptr or length are invalid.
0:00:07.790596821  6151       0xad55e0 WARN                 v4l2src gstv4l2src.c:736:gst_v4l2src_create:<v4l2src0> error: Failed to allocate a buffer
Comment 5 Nicolas Dufresne (ndufresne) 2014-06-28 16:43:07 UTC
(In reply to comment #4)
> gst-plugins-bad
> Version:     1.3.3
> x265 version: default branch - 7026
> 
> when I ported to this version, the gstreamer pipeline exit with an error as
> follows:
> 
> libv4l2: error dequeuing buf: invalid parameter
> 0:00:07.790512136  6151       0xad55e0 ERROR          v4l2allocator
> gstv4l2allocator.c:1326:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator>
> failed dequeuing a mmap buffer: invalid parameter
> 0:00:07.790559574  6151       0xad55e0 ERROR          v4l2allocator
> gstv4l2allocator.c:1338:gst_v4l2_allocator_dqbuf:<v4l2src0:pool:src:allocator>
> The buffer type is not supported, or the index is out of bounds, or no buffers
> have been allocated yet, or the userptr or length are invalid.
> 0:00:07.790596821  6151       0xad55e0 WARN                 v4l2src
> gstv4l2src.c:736:gst_v4l2src_create:<v4l2src0> error: Failed to allocate a
> buffer

This looks unrelated, check if this is the same as, bug #732288, otherwise create a bug. Meanwhile, use videotestsrc for your tests.
Comment 6 Thijs Vermeir 2014-10-07 15:22:18 UTC
Created attachment 287971 [details] [review]
add x265enc element

Fixed a few bugs related to different behaviour in newer x265 releases.
Comment 7 Thijs Vermeir 2014-10-15 15:19:42 UTC
Commit: f241294662f3b48c10e527e9949aa2449e51739a
Author: Thijs Vermeir <thijsvermeir@gmail.com>
Date:   Wed Mar  5 16:39:30 2014 +0100

x265enc: add x265 encoder element