Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed fontconfig from MEncoder for Mac OSX for improved subs

compatibility.
  • Loading branch information...
commit 24c9f5886d271c6c8791f39e2954f5e137fd8030 1 parent 0574c0a
@Raptor399 Raptor399 authored
View
1  CHANGELOG
@@ -12,6 +12,7 @@ Changelog:
Changed audio/subtitle defaults to accept anything
Fixed possible error while loading iPhoto library (#1523)
Fixed bug where disabled engines would be picked
+ Removed fontconfig from MEncoder for Mac OSX for improved subs compatibility
1.70.1 - 2012-08-31
View
9 contrib/binaries-deps-versions
@@ -14,14 +14,17 @@ VERSION_ENCA=1.13
VERSION_EXPAT=2.1.0
VERSION_FAAD2=2.7
VERSION_FLAC=1.2.1
-VERSION_FONTCONFIG=2.8.0
+VERSION_FONTCONFIG=2.10.1
VERSION_FFMPEG=n0.11.1
VERSION_FREETYPE=2.4.10
VERSION_FRIBIDI=0.19.2
VERSION_GIFLIB=4.1.6
+VERSION_HARFBUZZ=0.9.4
VERSION_ICONV=1.13.1
VERSION_JPEG=8d
VERSION_LAME=3.99.5
+# Automatically checking out latest stable version
+#VERSION_LIBASS=0.10.0
VERSION_LIBBLURAY=0.2.2
VERSION_LIBDCA=0.0.5
VERSION_LIBDV=1.0.0
@@ -35,9 +38,9 @@ VERSION_LIBZEN=0.4.26
VERSION_LZO=2.06
VERSION_MPLAYER=35003
VERSION_NCURSES=5.9
-VERSION_PS3MEDIASERVER=release-1.54.0
+VERSION_PS3MEDIASERVER=release-1.70.1
VERSION_TSMUXER=1.10.6
-# compile latest stable x264
+# Automatically checking out latest stable version
#VERSION_X264=r2200
VERSION_XVID=1.3.2
VERSION_ZLIB=1.2.7
View
188 contrib/build-pms-binaries.sh
@@ -2,8 +2,8 @@
#
# build-pms-osx.sh
#
-# Version: 2.2.0
-# Last updated: 2012-07-08
+# Version: 2.2.1
+# Last updated: 2012-09-30
# Authors: Patrick Atoon, Happy-Neko
#
#
@@ -527,7 +527,7 @@ set_flags() {
if is_osx; then
# Minimum OSX version as target
- OSX_VERSION=10.6
+ OSX_VERSION=10.7
if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ]; then
# Xcode 4.3+
@@ -758,6 +758,7 @@ build_ffmpeg() {
./configure --enable-gpl --enable-version3 --enable-nonfree --disable-doc --disable-debug \
--enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libfreetype \
--cc=$GCC2 --disable-vda \
+ --disable-libass --disable-fontconfig \
--disable-devices --disable-ffplay --disable-ffserver --disable-ffprobe \
--disable-shared --enable-static --prefix=$TARGET
else
@@ -786,42 +787,45 @@ build_ffmpeg() {
# http://flac.sourceforge.net/
#
build_flac() {
- start_build flac
- cd $BUILD
+ # Skipping flac build on Linux
+ if is_osx; then
+ start_build flac
+ cd $BUILD
- if [ ! -d flac-$VERSION_FLAC ]; then
- $TAR zxf $SRC/flac-$VERSION_FLAC.tar.gz
- exit_on_error
- fi
+ if [ ! -d flac-$VERSION_FLAC ]; then
+ $TAR zxf $SRC/flac-$VERSION_FLAC.tar.gz
+ exit_on_error
+ fi
- cd flac-$VERSION_FLAC
- set_flags
+ cd flac-$VERSION_FLAC
+ set_flags
- if is_osx; then
- if [ "$ARCHITECTURE" == "x86_64" ]; then
- ./configure --disable-shared --disable-dependency-tracking --host=x86-apple-darwin10 --prefix=$TARGET
+ if is_osx; then
+ if [ "$ARCHITECTURE" == "x86_64" ]; then
+ ./configure --disable-shared --disable-dependency-tracking --host=x86-apple-darwin10 --prefix=$TARGET
+ else
+ ./configure --disable-shared --disable-dependency-tracking --disable-asm-optimizations --prefix=$TARGET
+ fi
else
- ./configure --disable-shared --disable-dependency-tracking --disable-asm-optimizations --prefix=$TARGET
- fi
- else
- $SED --in-place 's/#include <stdlib.h>/#include <stdlib.h>\n#include <cstring>/g' ./examples/cpp/encode/file/main.cpp
- $SED --in-place 's/#include <stdlib.h>/#include <stdlib.h>\n#include <cstring>/g' ./examples/cpp/decode/file/main.cpp
+ $SED --in-place 's/#include <stdlib.h>/#include <stdlib.h>\n#include <cstring>/g' ./examples/cpp/encode/file/main.cpp
+ $SED --in-place 's/#include <stdlib.h>/#include <stdlib.h>\n#include <cstring>/g' ./examples/cpp/decode/file/main.cpp
- ./configure --disable-shared --enable-static --disable-dependency-tracking --prefix=$TARGET
- fi
+ ./configure --disable-shared --enable-static --disable-dependency-tracking --prefix=$TARGET
+ fi
- $MAKE -j$THREADS
- exit_on_error
+ $MAKE -j$THREADS
+ exit_on_error
- if is_linux; then
- # compile statically linked flac binary
- cd src/flac
- $GCC -static -Wl,--strip-all -I$TARGET/include -O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS $LDFLAGS -o flac analyze.o decode.o encode.o foreign_metadata.o main.o local_string_utils.o utils.o vorbiscomment.o -L$TARGET/lib ../../src/share/grabbag/.libs/libgrabbag.a ../../src/share/getopt/libgetopt.a ../../src/share/replaygain_analysis/.libs/libreplaygain_analysis.a ../../src/share/replaygain_synthesis/.libs/libreplaygain_synthesis.a ../../src/shar$SRClibs/libutf8.a ../../src/libFLAC/.libs/libFLAC.a -L$TARGET/lib $TARGET/lib/libogg.a $TARGET/lib/libiconv.a -lm
- exit_on_error
- cd ../..
+ if is_linux; then
+ # compile statically linked flac binary
+ cd src/flac
+ $GCC -static -Wl,--strip-all -I$TARGET/include -O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS $LDFLAGS -o flac analyze.o decode.o encode.o foreign_metadata.o main.o local_string_utils.o utils.o vorbiscomment.o -L$TARGET/lib ../../src/share/grabbag/.libs/libgrabbag.a ../../src/share/getopt/libgetopt.a ../../src/share/replaygain_analysis/.libs/libreplaygain_analysis.a ../../src/share/replaygain_synthesis/.libs/libreplaygain_synthesis.a ../../src/shar$SRClibs/libutf8.a ../../src/libFLAC/.libs/libFLAC.a -L$TARGET/lib $TARGET/lib/libogg.a $TARGET/lib/libiconv.a -lm
+ exit_on_error
+ cd ../..
+ fi
+ $MAKE install
+ cd $WORKDIR
fi
- $MAKE install
- cd $WORKDIR
}
@@ -830,38 +834,43 @@ build_flac() {
# http://fontconfig.org/wiki/
#
build_fontconfig() {
- start_build fontconfig
- cd $BUILD
+ # Fontconfig builds fine on Mac OSX, but it fails to actually find any fonts.
+ # Disabling it gives better results for now
+ if is_linux; then
+ start_build fontconfig
- if [ ! -d fontconfig-$VERSION_FONTCONFIG ]; then
- $TAR zxf $SRC/fontconfig-$VERSION_FONTCONFIG.tar.gz
- exit_on_error
- fi
+ cd $BUILD
- cd fontconfig-$VERSION_FONTCONFIG
- set_flags
- if is_linux; then
- ./configure --sysconfdir=/etc --localstatedir=/var --enable-static --disable-shared --disable-dependency-tracking --prefix=$TARGET
- else
- ./configure --with-confdir=./fonts --enable-static --disable-shared --disable-dependency-tracking --prefix=$TARGET
- fi
- $MAKE -j$THREADS
- exit_on_error
+ if [ ! -d fontconfig-$VERSION_FONTCONFIG ]; then
+ $TAR zxf $SRC/fontconfig-$VERSION_FONTCONFIG.tar.gz
+ exit_on_error
+ fi
- if is_linux; then
- $MAKE install-exec && $MAKE install-pkgconfigDATA
+ cd fontconfig-$VERSION_FONTCONFIG
+ set_flags
+ if is_linux; then
+ ./configure --sysconfdir=/etc --localstatedir=/var --enable-static --disable-shared --disable-dependency-tracking --prefix=$TARGET
+ else
+ ./configure --with-configdir=./fonts --enable-static --disable-shared --disable-dependency-tracking --prefix=$TARGET
+ fi
+ $MAKE -j$THREADS
+ exit_on_error
+
+ if is_linux; then
+ $MAKE install-exec && $MAKE install-pkgconfigDATA
+ exit_on_error
+ # copy fontconfig headers
+ mkdir -p $TARGET/include/fontconfig
+ cp -f ./fontconfig/*.h $TARGET/include/fontconfig/
+ # freetype depends on bzip2
+ $SED -i -e "s/^Libs\.private.*$/Libs.private: -lexpat -lfreetype -lz -liconv -lbz2/" $TARGET/lib/pkgconfig/fontconfig.pc
+ else
+ $MAKE install
+ fi
exit_on_error
- # copy fontconfig headers
- mkdir -p $TARGET/include/fontconfig
- cp -f ./fontconfig/*.h $TARGET/include/fontconfig/
- # freetype depends on bzip2
- $SED -i -e "s/^Libs\.private.*$/Libs.private: -lexpat -lfreetype -lz -liconv -lbz2/" $TARGET/lib/pkgconfig/fontconfig.pc
- else
- $MAKE install
- fi
- exit_on_error
- cd $WORKDIR
+ cd $WORKDIR
+ fi
}
@@ -914,24 +923,55 @@ build_fribidi() {
##########################################
-# libass
+# HARFBUZZ
+# http://www.freedesktop.org/wiki/Software/HarfBuzz
+#
+build_harfbuzz() {
+ # harfbuzz fails to build on OSX, skipping it
+ if is_linux; then
+ start_build harfbuzz
+
+ cd $BUILD
+ cp -af $SRC/harfbuzz ./
+ exit_on_error
+ cd harfbuzz
+ exit_on_error
+
+ set_flags
+
+ ./autogen.sh --disable-shared --enable-static --disable-dependency-tracking --prefix=$TARGET
+ $MAKE -j$THREADS
+ exit_on_error
+ $MAKE install
+ cd $WORKDIR
+ fi
+}
+
+
+##########################################
+# LIBASS
# http://code.google.com/p/libass/
#
build_libass() {
- start_build libass
- cd $BUILD
- cp -af $SRC/libass ./
- exit_on_error
- cd libass
- exit_on_error
+ # libass fails to build on OSX, skipping it
+ if is_linux; then
+ start_build libass
- set_flags
+ cd $BUILD
+ cp -af $SRC/libass ./
+ exit_on_error
+ cd libass
+ exit_on_error
- ./autogen.sh --disable-shared --enable-static --disable-dependency-tracking --disable-harfbuzz --prefix=$TARGET
- $MAKE -j$THREADS
- exit_on_error
- $MAKE install
- cd $WORKDIR
+ set_flags
+
+ # see: http://code.google.com/p/libass/issues/detail?id=69
+ ./autogen.sh --disable-shared --enable-static --disable-dependency-tracking --prefix=$TARGET
+ $MAKE -j$THREADS
+ exit_on_error
+ $MAKE install
+ cd $WORKDIR
+ fi
}
@@ -1357,6 +1397,7 @@ build_mplayer() {
# Theora and vorbis support seems broken in this revision, disable it for now
./configure --cc=$GCC2 --disable-x11 --disable-gl --disable-qtx \
+ --disable-fontconfig \
--with-freetype-config=$TARGET/bin/freetype-config --prefix=$TARGET
# Somehow -I/usr/X11/include still made it into the config.mak, regardless of the --disable-x11
@@ -1679,6 +1720,7 @@ build_fontconfig
build_fribidi
build_enca
build_giflib
+build_harfbuzz
build_jpeg
build_libpng
build_libass
@@ -1699,9 +1741,7 @@ build_x264
build_xvid
# Build tools for including with PS3 Media Server
-if is_osx; then
- build_flac
-fi
+build_flac
build_dcraw
build_tsmuxer
build_ffmpeg
View
51 contrib/download-pms-binaries-source.sh
@@ -2,7 +2,7 @@
#
# download-pms-binaries-source.sh
#
-# Version: 1.0
+# Version: 1.1
# Last updated: 2012-01-26
# Authors: Happy-Neko
# Based on build-pms-binaries.sh by Patrick Atoon and Happy-Neko
@@ -280,6 +280,7 @@ download_ffmpeg() {
$GIT checkout ${VERSION_FFMPEG}
exit_on_error
fi
+
rm -rf ./.git
}
@@ -360,6 +361,30 @@ download_giflib() {
##########################################
+# HARFBUZZ
+# http://www.freedesktop.org/wiki/Software/HarfBuzz
+#
+download_harfbuzz() {
+ start_download harfbuzz
+ cd $SRC
+
+ if [ -d harfbuzz ]; then
+ rm -rf harfbuzz
+ fi
+ $GIT clone git://anongit.freedesktop.org/harfbuzz harfbuzz
+ exit_on_error
+ cd harfbuzz
+
+ if [ "$FIXED_REVISIONS" == "yes" ]; then
+ $GIT checkout ${VERSION_HARFBUZZ}
+ exit_on_error
+ fi
+
+ rm -rf ./.git
+}
+
+
+##########################################
# ICONV
# http://www.gnu.org/software/libiconv/
#
@@ -425,6 +450,7 @@ download_libbluray() {
$GIT checkout ${VERSION_LIBBLURAY}
exit_on_error
fi
+
rm -rf ./.git
}
@@ -499,8 +525,8 @@ download_libpng() {
if [ ! -f libpng-${VERSION_LIBPNG}.tar.gz ]; then
# One of these two, depending on whether we use the latest release
- #download http://downloads.sourceforge.net/project/libpng/libpng15/older-releases/${VERSION_LIBPNG}/libpng-${VERSION_LIBPNG}.tar.gz
- download http://downloads.sourceforge.net/project/libpng/libpng15/${VERSION_LIBPNG}/libpng-${VERSION_LIBPNG}.tar.gz
+ download http://downloads.sourceforge.net/project/libpng/libpng15/older-releases/${VERSION_LIBPNG}/libpng-${VERSION_LIBPNG}.tar.gz
+ #download http://downloads.sourceforge.net/project/libpng/libpng15/${VERSION_LIBPNG}/libpng-${VERSION_LIBPNG}.tar.gz
exit_on_error
fi
}
@@ -633,16 +659,18 @@ download_x264() {
exit_on_error
cd x264
+ # Automatically checking out the latest stable version
#if [ "$FIXED_REVISIONS" == "yes" ]; then
# $GIT checkout ${VERSION_X264}
# exit_on_error
#fi
+
rm -rf ./.git
}
##########################################
-# libass
+# LIBASS
# http://code.google.com/p/libass/
#
download_libass() {
@@ -652,9 +680,17 @@ download_libass() {
if [ -d libass ]; then
rm -rf libass
fi
- $GIT clone https://code.google.com/p/libass/
+
+ $GIT clone https://code.google.com/p/libass/ -b stable
exit_on_error
cd libass
+
+ # Automatically checking out the latest stable version
+ #if [ "$FIXED_REVISIONS" == "yes" ]; then
+ # $GIT checkout ${VERSION_LIBASS}
+ # exit_on_error
+ #fi
+
rm -rf ./.git
}
@@ -784,10 +820,10 @@ download_expat
download_faad2
download_freetype
download_iconv
-# Note: fontconfig requires freetype and iconv to build
download_fontconfig
download_fribidi
download_giflib
+ownload_harfbuzz
download_jpeg
download_ncurses
download_lame
@@ -796,7 +832,6 @@ download_libdca
download_libdv
download_libmad
download_libzen
-# Note: libmediainfo requires libzen to build
download_libmediainfo
download_libpng
download_libogg
@@ -806,7 +841,7 @@ download_lzo
download_x264
download_xvid
-# Build tools for including with PS3 Media Server
+# Tools for including with PS3 Media Server
download_flac
download_dcraw
download_enca
View
19 src/main/java/net/pms/encoders/MEncoderVideo.java
@@ -1595,6 +1595,7 @@ public ProcessWrapper launchTranscode(
boolean override_ass_style = !configuration.isMencoderAssDefaultStyle() ||
params.sid.getType() == SubtitleType.SUBRIP ||
params.sid.getType() == SubtitleType.TX3G;
+
if (override_ass_style) {
String assSubColor = "ffffff00";
if (configuration.getSubsColor() != 0) {
@@ -1649,6 +1650,16 @@ public ProcessWrapper launchTranscode(
sb.append("-ass-force-style MarginV=").append(subtitleMargin).append(" ");
}
+ // MEncoder is not compiled with fontconfig on Mac OSX, therefore
+ // use of the "-ass" option also requires the "-font" option.
+ if (Platform.isMac() && sb.toString().indexOf(" -font ") < 0) {
+ String font = CodecUtil.getDefaultFontPath();
+
+ if (isNotBlank(font)) {
+ sb.append("-font ").append(font).append(" ");
+ }
+ }
+
// Workaround for MPlayer #2041, remove when that bug is fixed
if (!params.sid.isEmbedded()) {
sb.append("-noflip-hebrew ");
@@ -1687,9 +1698,13 @@ public ProcessWrapper launchTranscode(
}
// Common subtitle options
- // Use fontconfig if enabled
- sb.append("-").append(configuration.isMencoderFontConfig() ? "" : "no").append("fontconfig ");
+ // MEncoder on Mac OSX is compiled without fontconfig support.
+ // Appending the flag will break execution, so skip it on Mac OSX.
+ if (!Platform.isMac()) {
+ // Use fontconfig if enabled
+ sb.append("-").append(configuration.isMencoderFontConfig() ? "" : "no").append("fontconfig ");
+ }
// Apply DVD/VOBSUB subtitle quality
if (params.sid.getType() == SubtitleType.VOBSUB && configuration.getMencoderVobsubSubtitleQuality() != null) {
String subtitleQuality = configuration.getMencoderVobsubSubtitleQuality();
Please sign in to comment.
Something went wrong with that request. Please try again.