The last one I posted had some problems, fixed those and the remaining issues in this version. It should be fully functional now with everything that's required by PS3 Media Server.

I'm going to add it to the repository and use it for the next official OS X build. All credits to Raptor339 for doing the hard part .

- Added mencoder_mt- Fixed x264, theora and vorbis- Updated mplayer revision, had some issues with the previous one- Added more libs to ffmpeg and mplayer since we have them anyway- Added thread option (will considerably speedup the compile time on multicore systems)- Several small fixes and general cleanup

#!/bin/sh## build-pms-osx.sh## Version: 1.6# Last updated: 2011-05-01# Author: Patrick Atoon### DESCRIPTION## Building a statically linked PS3 Media Server for OSX is not an easy# task and requires advanced knowledge of building the libraries and# tools involved.## This script will take care of building all that is required to build# a statically linked PS3 Media Server for OSX.# It will attempt to build universal binaries (for Intel and PCC) where# possible. However, some libraries do not support this and the script# will compile for the current architecture.## The script will compile the PS3 Media Server disk image file:## pms-macosx-x.xx.x.dmg## This script is provided as is. If it works for you, good! If it does# not, try to figure out why and share your findings on the PS3 Media# Server forums (http://www.ps3mediaserver.org/forum/)### REQUIREMENTS## Some Developer tools need to be installed manually. The script detects# this and provides help. Other sources will be downloaded automatically.### ACKNOWLEDGEMENTS## Many thanks to the PS3 Media Server developers and forum moderators# for keeping the project alive and the info coming. Special thanks to# Adrian Stutz for sharing his findings of how to build a statically# linked MPlayerOSX (http://www.mplayerosx.ch/), without his hard work# this script would not have been possible. Also thanks to Redlum for # his assistance in getting this script production ready.### TODO## - Clean up dependencies that are not needed for PMS# - Add PPC and universal build (with lipo)### COPYRIGHT## This script is distributed under the Creative Commons Attribution 3.0# (CC BY) license. This means you are free to copy, distribute, transmit# and adapt it to suit your needs, as long as you mention the original# author in your work.# For more details, see http://creativecommons.org/licenses/by/3.0/### CONFIGURATION## Set FIXED_REVISIONS to "no" to check out the latest revisions.# Default is "yes" to check out the last known working revision.FIXED_REVISIONS="yes"## Set TARGET_ARCHITECTURE for building binaries. Choose one of the# following:# native: build for your own computer# i386: build for Intel 386# ppc: build for PowerPC# universal: build for both Intel 386 and PowerPC (not functional yet)#TARGET_ARCHITECTURE="i386"## Set the amount of threads that are used for compiling everything. This # should generally be the same as the amount of CPU cores in your computer# (look for Total Number Of Cores in System Profiler if you don't know it).THREADS="2"

########################################### It should not be necessary to change anything below this line

########################################### Check for yasm#check_yasm() { if [ ! -x $YASM ]; then cat << EOMIt seems you are missing "yasm", which is required to run this script.Please run the following commands to install "yasm":

if [ "$?" == "1" ]; then cat << EOMIt seems you are missing "jarbundler", which is required to run this script.Please go to http://www.informagen.com/JarBundler/ , download the jarbundlerand install it.EOM exit; fi}

I was working to improve the script some more, when I discovered a bug: MPlayer was not compiling correct.The result was that the regular binaries as currently shipped with PMS were used, not the compiled ones!This can easily be verified; mencoder reports to be revision 29241, whereas the script ought to build revision 33342.

I fixed the compilation bug for MPlayer, but that only revealed a much bigger bug. Revision 33342 of mencoder makes videos play with horribly distorted sound! When viewing a regular Quicktime movie, the audio starts seconds later, sounds robotic and runs about 3x as slow as it should.

Using the old revision 29214 is impossible, it refuses to build. I have tried a couple of random revisions of MPlayer including the newest one, but either they don't build or they have the same distorted sound.

Below is an improved version of the script.Changes:

- Added visual cue to be able to follow the build process better- When important things fail, the script now stops- Fixed git pull for existing files- Fixed version.sh for ffmpeg to give the real version instead of UNKNOWN- Fixed MPlayer build error by also disabling theora and vorbis for ffmpeg.- Building now fully works for architecture "x86_64".- Dropped the TODO to build universal binaries, focussing instead on facilitating simple single architecture builds. - The resulting .dmg file now contains the name of the architecture it was built for.

#!/bin/sh## build-pms-osx.sh## Version: 1.7# Last updated: 2011-05-08# Author: Patrick Atoon### DESCRIPTION## Building a statically linked PS3 Media Server for OSX is not an easy# task and requires advanced knowledge of building the libraries and# tools involved.## This script will take care of building all that is required to build# a statically linked PS3 Media Server for a specific architecture on OSX.## The script will compile the PS3 Media Server disk image file:## pms-macosx-xxxx-x.xx.x.dmg## This script is provided as is. If it works for you, good! If it does# not, try to figure out why and share your findings on the PS3 Media# Server forums (http://www.ps3mediaserver.org/forum/).### REQUIREMENTS## Some Developer tools need to be installed manually. The script detects# this and provides help. Other sources will be downloaded automatically.### ACKNOWLEDGEMENTS## Many thanks to the PS3 Media Server developers and forum moderators# for keeping the project alive and the info coming. Special thanks to# Adrian Stutz for sharing his findings of how to build a statically# linked MPlayerOSX (http://www.mplayerosx.ch/), without his hard work# this script would not have been possible. Also thanks to Redlum for# his assistance in getting this script production ready.### TODO## - Clean up dependencies that are not needed for PMS### KNOWN BUGS## - mencoder gives delayed and distorted sound# - The finale PMS .dmg contains the shipped binary dcrawU, not the compiled dcraw### COPYRIGHT## This script is distributed under the Creative Commons Attribution 3.0# (CC BY) license. This means you are free to copy, distribute, transmit# and adapt it to suit your needs, as long as you mention the original# author in your work.# For more details, see http://creativecommons.org/licenses/by/3.0/### CONFIGURATION## Set FIXED_REVISIONS to "no" to check out the latest revisions.# Default is "yes" to check out the last known working revision.FIXED_REVISIONS="yes"

# Set TARGET_ARCHITECTURE for building binaries. Choose one of the following:## native: build for your own computer# x86_64: build for 64 bits Intel x86# i386: build for Intel 386# ppc: build for PowerPC#TARGET_ARCHITECTURE="native"

# Set the amount of threads that are used for compiling everything. This# should generally be the same as the amount of CPU cores in your computer# (look for Total Number Of Cores in System Profiler if you don't know it).THREADS="2"

########################################### It should not be necessary to change anything below this line

########################################### Check for yasm#check_yasm() { if [ ! -x $YASM ]; then cat << EOMIt seems you are missing "yasm", which is required to run this script.Please run the following commands to install "yasm":

if [ "$?" == "1" ]; then cat << EOMIt seems you are missing "jarbundler", which is required to run this script.Please go to http://www.informagen.com/JarBundler/ , download the jarbundlerand install it.EOM exit; fi}

Raptor399 wrote:I fixed the compilation bug for MPlayer, but that only revealed a much bigger bug. Revision 33342 of mencoder makes videos play with horribly distorted sound! When viewing a regular Quicktime movie, the audio starts seconds later, sounds robotic and runs about 3x as slow as it should.

Yeah, I noticed this as well after further testing. I think we should try revision 32674 again, the problems I had with it should be fixed by disabling theora.

Improved the script a bit to cope with the newest versions of dependencies out there:

- Errors now stop the script on all error codes- Removing dynamic libraries that are being generated- Newer x264 requires "make install-lib-static" to install the library- Fixed the "git" replacement in version.sh for FFmpeg so it also works multiple times- Building latest revision of FFmpeg- Building revision 33488 of MPlayer (same as latest Sherpya revision)- Disabled fribidi for MPlayer and mencoder_mt because it breaks compilation- Building revision 599 of PMS (1.23.0) - Picking one single PMS_FILENAME_ORIG if there are more binaries.

#!/bin/sh## build-pms-osx.sh## Version: 1.8# Last updated: 2011-05-30# Author: Patrick Atoon### DESCRIPTION## Building a statically linked PS3 Media Server for OSX is not an easy# task and requires advanced knowledge of building the libraries and# tools involved.## This script will take care of building all that is required to build# a statically linked PS3 Media Server for OSX.# It will attempt to build universal binaries (for Intel and PCC) where# possible. However, some libraries do not support this and the script# will compile for the current architecture.## The script will compile the PS3 Media Server disk image file:## pms-macosx-arch-x.xx.x.dmg## This script is provided as is. If it works for you, good! If it does# not, try to figure out why and share your findings on the PS3 Media# Server forums (http://www.ps3mediaserver.org/forum/)### REQUIREMENTS## Some Developer tools need to be installed manually. The script detects# this and provides help. Other sources will be downloaded automatically.### ACKNOWLEDGEMENTS## Many thanks to the PS3 Media Server developers and forum moderators# for keeping the project alive and the info coming. Special thanks to# Adrian Stutz for sharing his findings of how to build a statically# linked MPlayerOSX (http://www.mplayerosx.ch/), without his hard work# this script would not have been possible. Also thanks to Redlum for# his assistance in getting this script production ready.### TODO## - Clean up dependencies that are not needed for PMS### COPYRIGHT## This script is distributed under the Creative Commons Attribution 3.0# (CC BY) license. This means you are free to copy, distribute, transmit# and adapt it to suit your needs, as long as you mention the original# author in your work.# For more details, see http://creativecommons.org/licenses/by/3.0/### CONFIGURATION## Set FIXED_REVISIONS to "no" to check out the latest revisions.# Default is "yes" to check out the last known working revision.FIXED_REVISIONS="yes"

# Set TARGET_ARCHITECTURE for building binaries. Choose one of the following:## native: build for your own computer# x86_64: build for 64 bits Intel x86# i386: build for Intel 386# ppc: build for PowerPC#TARGET_ARCHITECTURE="i386"

# Set the amount of threads that are used for compiling everything. This# should generally be the same as the amount of CPU cores in your computer# (look for Total Number Of Cores in System Profiler if you don't know it).THREADS="2"

########################################### It should not be necessary to change anything below this line

########################################### Check for yasm#check_yasm() { if [ ! -x $YASM ]; then cat << EOMIt seems you are missing "yasm", which is required to run this script.Please run the following commands to install "yasm":

if [ "$?" == "1" ]; then cat << EOMIt seems you are missing "jarbundler", which is required to run this script.Please go to http://www.informagen.com/JarBundler/ , download the jarbundlerand install it.EOM exit; fi}

It took me a while to figure out how to test the mencoder / tsMuxeR combo on the command line and generate an output file (1, 2).

The command line tests prove that the mencoder argument "acodec=ac3" is responsible for screwing up the sound in the muxed file.That setting worked fine for the old MEncoder SVN-r29241-snapshot-4.0.1, but it messes up the new MEncoder SVN-r33488-4.2.1.

And the solution seems to be what the logfile proposes: use "acodec=ac3_fixed" instead. Using that, I end up with perfectly fine muxed files.