Skip to contentSkip to conversation

x264: new package

PATCH Superseded David du Colombier 2 participants 4 messages Oct 1, 2014 – Oct 2, 2014

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 x264: new package

This package is based on an earlier package
proposed by Ayaka in December 2013.

---
 package/Config.in      |  1 +
 package/x264/Config.in |  9 +++++++++
 package/x264/x264.mk   | 42 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 package/x264/Config.in
 create mode 100644 package/x264/x264.mk
package/Config.in +1 -0
index 2ad72bc..33616e1 100644
@@ -33,6 +33,7 @@ menu "Audio and video applications"
 	source "package/vlc/Config.in"
 	source "package/vorbis-tools/Config.in"
 	source "package/wavpack/Config.in"
+	source "package/x264/Config.in"
 	source "package/xbmc/Config.in"
 	source "package/yavta/Config.in"
 endmenu
package/x264/Config.in new file +9 -0
new file mode 100644
index 0000000..6ad2495
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_X264
+	bool "x264"
+	help
+	  x264 is a free software library and application for
+	  encoding video streams into the H.264/MPEG-4 AVC
+	  compression format, and is released under the terms
+	  of the GNU GPL.
+
+	  https://www.videolan.org/developers/x264.html
package/x264/x264.mk new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
1.9.3
#1 lore raw

PATCH 5/5 ffmpeg: enable x264 support

---
 package/ffmpeg/ffmpeg.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/ffmpeg/ffmpeg.mk +7 -0
index b4b2e56..c7bff62 100644
@@ -229,6 +229,13 @@ else
 FFMPEG_CONF_OPT += --disable-libvpx
 endif
 
+ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
+FFMPEG_CONF_OPT += --enable-libx264
+FFMPEG_DEPENDENCIES += x264
+else
+FFMPEG_CONF_OPT += --disable-libx264
+endif
+
 ifeq ($(BR2_X86_CPU_HAS_MMX),y)
 FFMPEG_CONF_OPT += --enable-yasm
 FFMPEG_DEPENDENCIES += host-yasm
Signature · 1 line
1.9.3
#2 lore raw

PATCH 4/5 x264: new package

In reply to David du Colombier

Dear David du Colombier,

Quoted 2 lines · David du Colombier

This package is based on an earlier package
proposed by Ayaka in December 2013.

Thanks for reviving this patch, definitely appreciated!

One question: we received only PATCH 4/5 and PATCH 5/5 from your series. Is this normal? Maybe it's just a small mistake on your side when generating the patches.

Some comments below.

package/Config.in menu "Audio and video applications" · line 36

Quoted 9 lines
package/Config.in +1 -0
index 2ad72bc..33616e1 100644
@@ -33,6 +33,7 @@ menu "Audio and video applications"
 	source "package/vlc/Config.in"
 	source "package/vorbis-tools/Config.in"
 	source "package/wavpack/Config.in"
+	source "package/x264/Config.in"

I'd x264 is mostly a library, so I'd prefer to see it in the libraries.

Quoted 6 lines
package/x264/x264.mk new file +0 -0
new file mode 100644
index 0000000..dff2313

package/x264/x264.mk line 10

Quoted 10 lines
package/x264/x264.mk new file +10 -0
@@ -0,0 +1,42 @@
+###############################################################
+#
+# x264
+#
+###############################################################
+
+X264_VERSION = 20140930-2245-stable
+X264_SOURCE = x264-snapshot-$(X264_VERSION).tar.bz2
+X264_SITE= ftp://ftp.videolan.org/pub/videolan/x264/snapshots
+X264_LICENSE = GPL

The license is actually GPLv2+.

package/x264/x264.mk line 13

Quoted 3 lines
package/x264/x264.mk new file +3 -0
+X264_LICENSE_FILES = COPYING
+X264_INSTALL_STAGING = YES
+X264_INSTALL_TARGET = YES

Line not needed.

package/x264/x264.mk line 15

Quoted 2 lines
package/x264/x264.mk new file +2 -0
+X264_DEPENDENCIES = host-pkgconf
+

Might be worth adding a comment right before X264_CONFIGURE_CMDS to indicate that the configure script is not generated by autoconf.

package/x264/x264.mk line 24

Quoted 9 lines
package/x264/x264.mk new file +9 -0
+define X264_CONFIGURE_CMDS
+	(cd $(@D);./configure \
+		--prefix=/usr \
+		--host="$(GNU_TARGET_NAME)" \
+		--cross-prefix="$(TARGET_CROSS)" \
+		--enable-static \
+		--enable-strip \
+		--enable-pic \
+		--enable-shared \

--enable-shared will not work for static only builds. Maybe you should try something such as:

X264_CONF_OPTS = --enable-static

ifeq ($(BR2_PREFER_STATIC_LIB),)
X264_CONF_OPTS = --enable-pic --enable-shared
endif

and then use $(X264_CONF_OPTS) when calling the configure script.

If you want to try a purely static configuration, you can try with the basic configuration at
http://autobuild.buildroot.org/toolchains/configs/bfin-uclinux.config.

package/x264/x264.mk line 31

Quoted 7 lines
package/x264/x264.mk new file +7 -0
+		--disable-ffms \
+		--disable-cli \
+	)
+endef
+
+define X264_BUILD_CMDS
+	$(MAKE) CC="$(TARGET_CC)" -C $(@D)

Could you try:

	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)

?

CC="$(TARGET_CC)" as well as many other useful variables are passed in $(TARGET_CONFIGURE_OPTS). It's also a good habit to pass $(TARGET_MAKE_ENV) in the environment.

package/x264/x264.mk line 35

Quoted 4 lines
package/x264/x264.mk new file +4 -0
+endef
+
+define X264_INSTALL_STAGING_CMDS
+	$(MAKE) DESTDIR="$(STAGING_DIR)" -C $(@D) install

Also pass $(TARGET_MAKE_ENV).

package/x264/x264.mk line 39

Quoted 4 lines
package/x264/x264.mk new file +4 -0
+endef
+
+define X264_INSTALL_TARGET_CMDS
+	$(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install

Ditto.

package/x264/x264.mk line 42

Quoted 3 lines
package/x264/x264.mk new file +3 -0
+endef
+
+$(eval $(generic-package))

Could you respin after fixing those minor issues?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 4/5 x264: new package

Thanks for the review, Thomas.

Quoted 3 lines

One question: we received only PATCH 4/5 and PATCH 5/5 from your series. Is this normal? Maybe it's just a small mistake on your side when generating the patches.

Yes, there are only two patches.

Quoted 11 lines

package/Config.in menu "Audio and video applications" · line 36

Quoted 9 lines
package/Config.in +1 -0
index 2ad72bc..33616e1 100644
@@ -33,6 +33,7 @@ menu "Audio and video applications"
      source "package/vlc/Config.in"
      source "package/vorbis-tools/Config.in"
      source "package/wavpack/Config.in"
+     source "package/x264/Config.in"

I'd x264 is mostly a library, so I'd prefer to see it in the libraries.

Done.

Quoted 10 lines
Quoted 10 lines
package/x264/x264.mk new file +4 -0
new file mode 100644
index 0000000..dff2313
@@ -0,0 +1,42 @@
+###############################################################
+#
+# x264
+#
Quoted 8 lines

package/x264/x264.mk line 10

Quoted 6 lines
package/x264/x264.mk new file +6 -0
+###############################################################
+
+X264_VERSION = 20140930-2245-stable
+X264_SOURCE = x264-snapshot-$(X264_VERSION).tar.bz2
+X264_SITE= ftp://ftp.videolan.org/pub/videolan/x264/snapshots
+X264_LICENSE = GPL

The license is actually GPLv2+.

Done.

Quoted 5 lines

package/x264/x264.mk line 13

Quoted 3 lines
package/x264/x264.mk new file +3 -0
+X264_LICENSE_FILES = COPYING
+X264_INSTALL_STAGING = YES
+X264_INSTALL_TARGET = YES

Line not needed.

Done.

Quoted 5 lines

package/x264/x264.mk line 15

Quoted 2 lines
package/x264/x264.mk new file +2 -0
+X264_DEPENDENCIES = host-pkgconf
+

Might be worth adding a comment right before X264_CONFIGURE_CMDS to indicate that the configure script is not generated by autoconf.

Done.

Quoted 13 lines

package/x264/x264.mk line 24

Quoted 9 lines
package/x264/x264.mk new file +9 -0
+define X264_CONFIGURE_CMDS
+     (cd $(@D);./configure \
+             --prefix=/usr \
+             --host="$(GNU_TARGET_NAME)" \
+             --cross-prefix="$(TARGET_CROSS)" \
+             --enable-static \
+             --enable-strip \
+             --enable-pic \
+             --enable-shared \

--enable-shared will not work for static only builds. Maybe you should try something such as:

Quoted 7 lines

X264_CONF_OPTS = --enable-static

ifeq ($(BR2_PREFER_STATIC_LIB),)
X264_CONF_OPTS = --enable-pic --enable-shared
endif

and then use $(X264_CONF_OPTS) when calling the configure script.

Done. I've let --enable-static as is to always build the static library.

Quoted 10 lines

package/x264/x264.mk line 31

Quoted 7 lines
package/x264/x264.mk new file +7 -0
+             --disable-ffms \
+             --disable-cli \
+     )
+endef
+
+define X264_BUILD_CMDS
+     $(MAKE) CC="$(TARGET_CC)" -C $(@D)

Could you try:

Quoted 3 lines
        $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)

?

I've chosen to put TARGET_CONFIGURE_OPTS before ./configure instead, so it will not override the variables defined in config.mak.

Quoted 10 lines

CC="$(TARGET_CC)" as well as many other useful variables are passed in $(TARGET_CONFIGURE_OPTS). It's also a good habit to pass $(TARGET_MAKE_ENV) in the environment.

package/x264/x264.mk line 35

Quoted 4 lines
package/x264/x264.mk new file +4 -0
+endef
+
+define X264_INSTALL_STAGING_CMDS
+     $(MAKE) DESTDIR="$(STAGING_DIR)" -C $(@D) install

Also pass $(TARGET_MAKE_ENV).

Done.

Quoted 6 lines

package/x264/x264.mk line 39

Quoted 4 lines
package/x264/x264.mk new file +4 -0
+endef
+
+define X264_INSTALL_TARGET_CMDS
+     $(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install

Ditto.

Done.

Quoted 5 lines

package/x264/x264.mk line 42

Quoted 3 lines
package/x264/x264.mk new file +3 -0
+endef
+
+$(eval $(generic-package))

Could you respin after fixing those minor issues?

I'll send the updated patch.

Signature · 1 line
David du Colombier