Linux Multithreaded via Mencoder-MT [A HowTo from a PMS fan]

For help and support with Linux specific issues

Linux Multithreaded via Mencoder-MT [A HowTo from a PMS fan]

Postby Mr.EoniX » Sat Dec 18, 2010 11:14 pm

Hey everyone,

I've been using this fantastic software for the last 2-3 years and i must say that it is the best available crossrendere out there.
SO MEGA PROPS FOR ALL DEVELOPERS WHO HAVE GIVEN US THIS!

I wish to give something back to the community, and i think I'v just stumbled upon something all users of the linux distribution of PMS would love to hear.

My background for this is the 3 years playing around tweaking, nudging, breaking, hurting, spanking my NetGear ReadyNAS Pioneer Pro (Custom DEBIAN kernel), to make it able to Crossrender subtitles on HD MKV files, via the Playstation 3 Media Server for Linux.

I had alot of success getting it all working with 720P MKV's - subtitles perfectly adjusted in size and position, no flikkering, no stuttering - PERFECTION.

But the HD goes abit further than that - namely 1080P, and for about a year i've looked for specific reasons why my system kept on pausing and resuming playback (1 second pausing).
The answer was ofcause the same answer given to SOO many new members on this forum: IT IS YOUR CPU!

And it is 100% exactly that, if you have a single core CPU without hyperthreading - the CPU load is rough when crossrendering subtitles on 1080P MKV files - but for the Windows guys they have the luxary of editing thier PMS.conf and tell the Mencoder to be multithreaded with multible cores.

Linux however seams to have been left in the dark in some sense because tonight I stumbled upon proof that the linux release of PMS never actually gave any real multithreaded crossrendering. It could utilize both cores yes, but not to the full extend, and what im trying to say here is that I'v found a way to push MORE out of the mencoder on linux distributions. (Debian and Ubunto anyway)

I have no idea if this method has been suggested on this forum before, but i've been here for years now searching for answers and havent come across anything like this.

Here it is:

1: Install Mencoder, mplayer and ffmpeg via any package manager (aptitude or something similar) - If you know your way around linux you should try to get the latest release. Im using Lenny (Stable) at this time and it does the job just fine, but you might have to use some Squeeze (Testing) packages to satisfy dependencies.

So when installing all of these – add these line to your /etc/apt/sources.list

deb http://www.debian-multimedia.org/ lenny main
deb http://ftp.se.debian.org/debian lenny main
deb http://ftp.us.debian.org/debian/ testing main contrib non-free

*Note: Having the latest release of those 3 components can make all the difference in the world, so get your components up to atleast “Lenny” mode :) – UPDATING YOUR PACKAGES ARE ON YOUR OWN RISK! – If you don’t know what you are doing then just try to see if the Mencoder-MT trick works for you at the get go.

2: Install Mencoder-MT and satisfy the dependencies.
http://debian-multimedia.org/dists/unst ... der-mt.php
There is the package – and links to the unofficial packages that you might need to compile for your kernel.
Some of them might install without a flitch – but in my case I had some custom debian packages which included parts of the needed packages, so I had to do some manual overwriting to get everything in place.
It was worth the risk – trust me.

3: When you have installed mencoder, mplayer, ffmpeg and mencoder-mt you should try this:

- Locate your mencoder file location:
Code: Select all
updatedb
locate mencoder

In my case it was: /usr/bin/mencoder

- Move mencoder out of the directory
Code: Select all
mv /usr/bin/mencoder /usr/mencoder

- Create a symbolic link from mencoder-mt to the old mencoder location
Code: Select all
ln /usr/bin/mencoder-mt /usr/bin/mencoder


So what did that do ? – Well – the default location of mencoder now only exists as a pointer to the mencoder-mt, with all its glory. PMS has no idea apparently because it just uses the file like it always did, except mencoder-mt truly grasps the multithreading business ;)
In my case I went from stuttering, 1 sec pausing and corrupted data to flawless, seamless, extremely high quality(mencoder_encode = keyint=1:vqscale=1:vqmin=1) and faster chapter movement.

Is this the correct way of dealing with this? – I don’t know – but it sure did the trick for me!! :D

Here is my PMS.conf btw if it should have any interest.

Code: Select all
nbcore = 2
mencoder_ass = false
mencoder_disablesubs = false
mencoder_mt = true
mencoder_yadif = false
mencoder_scaler = false
mencoder_scalex = 900
mencoder_scaley = 700
mencoder_remux_ac3 = true
mencoder_forcefps = false
mencoder_intelligent_sync = true
mencoder_usepcm = true
mencoder_nooutofsync = true
mencoder_mux_compatible = true

mencoder_encode = keyint=1:vqscale=1:vqmin=1

mencoder_audiosublangs =
mencoder_subfribidi = false
mencoder_subcp = cp1252
mencoder_fontconfig = true
mencoder_ass_defaultstyle = false
mencoder_ass_scale = 4
mencoder_ass_outline = 2
mencoder_ass_blur = 1
mencoder_ass_subpos = 0
mencoder_audiolangs = eng,dan

hidevideosettings = false
hide_enginenames = false
hide_transcode_folder = false
hide_media_library_folder = false
hide_extensions = false
hide_empty_folders = false

audiobitrate = 640
audio_thumbnails_method = 0
audiochannels = 6

tsmuxer_preremux_ac3 = true
ffmpeg = -g 1 qscale 1 -qmin 2
engines = mencoder,tsmuxer,mplayeraudio,ffmpegaudio,tsmuxeraudio,vlcvideo,mencoderwebvideo,mplayervideodump,mplayerwebaudio,vlcaudio,ffmpegdvrmsremux,rawthumbs
autoloadsrt = true
key_sort_method = 0
disable_fakesize = false

http_engine_v2 = true
chapter_interval = 5
chapter_support = true

thumbnails = true
thumbnail_seek_pos = 1200
use_mplayer_for_video_thumbs = true

network_interface = eth0

maximumbitrate = 0
maxvideobuffer = 600
embed_dts_in_pcm = true
enable_archive_browsing = true
usecache = true
folders = \/media\/Videos,\/media\/Music,\/media\/Pictures
language = en


As a funny sidenote it took me about 2 days to figure out that "mencoder_decode =" setting on the linux results in no subs - got a atleast 5 gray hairs from that one so leave it out!

OK - So if you are up for it - give it a go and let me know how it worked out for you - I might also be able to help if you are having issues with the steps.

//EoniX
Mr.EoniX
 
Posts: 2
Joined: Sat Dec 18, 2010 10:01 pm

Re: Linux Multithreaded via Mencoder-MT [A HowTo from a PMS

Postby hcubed » Sun Jan 09, 2011 10:05 am

Thanks for this info. I have been wondering about mencoder-mt on my Ubuntu installation. I haven't tried this yet, but plan to.
hcubed
 
Posts: 7
Joined: Fri Dec 31, 2010 4:12 am

Re: Linux Multithreaded via Mencoder-MT [A HowTo from a PMS

Postby ps3home » Tue Jan 11, 2011 3:36 pm

Thanks. Great job.
ps3home
 
Posts: 29
Joined: Mon Jan 19, 2009 5:30 pm

Re: Linux Multithreaded via Mencoder-MT [A HowTo from a PMS

Postby Vorg » Fri Jan 14, 2011 10:43 pm

using debian testing (squeeze):

apt-cache search mencoder-mt
mencoder-mt - MPlayer's Movie Encoder - threaded decoding version

Installs as mencoder-mt long side mencoder though. So you end up with both. Anytime you do an apt-get update/upgrade, you would need to see if the link got replaced.
Vorg
 
Posts: 5
Joined: Wed Jan 05, 2011 2:48 am

Re: Linux Multithreaded via Mencoder-MT [A HowTo from a PMS

Postby robiwisc » Wed Jan 19, 2011 10:57 am

I am using Ubuntu 10.04 and I get the following errors when trying to install the mencoder-mt package.

Unpacking mencoder-mt (from mencoder-mt_1.0~rc3git20100727-0.1_amd64.deb) ...
dpkg: dependency problems prevent configuration of mencoder-mt:
mencoder-mt depends on liba52-0.7.4; however:
Package liba52-0.7.4 is not installed.
mencoder-mt depends on libass4 (>= 0.9.7); however:
Package libass4 is not installed.
mencoder-mt depends on libbs2b0; however:
Package libbs2b0 is not installed.
mencoder-mt depends on libdca0; however:
Package libdca0 is not installed.
mencoder-mt depends on libdv4; however:
Package libdv4 is not installed.
mencoder-mt depends on libfaac0 (>= 1.28); however:
Version of libfaac0 on system is 1.26-0.1ubuntu2.
mencoder-mt depends on libjpeg62 (>= 6b1); however:
Version of libjpeg62 on system is 6b-15ubuntu1.
mencoder-mt depends on libmad0 (>= 0.15.1b-3); however:
Package libmad0 is not installed.
mencoder-mt depends on libmng1 (>= 1.0.10); however:
Package libmng1 is not installed.
mencoder-mt depends on libncurses5 (>= 5.7+20100313); however:
Version of libncurses5 on system is 5.7+20090803-2ubuntu3.
mencoder-mt depends on libopenjpeg2; however:
Package libopenjpeg2 is not installed.
mencoder-mt depends on libtwolame0; however:
Package libtwolame0 is not installed.
mencoder-mt depends on libvpx0 (>= 0.9.0); however:
Package libvpx0 is not installed.
mencoder-mt depends on libx264-104 (>= 1:0.svn20100918); however:
Package libx264-104 is not installed.

I did an apt search for these packages and it either cannot find them or install them.


UPDATE:
Solved these dependency issues by manually searching through debian-multimedia.org and installing them with dpkg. Awesome tutorial, thanks!
robiwisc
 
Posts: 1
Joined: Wed Jan 19, 2011 10:54 am

Re: Linux Multithreaded via Mencoder-MT [A HowTo from a PMS

Postby fcuk112 » Thu Feb 10, 2011 9:03 pm

i am using ubuntu 10.10 with the latest PMS beta on a P4 3.4ghz with hyper-threading.

when i play 720p mkv i see both core threads are being utilised quite heavily. in PMS config i also specify 2 cores.

could i expect to see any benefit from moving to use mencoder-mt?

thanks.
fcuk112
 
Posts: 3
Joined: Thu May 27, 2010 4:15 am


Return to Linux Specific Support

Who is online

Users browsing this forum: No registered users and 2 guests