Opened 5 weeks ago

Closed 4 weeks ago

#6774 closed enhancement (invalid)

libx264 8bit and 10bit support

Reported by: gstoyanov Owned by:
Priority: wish Component: avcodec
Version: unspecified Keywords: libx264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Currently ffmpeg doesn't support 10 bit encoding with libx264 unless it is compiled with 10bit support, but isn't it going to be much easier if you just add some separate libx264 encoders with 10 bit support, so that you can encode either in 8 bit or 10 bit. I searched on Internet and found plenty of other topics regarding this problem. Since 10 bit content will become more and more common I think it makes sense to include by default 10 bit h264 encoders to the list of supported ones. I have also checked my /usr/bin folder and found there /usr/bin/x264-10bit so by default the encoder is present upon installation of the x264 package.
How to reproduce:
For example

ffmpeg -i <input> -c:v libx264 -pix_fmt yuv420p <8bit_output>

for the normal 8 bit encoding and:

ffmpeg -i <input> -c:v libx264-10bit -pix_fmt yuv420p10le <10bit_output>

for 10 bit encoding.

ffmpeg version 3.2.4-1build2 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Ubuntu 6.3.0-8ubuntu1) 20170221

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (6)

comment:1 Changed 5 weeks ago by heleppkes

ffmpeg doesn't use the CLI encoder binary, but links to a library. You can't link to the same library twice (even if build differently), because its function names would collide.

Unless x264 offers a way to have multiple bitdepths in the same library, perhaps similar to how x265 has done it, this won't really be possible.

comment:2 Changed 5 weeks ago by gstoyanov

But x264 has a 10bit wrapper:

NAME
       x264-10bit - wrapper script for the 10-bit variant of the libx264 shared library

SYNOPSIS
       x264-10bit <prog> <arguments>

DESCRIPTION
       This is a wrapper script that sets the LD_LIBRARY_PATH variable so that the 10-bit variant of the libx264 shared library is preferred over the regular 8-bit variant. It then calls the program <prog> with the arguments <argu‐
       ments>.

Isn't it possible to use the wrapper in case of 10 bit encoding instead of the normal x264 package?

comment:3 Changed 5 weeks ago by heleppkes

You can just use the same thing with ffmpeg without a single change in ffmpeg. Set LD_LIBRARY_PATH and run ffmpeg.

comment:4 Changed 4 weeks ago by gstoyanov

I am sorry for the stupid question, but can you point out how I can do that?

comment:5 Changed 4 weeks ago by Gramner

A unified 8-bit and 10-bit libx264 is committed to the x264 development repository. It will find it's way into to normal git tree soon(tm).

comment:6 Changed 4 weeks ago by cehoyos

  • Keywords libx264 added; x264 h264 10bit 8bit removed
  • Priority changed from normal to wish
  • Resolution set to invalid
  • Status changed from new to closed
  • Version changed from 3.2.4 to unspecified

(This will definitely not be fixed in 3.2)
Currently, x264 does not allow to link against two libraries at the same time, once this is possible with x264, it will most likely be quickly supported by FFmpeg.

Note: See TracTickets for help on using tickets.