[HowTo] Ubuntu 8.10 SVN PMS & Multithread

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

[HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby vmlinuz » Fri Jan 30, 2009 12:44 pm

First of all, get a PC and install Ubuntu on it :D :mrgreen: :mrgreen:
My Ubuntu still 32bits cause 64bits IOMMU issue with my MB :cry:
I don't explain howto install it cause of lot better howto are around on forums.
Do a update, security and bug issues must closed
restart

I use kernel 2.6.27-11-generic

If you plan to use svn, just skip this java 6 install step. By installing 'ant' and its tools, you will take java and javac 1.6

Java 6 install ( choose --> Linux (fichier auto-extractible))

download it from http://www.java.com/fr/download/manual.jsp
mine was stored on my desktop
open a terminal
Code: Select all
   vmlinuz@vmlinuz-desktop:~$ sudo -s
   [sudo] password for vmlinuz:
   root@vmlinuz-desktop:~# cd /opt
   root@vmlinuz-desktop:~/opt# chmod 777 /home/vmlinuz/Bureau/jre-6u11-linux-i586.bin
   root@vmlinuz-desktop:/opt# /home/vmlinuz/Bureau/jre-6u11-linux-i586.bin
      Do you agree to the above license terms? [yes or no] yes   
      ...
      Done.
   root@vmlinuz-desktop:/opt# cd


add this line at end of file : JAVA_HOME=/opt/jre1.6.0_11/
Code: Select all
   root@vmlinuz-desktop:~# vi .bashrc


exit and open terminal again

check JAVA_HOME var
Code: Select all
   vmlinuz@vmlinuz-desktop:~$ echo $JAVA_HOME
   /opt/jre1.6.0_11
   


download, unzip PMS, and do it ready for run mode
Code: Select all
   vmlinuz@vmlinuz-desktop:~$ wget http://ps3mediaserver.googlecode.com/files/pms-linux-1.03.tgz
   ...
   - « pms-linux-1.03.tgz » sauvegardé [5839087/5839087]
   vmlinuz@vmlinuz-desktop:~$ tar -xvzf pms-linux-1.03.tgz
   pms-linux-1.03/linux/
   ...
   pms-linux-1.03/pms.jar
   vmlinuz@vmlinuz-desktop:~$ cd pms-linux-1.03/
   vmlinuz@vmlinuz-desktop:~/pms-linux-1.03$ chmod 744 PMS.sh


add JAVA_HOME=/opt/jre1.6.0_11/ after DIRNAME=`dirname $0` line
Code: Select all
   vmlinuz@vmlinuz-desktop:~/pms-linux-1.03$ vi PMS.sh


get tsMuxer exec perms
Code: Select all
   vmlinuz@vmlinuz-desktop:~/pms-linux-1.03$ chmod 744 linux/tsMuxeR


now launch your favorite amazing PMS app, and enjoy :)
Code: Select all
   vmlinuz@vmlinuz-desktop:~/pms-linux-1.03$ ./PMS.sh


At this time you can use tsMuxer, no other encoder, so do PMS internal conf for that usage, use next step to get mencoder
:arrow: :arrow: :arrow:

Before next step, explanations are proposed to multi-core CPU owners.
let me know if it's work on single core

Code: Select all
vmlinuz@vmlinuz-desktop:~/pms-linux-1.03$ cd /usr/src/
vmlinuz@vmlinuz-desktop:/usr/src$ sudo -s
sudo password for vmlinuz:


get 'svn' and' git' apps and needed compile tools
Code: Select all
root@vmlinuz-desktop:/usr/src#apt-get install subversion build-essential git-core checkinstall yasm libgpac-dev


get neeeded lib dev here change libglide2 by libglide3 if you are on Ubuntu 64bits
Code: Select all
vmlinuz@vmlinuz-desktop:/usr/src$ apt-get install em8300-headers gawk gettext html2text intltool-debian \
ladspa-sdk libaa1-dev libartsc0 libartsc0-dev libasound2-dev libatk1.0-dev libaudio-dev \
libaudio2 libaudiofile-dev libavahi-client-dev libavahi-common-dev libcaca-dev \
libcairo2-dev libcdparanoia0-dev libcucul-dev libdbus-1-dev libdbus-glib-1-dev \
libdirectfb-dev libdirectfb-extra libdts-dev libdv4-dev libenca-dev libenca0 \
libesd0-dev libexpat1-dev libfaac-dev libfaac0 libfontconfig1-dev libfreebob0 \
libfreetype6-dev libfribidi-dev libggi-target-x libggi2 libggi2-dev libggimisc2 \
libggimisc2-dev libgif-dev libgii1 libgii1-dev libgii1-target-x libgl1-mesa-dev \
libglib2.0-dev libglide2 libglu1-mesa-dev libglu1-xorg-dev libgtk2.0-dev libice-dev \
libjack-dev libjack0 libjpeg62-dev liblzo-dev liblzo1 liblzo2-2 liblzo2-dev libmad0 \
libmad0-dev libmail-sendmail-perl libmp3lame-dev libmp3lame0 libmpcdec-dev libmpcdec3 \
libncurses5-dev libogg-dev libopenal-dev libopenal1 libpango1.0-dev libpixman-1-dev \
libpng12-dev libpopt-dev libpthread-stubs0 libpthread-stubs0-dev libpulse-dev \
libpulse-mainloop-glib0 libsdl1.2-dev libslang2-dev libsm-dev libsmbclient-dev \
libspeex-dev libsvga1 libsvga1-dev libsys-hostname-long-perl libsysfs-dev \
libtheora-dev libtwolame-dev libtwolame0 libvorbis-dev libx11-dev libxau-dev \
libxcb-render-util0-dev libxcb-render0-dev libxcb-xlib0-dev libxcb1-dev \
libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev \
libxft-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev libxt-dev libxv-dev \
libxvidcore4 libxvidcore4-dev libxvmc-dev libxvmc1 libxxf86dga-dev libxxf86vm-dev \
mesa-common-dev po-debconf sharutils x11proto-composite-dev x11proto-core-dev \
x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev \
x11proto-randr-dev x11proto-render-dev x11proto-video-dev x11proto-xext-dev \
x11proto-xf86dga-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev \
xtrans-dev zlib1g-dev libschroedinger-dev libstdc++5 libfaad-dev \
libgsm1-dev libdc1394-22-dev libfaad-dev libsdl1.2-dev


get latest svn mplayer
Code: Select all
 
root@vmlinuz-desktop:/usr/src# svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
...
Référence externe extraite à la révision 1166.

Révision 28388 extraite.
root@vmlinuz-desktop:/usr/src#


get ffmpeg-mt
Code: Select all
root@vmlinuz-desktop:/usr/src# git clone git://gitorious.org/ffmpeg/ffmpeg-mt.git
...
Resolving deltas: 100% (66342/66342), done.
root@vmlinuz-desktop:/usr/src#


get last x264
Code: Select all
root@vmlinuz-desktop:/usr/src# git clone git://git.videolan.org/x264.git


compil x264
Code: Select all
root@vmlinuz-desktop:/usr/src# cd x264
root@vmlinuz-desktop:/usr/src/x264# ./configure --enable-shared
You can run 'make' or 'make fprofiled' now.
root@vmlinuz-desktop:/usr/src/x264# make
root@vmlinuz-desktop:/usr/src/x264# checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-ubuntu"
root@vmlinuz-desktop:/usr/src/x264# ldconfig


compil and install ffmpeg multithread
Code: Select all
root@vmlinuz-desktop:/usr/src# cd ffmpeg-mt/
root@vmlinuz-desktop:/usr/src/ffmpeg-mt# git clone git://git.ffmpeg.org/libswscale/
root@vmlinuz-desktop:/usr/src/ffmpeg-mt# ./configure
root@vmlinuz-desktop:/usr/src/ffmpeg-mt# make
root@vmlinuz-desktop:/usr/src/ffmpeg-mt# make install


note you could do the same for single multicore
#get, compil and install ffmpeg non multi thread
#root@vmlinuz-desktop:/usr/src# svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
#root@vmlinuz-desktop:/usr/src# cd ffmpeg
#root@vmlinuz-desktop:/usr/src/ffmpeg# ./configure
#root@vmlinuz-desktop:/usr/src/ffmpeg# make
#root@vmlinuz-desktop:/usr/src/ffmpeg# make install



compil and install mencoder multithread
Code: Select all
root@vmlinuz-desktop:/usr/src# cd ../mplayer/
root@vmlinuz-desktop:/usr/src/mplayer# cp -rf ../ffmpeg-mt/libavcodec libavcodec
root@vmlinuz-desktop:/usr/src/mplayer# cp -rf ../ffmpeg-mt/libavformat libavformat
root@vmlinuz-desktop:/usr/src/mplayer# cp -rf ../ffmpeg-mt/libavutil libavutil
root@vmlinuz-desktop:/usr/src/mplayer# ./configure
root@vmlinuz-desktop:/usr/src/mplayer# make
root@vmlinuz-desktop:/usr/src/mplayer# make install

root@vmlinuz-desktop:/usr/src/mplayer# export LD_LIBRARY_PATH=/usr/local/lib/


Launch PMS.sh and try it with multicore purpose


------------------------
If you want to get the last SVN PMS code read-only and compil it

You need ant and its stuff
Code: Select all
root@vmlinuz-desktop:~# apt-get install ant ant-gcj ant-optional ant-optional-gcj \
ca-certificates-java default-jdk default-jre default-jre-headless gcj-4.3-base java-common \
libaccess-bridge-java libgcj-bc libgcj-common libgcj9-0 libgcj9-jar libjaxp1.3-java \
libjaxp1.3-java-gcj libxerces2-java libxerces2-java-gcj openjdk-6-jdk openjdk-6-jre \
openjdk-6-jre-headless openjdk-6-jre-lib rhino ttf-bengali-fonts ttf-kannada-fonts \
ttf-oriya-fonts ttf-telugu-fonts ttf-wqy-zenhei tzdata-java


Now get last SVN PMS code
Code: Select all
root@vmlinuz-desktop:~# svn checkout http://ps3mediaserver.googlecode.com/svn/trunk/ ps3mediaserver-read-only


Compile it
Code: Select all
root@vmlinuz-desktop:~# cd ps3mediaserver-read-only/ps3mediaserver
root@vmlinuz-desktop:~# ant


Now you can use latest compiled PMS.jar or extract full release from generated tar.gz file

Enjoy !

Big Thanks to useful links
http://ubuntuforums.org/showthread.php?t=786095 for ffmpeg
http://ubuntuforums.org/showthread.php?t=1024592 for mplayer
Last edited by vmlinuz on Sun Feb 01, 2009 11:57 pm, edited 2 times in total.
CPU Intel Q9550 & RAM 4GB Lan : <100Mb/s wired> Router <100Mb/s> <CPL 200Mb/s @ 160Mb/s >=< 100Mb/s> PS3
old config til Feb 22th : Athlon x64 4200+ oc@2.6Gh RAM 4Gb
vmlinuz
 
Posts: 35
Joined: Mon Jan 19, 2009 10:25 am

Re: HowTo /Ubuntu 8.10/SVN PMS & Multithread

Postby vmlinuz » Fri Jan 30, 2009 11:09 pm

just trying to find issue with mencoder-mt...*

I get an issue on Ubuntu 8.10 (but was working without issue on 8.04 :twisted: )

mencoder-mt's compilation work fine
mencoder is seen in transcoded PMS view, like in default view.

then I launch the movie, and get this :

[Thread-390] TRACE 22:49:30.364 Exception in thread "Thread-390" java.lang.NullPointerException
[Thread-390] TRACE 22:49:30.364 at net.pms.io.PipeIPCProcess.run(PipeIPCProcess.java:54)

Is this coming from PMS issue or sounds like a mencoder issue ?
Thanks,

EDIT : THIS WAS DUE TO A MENCODER ISSUE CAUSE LIB for DEV - no issue now :D
CPU Intel Q9550 & RAM 4GB Lan : <100Mb/s wired> Router <100Mb/s> <CPL 200Mb/s @ 160Mb/s >=< 100Mb/s> PS3
old config til Feb 22th : Athlon x64 4200+ oc@2.6Gh RAM 4Gb
vmlinuz
 
Posts: 35
Joined: Mon Jan 19, 2009 10:25 am

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby vmlinuz » Sat Jan 31, 2009 11:32 am

Just added multithread mencoder and svn pms part.
See first post ;)
CPU Intel Q9550 & RAM 4GB Lan : <100Mb/s wired> Router <100Mb/s> <CPL 200Mb/s @ 160Mb/s >=< 100Mb/s> PS3
old config til Feb 22th : Athlon x64 4200+ oc@2.6Gh RAM 4Gb
vmlinuz
 
Posts: 35
Joined: Mon Jan 19, 2009 10:25 am

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby vmlinuz » Sun Feb 01, 2009 6:44 pm

Same way under Ubuntu 8.10 64bits used.

This is some diff :

During lib install, use libglide3 instead of libglide2.

Mencoder MT compil and work.

tsMuxer seems have an issue under linux 64bits, I get "Data corrupted" on PS3 and debug.log give me :
"DEBUG 16:18:26.922 /home/vmlinuz/pms-linux-1.03/linux/tsMuxeR: 43: /tmp/tmp.CQxTlr4253/tsMuxeR: not found"

any idea ?
CPU Intel Q9550 & RAM 4GB Lan : <100Mb/s wired> Router <100Mb/s> <CPL 200Mb/s @ 160Mb/s >=< 100Mb/s> PS3
old config til Feb 22th : Athlon x64 4200+ oc@2.6Gh RAM 4Gb
vmlinuz
 
Posts: 35
Joined: Mon Jan 19, 2009 10:25 am

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby Ashmodai » Mon Feb 02, 2009 11:16 pm

Got the same issue under 8,04 (also 64bits) I add a look at the look and I have seen a message of mencoder complaining about missing libdca for dts decoding. The error was suggesting to recompile mencoder with libdca support. I tried and ... it failed due to a missing dependency ... so I recompiled again without enable libdca and the result is that it seems to be able to use it now (???)
Code: Select all
Opening audio decoder: [libdca] DTS decoding with libdca
Stream with high frequencies VQ coding
AUDIO: 48000 Hz, 6 ch, s16le, 1536.0 kbit/33.33% (ratio: 192000->576000)
Selected audio codec: [dts] afm: libdca (DTS-libdca)


I really don't get it ...
Nevertheless the file still does not play :)
Ashmodai
 
Posts: 23
Joined: Mon Jan 19, 2009 9:05 am

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby Ashmodai » Tue Feb 03, 2009 9:22 am

Finally !!! Reading another post I seen somebody complaining that with the mt enabled version he had issue with some mkv if audio was set to more than 2 channels .... I tried and guess what. It does work indead. All my mkvs are playing fine now. I guess this is the price to pay for using a very early svn version of mencoder ...
Ashmodai
 
Posts: 23
Joined: Mon Jan 19, 2009 9:05 am

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby vmlinuz » Tue Feb 03, 2009 1:11 pm

If you have issues with libdca, you could try to use libdts instead
CPU Intel Q9550 & RAM 4GB Lan : <100Mb/s wired> Router <100Mb/s> <CPL 200Mb/s @ 160Mb/s >=< 100Mb/s> PS3
old config til Feb 22th : Athlon x64 4200+ oc@2.6Gh RAM 4Gb
vmlinuz
 
Posts: 35
Joined: Mon Jan 19, 2009 10:25 am

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby vmlinuz » Wed Feb 11, 2009 9:15 pm

Hi !
Lot of readers and no comment, is this still so perfect :lol:

Please let me know if issues.
bye.
CPU Intel Q9550 & RAM 4GB Lan : <100Mb/s wired> Router <100Mb/s> <CPL 200Mb/s @ 160Mb/s >=< 100Mb/s> PS3
old config til Feb 22th : Athlon x64 4200+ oc@2.6Gh RAM 4Gb
vmlinuz
 
Posts: 35
Joined: Mon Jan 19, 2009 10:25 am

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby oggie » Sun Feb 15, 2009 8:09 pm

I've done all the steps and I'm able to play videos and play transcoded videos as well.

But I don't think it's running multiple threads, but I'm unsure how to test it. If I run a 'ps -ef' command, I only see one mencoder, but I don't think that tells you how many threads there are.

I can do a 'top -H' and it shows me 5 mencoder threads. But how does one know what CPU they're running on?

What's the proper way to verify the number of threads running?
oggie
 
Posts: 22
Joined: Fri Jan 30, 2009 3:53 pm

Re: [HowTo] Ubuntu 8.10 SVN PMS & Multithread

Postby jacktin » Mon Feb 16, 2009 5:57 am

I've got the same issue as oggie.

My hardware: AMD Athlon(tm) 64 X2 Dual Core Processor 5000+
My O/S: Linux server 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009 x86_64 GNU/Linux (Ubuntu 8.10)

Everything compiles and installs alright but the machine still doesn't have the jam to transcode 1080p on the fly. After a few minutes it runs out of buffer and starts to stutter. The machine does report that multiple threads are running using 'top -H' but it really only seems to be using 1 core. The machine sits at about 35-40% idle.

Code: Select all
top - 21:17:20 up 1 day,  4:41,  2 users,  load average: 1.11, 0.49, 0.18
Tasks: 276 total,   3 running, 273 sleeping,   0 stopped,   0 zombie
Cpu(s): 60.3%us,  0.5%sy,  0.0%ni, 37.9%id,  0.5%wa,  0.3%hi,  0.5%si,  0.0%st
Mem:   1927820k total,  1913300k used,    14520k free,    20004k buffers
Swap:  5646808k total,     8368k used,  5638440k free,   637144k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
25964 jacktin   20   0  228m  60m 5276 R   67  3.2   0:26.42 mencoder           
25971 jacktin   20   0  228m  60m 5276 S   27  3.2   0:11.38 mencoder           
25972 jacktin   20   0  228m  60m 5276 S   27  3.2   0:11.70 mencoder           
25956 jacktin   20   0 1185m 582m  11m S    1 30.9   0:00.18 java               
25970 jacktin   20   0 1185m 582m  11m S    1 30.9   0:00.54 java
...             

The mencoder process is actually reported to be using about 121% so maybe it's spanning both cores but why isn't it using all of the horsepower that the machine has? Anybody have any ideas?

The command line for mencoder is as follows:

Code: Select all
26628 ?        Rl     0:28 mencoder -ss 0 -quiet /media/video/HD/1080p_DTS_x264_input.mkv -quiet -quiet -oac lavc -of mpeg -mpegopts format=mpeg2:muxrate=500000:vbuf_size=1194:abuf_size=64 -ovc lavc -channels 6 -lavdopts debug=0:threads=2 -lavcopts autoaspect=1:vcodec=mpeg2video:acodec=ac3:abitrate=384:threads=2:keyint=3:vqscale=2:vqmin=3 -alang eng,fre,jpn,ger -subdelay 20000 -quiet -quiet -quiet -quiet -ofps 24000/1001 -quiet -quiet -mc 0 -noskip -af lavcresample=48000 -srate 48000 -o /tmp/javaps3media/mencoder1234758688198

Changing the configuration on the Transcoding settings tab in PMS does result in more threads being spawned (according to 'top -H') but it does not improve the performance. In fact, the performance is about the same whether I set it for 1, 2 or 4 cores which makes me think it's only using one cores.

Anyone have any insight or tips?

Regarding the tutorial, I have a couple of suggestions (just very minor things). It might be good to do something like the following prior to installing these packages from source:

Code: Select all
$sudo apt-get purge ffmpeg x264 libx264-dev mplayer mencoder

And instead of doing a make install for ffmpeg-mt and mplayer:

Code: Select all
$sudo checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3"

$sudo checkinstall -D --install=yes --fstrans=no --pakdir "$HOME/Desktop" --maintainer "$USER" --pkgname mplayer --pkgversion "3:1.0~svn" --backup=no --deldoc=yes --deldesc=yes --delspec=yes --gzman --default
jacktin
 
Posts: 2
Joined: Mon Feb 16, 2009 5:19 am

Next

Return to Linux/Unix Support

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests