Author Topic: mPlayer install script & add dereg of old avi codecs ???  (Read 11094 times)

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 416
    • View Profile
mPlayer install script & add dereg of old avi codecs ???
« on: August 06, 2013, 12:30:22 am »
Could somebody please post the install script from the article on Os2World
detailing installation of mPlayer ! The old forum posts are gone.

Also, is there any way to add code to it that will deregister the OLD avi codecs
that come with Os2/eCS ???

Thank you to the person that wrote it !!!


Greggory



Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 27
  • Posts: 548
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #1 on: August 06, 2013, 08:00:48 pm »
Hi Greggory

I'm not sure who wrote the mplayer "how to" - I think it was collated from various posts on the subject. Was there an install script as well?

Here is what I remember from installing mplayer some time ago:-

1] Download mplayer - current version is http://hobbes.nmsu.edu/download/pub/os2/apps/mmedia/video/players/mplayer-1.1.1-4.4.6.zip

2] Download codecs - current version is http://www.mplayerhq.hu/MPlayer/releases/codecs/windows-essential-20071007.zip

3] unzip mplayer into a directory of your choice eg \programs\mplayer

4] unzip the codec package into a temporary directory then copy the unzipped files into a sub directory of mplayer eg \programs\mplayer\codecs

5] copy \mplayer\npmp.dll to the directory containing your Firefox/Seamonkey plugins - remove the old netscape plugin files to avoid possible problems

6] add required entries to config.sys file; I have the following:-

REM ***** mplayer variables
SET MPLAYER_PATH=J:\PROGRAMS\MULTIMEDIA\mplayer
SET MPLAYER_CODECS_DIR=J:\PROGRAMS\MULTIMEDIA\mplayer\codecs
SET MPLAYER_HOME=I:\users\peter\home\.mplayer

Obviously you will need to change Drive:\DirectoryPath to suit your system

Other options:
smplayer makes a good gui frontend for mplayer - see http://svn.netlabs.org/qtapps/wiki/QT4%20Multimedia
but requires the qt runtime support - see http://svn.netlabs.org/qt4/

I'm not sure about deregistering the old os2 codecs.

If you have eCS1.2 (? or was it 1.1) or later then the CWMM is installed on your system. Have a read of the [BootDrive]:\MMOS2\MEDIAFLD\DOC\mediafldr.inf to discover how to replace the default os2 avi and mpg players with smplayer.


I do not think that I have missed anything. If I have I hope someone else will add it to the above.

Regards

Pete

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 255
  • -Receive: 49
  • Posts: 1708
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #2 on: August 07, 2013, 01:27:48 am »
Hi Greggory.

I recovered an old backup of the forum and it is available here:

http://www.os2world.com/oldforum/index.php?topic=994.msg24136#msg24136

Please notice that the old recovered forum is only for backup, is read only and does not have the attachments stored.

Regards
« Last Edit: August 09, 2013, 08:07:16 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 416
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #3 on: August 07, 2013, 03:10:51 am »
Thank you Pete for all the info and Martin for the link !!!

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 255
  • -Receive: 49
  • Posts: 1708
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #4 on: August 07, 2013, 09:14:10 pm »
Hi Greggory

I will also like to invite you to write some lines about MPlayer and OS/2 on the OS2World.com/wiki
It uses the same userid/password of this forum.

Regards
Martin
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 416
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #5 on: August 08, 2013, 07:38:55 am »
Hi Greggory

I will also like to invite you to write some lines about MPlayer and OS/2 on the OS2World.com/wiki
It uses the same userid/password of this forum.

Regards
Martin

Sure after I add the code for MP3s codec and figure how to get rid of the old codecs !

Greggory

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #6 on: August 09, 2013, 12:30:10 pm »
You may want to use this code and modify it to your needs, please do post you improvements to it here.
//Jan-Erik

Code: [Select]
/*  Install MPlayer */
'@echo off'

call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs

cfg.snap = 0
cfg.dive = 0
cfg.vman = 0
cfg.t23 = 0
cfg.uniaud = 0
cfg.noshare = 0
cfg.bufsize = 0

env = 'ENVIRONMENT'
cfg.wo = ( pos( '/WO', translate( ARG(1) ) ) > 0 )
if cfg.wo = 0 then
do
   cfg.snap = ( pos( '/SNAP', translate( ARG(1) ) ) > 0 )
   if cfg.snap = 0 then
      cfg.vman = ( pos( '/VMAN', translate( ARG(1) ) ) > 0 )
   if cfg.snap = 0 & cfg.vman = 0 then
      cfg.t23 = ( pos( '/T23', translate( ARG(1) ) ) > 0 )
   if cfg.snap = 0 & cfg.vman = 0  & cfg.t23 = 0 then
      cfg.dive = ( pos( '/DIVE', translate( ARG(1) ) ) > 0 )
   else cfg.dive = 0
end
cfg.vo = ( pos( '/VO', translate( ARG(1) ) ) > 0 )
cfg.dart = ( pos( '/DART', translate( ARG(1) ) ) > 0 )
if cfg.dart = 0 then
   cfg.uniaud = ( pos( '/UNIAUD', translate( ARG(1) ) ) > 0 )
if cfg.dart = 0 & cfg.uniaud = 0 then
   cfg.noshare = ( pos( '/NOSHARE', translate( ARG(1) ) ) > 0 )
if cfg.dart = 0 & cfg.uniaud = 0 & cfg.noshare = 0 then
   parse value translate( ARG(1) ) with .'/BUFSIZE'buf_size'/'.
if datatype( strip( buf_size ), 'W' ) then
   cfg.bufsize = strip( buf_size )

home_path = VALUE( 'HOME',, env )
if length( home_path ) = 0 then
    home_path = OSBootDrive()'\Apps'
   
if pos( '/I', translate( ARG(1) ) ) >  0 then
do
   parse value translate( ARG(1) ) with .'/I'programs_path'/'.
   programs_path = strip( programs_path )
end
if directory( programs_path ) = '' then
do
   programs_path = VALUE( 'PROGRAMS',, env )
   if length( programs_path ) = 0 then
       programs_path = VALUE( 'MMBASE',, env )
   if length( programs_path ) = 0 then
       programs_path = OSBootDrive()
end
if stream( programs_path'\MPlayer\mplayer.exe', 'C', 'query exists' ) <> '' then
   programs_path = programs_path'\MPlayer' /* Change MPlayer by hand if you use another folder name */
else
do
   call SysFileTree programs_path'\*mplayer.exe', 'file', 'SFO'
   if file.0 > 0 then
       programs_path = strip( filespec( 'd', file.i )||filespec( 'p', file.i ), 't', '\' )
   else
   do
       say "Can't find MPlayer in the programs directory"
       drives = SysDriveMap( 'C:', 'USED' )
       do i = 1 to words( drives )
          call SysFileTree subword( drives, i )||'\*mplayer.exe', 'file', 'SFO'
          if file.0 > 0 then
          do
             programs_path = strip( filespec( 'd', file.i )||filespec( 'p', file.i ), 't', '\' )
             leave i
          end
       end
   end
end
if stream( programs_path'\mplayer.exe', 'C', 'query exists' ) = '' then
do
    say "Can't find MPlayer on your computer"
    return 1
end

'SET MPLAYER_HOME='home_path'\.mplayer'
'SET MPLAYER_CODECS_DIR='programs_path'\Codecs'
'SET MPLAYER_PATH='programs_path'\mplayer.exe'

if ChkCreatePath( programs_path ) = 0 then
    say 'Installation Directory for MPlayer is ready'
else do
    say "Couldn't create Installation directory"
    Exit -1
end

if ChkCreatePath( VALUE( 'MPLAYER_CODECS_DIR',, env ) ) = 0 then
    say 'Directory to store MPlayer Codecs is ready'
else say 'Codec directory not available'

mplayer_home = VALUE( 'MPLAYER_HOME',, env )
if ChkCreatePath( mplayer_home ) = 0 then
do
    say 'Directory to store MPlayer configuration prepared'
    call WriteCfg mplayer_home'\config'
    call WriteInput mplayer_home'\input.conf'
    say 'Configuration written'
end
else do
    say "Couldn't create directory for MPlayer configuration,"
    say "will use standard settings instead..."
end

prgm.destpath = programs_path
prgm.name = 'mplayer.exe'
prgm.objid = 'MPPLAYER'
prgm.icon = 'Mplayer.ico'
prgm.wpname = 'MPlayer'
prgm.wpdest = '<MMPM2_FOLDER>'
prgm.params = '"%**P\%**F"'
prgm.assocfilter = '*.mpg,*.avi,*.wmv,*.mov,*.divx,*.flv,*.mpeg,*.vob,*.mp4,*.asf,*.matroska,*.fli,*.m4v,*.rm,*.ram'
rc = CreatePrgmObj()
exit rc

CreatePrgmObj: procedure expose prgm.
    setupstring = 'OBJECTID=<'prgm.objid'>;EXENAME='prgm.destpath'\'prgm.name';PROGTYPE=PM;PARAMETERS='prgm.params';ASSOCFILTER='prgm.assocfilter';ICONFILE='prgm.icon';'

/*Create program in folder and attach icon*/
    rc = SysCreateObject( 'WPProgram', prgm.wpname, prgm.wpdest, setupstring, 'U' )
    if rc then
        say prgm.wpname' has been successfully installed'
    else
        say  prgm.wpname' failed installation'
Return rc
   
WriteCfg: procedure expose cfg.
    retval = stream( ARG(1), 'C', 'QUERY EXIST' )
    if retval <> '' then '@DEL 'ARG(1)' /F'
    if stream( ARG(1), 'C', 'OPEN WRITE' ) = 'READY:' then
    do
        call lineout ARG(1), '# Settings for stream/file caching'
        call lineout ARG(1), 'cache=12288'
        call lineout ARG(1), 'cache-min=30'
        call lineout ARG(1), ''
        call lineout ARG(1), '# Setting for Browser User Agent response'
        call lineout ARG(1), 'user-agent=NSPlayer/4.1.0.3856'
        if cfg.wo then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use WarpOverlay'
            call lineout ARG(1), 'vo=kva:wo'
        end
        else if cfg.snap then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use SNAP'
            call lineout ARG(1), 'vo=kva:snap'
        end
        else if cfg.vman then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use VMAN'
            call lineout ARG(1), 'vo=kva:vman'
        end
        else if cfg.dive then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use DIVE'
            call lineout ARG(1), 'vo=kva:dive'
        end
        if cfg.dart then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use DART'
            call lineout ARG(1), 'ao=kai:dart'
        end
        else if cfg.uniaud then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use UniAUD'
            call lineout ARG(1), 'ao=kai:uniaud'
        end
        else if cfg.noshare then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use DART No Share'
            call lineout ARG(1), 'ao=kai:noshare'
        end
        if cfg.bufsize then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Force mPlayer to use buffer size'
            call lineout ARG(1), 'ao=kai:bufsize'||cfg.bufsize
        end
        if cfg.vo then
        do
            call lineout ARG(1), ''
            call lineout ARG(1), '# Video Overlay Options and VIO Message Window Options'
            call lineout ARG(1), 'really-quiet=yes'
            call lineout ARG(1), 'fixed-vo=yes'
            call lineout ARG(1), 'colorkey=0x000001'
        end
        call stream ARG(1), 'C', 'CLOSE'
    end
Return 0
   
WriteInput: procedure expose cfg.
    retval = stream( ARG(1), 'C', 'QUERY EXIST' )
    if retval <> '' then '@DEL 'ARG(1)' /F'
    if stream( ARG(1), 'C', 'OPEN WRITE' ) = 'READY:' then
    do
        call lineout ARG(1), '# Settings for User Control of mPlayer playback'
        call lineout ARG(1), 'MOUSE_BTN2 vo_fullscreen'
        call lineout ARG(1), 'PGUP pt_step -1'
        call lineout ARG(1), 'PGDWN pt_step 1'
        call lineout ARG(1), '+ volume 5'
        call lineout ARG(1), '- volume -5'
        call stream ARG(1), 'C', 'CLOSE'
    end
Return 0
   
OSBootDrive: procedure
    BootDrive = substr( value( 'RUNWORKPLACE' ,, 'ENVIRONMENT' ), 1, 2 )

    if BootDrive = '' then
        BootDrive = substr( value( 'COMSPEC' ,, 'ENVIRONMENT' ), 1, 2 )

    if length( BootDrive ) = 0 then
        BootDrive = 'C:'
Return BootDrive
   
ChkCreatePath: procedure
    rc = ( directory( ARG(1) ) = '' )
    if rc = 1 then
        call ChkCreatePath strip( filespec( 'D', ARG(1) )||filespec( 'P', ARG(1) ), 'T', '\' )
    if rc = 1 then
        '@mkdir 'ARG(1)
Return rc

Greggory Shaw

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 36
  • -Receive: 19
  • Posts: 416
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #7 on: August 10, 2013, 02:46:59 am »
Exactly what I was looking for !  Thank you Jan-Erik !

I'm adding the options to install MP3 codec and dereg the old MMAVI classes.

Could you please post some examples of the install parameters for your script.


Greggory
« Last Edit: August 10, 2013, 06:03:39 am by Greggory Shaw »

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #8 on: August 15, 2013, 07:54:54 am »
Hello,

You should specify the installation options as parameters to take advantage of the drivers that give the best experience/performance with your hardware. It would however be nice if you can come up with code how to automatically detect installed drivers and which one should take precedence.

//Jan-Erik

InstMPlayer <parameters>
VideoName
/WOWarp Overlay
/SNAPSNAP
/VMANVMan
/T23T23 Laptop
/DIVEDIrect Video Extension
/VOVideo Overlay Options
AudioName
/DARTDigital Audio Real Time
/UNIAUDUNIversal AUDio
/NOSHAREDon't share audio
/BUFSIZE 1234Use buffer size of 1234
/I D:\MyPrograms Tell the script where MPlayer has been unpacked

Note: The code expect MPLayer to be placed in a folder named "MPlayer" and if you specify the path it will install faster if you specify /I D:\MyPrograms instead of /I D:\MyPrograms\MPlayer.
Programs path search order query the environment variables for, PROGRAMS and MMBASE, but the code will fall back to search for MPLayer on the boot drive if MPlayer cant be found there.
It will search though every drive if that also fail, until it find mplayer.exe
« Last Edit: August 16, 2013, 08:16:27 am by Jan-Erik Lärka »

Silvan Scherrer

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 136
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #9 on: August 15, 2013, 09:20:33 am »
btw you don't have to specify any options to vo=kva or ao=kai, as those libs automaticaly search your system and uses the best combination.

vo search order is: WO, SNAP, DIVE
ao search order is: UNIAUD, DART

regards
Silvan
kind regards
Silvan
CTO bww bitwise works GmbH

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #10 on: August 15, 2013, 12:39:24 pm »
UNIAUD doesn't work for me though I only have UNIAUD on 3 of 4 machines.

So I have to manually specify /DART to get sound that doesn't stutter or cause 100% CPU usage (eCS v2.2 installations).
/VMAN seem to be the best option for me regaring video for most machines, though one have a Matrox G400 graphics card.

Would WarpOverlay (WO) improve things?
Include it with eCS v2.2 by default!

Andy Willis

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 9
  • Posts: 158
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #11 on: August 15, 2013, 04:04:45 pm »
Would WarpOverlay (WO) improve things?
Include it with eCS v2.2 by default!
At this point WO only works with some very old hardware (even compared to what SNAP supports) and the difference between WO and SNAP's overlay support is probably minimal.

Silvan Scherrer

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 136
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #12 on: August 15, 2013, 04:31:57 pm »
UNIAUD doesn't work for me though I only have UNIAUD on 3 of 4 machines.

So I have to manually specify /DART to get sound that doesn't stutter or cause 100% CPU usage (eCS v2.2 installations).
/VMAN seem to be the best option for me regaring video for most machines, though one have a Matrox G400 graphics card.
as it's just a search order, it falls back to the next, if the former is not found.
kind regards
Silvan
CTO bww bitwise works GmbH

Jan-Erik Lärka

  • Global Moderator
  • Full Member
  • *****
  • Thank You
  • -Given: 5
  • -Receive: 11
  • Posts: 151
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #13 on: August 16, 2013, 08:02:51 am »
UNIAUD doesn't work for me though I only have UNIAUD on 3 of 4 machines.

So I have to manually specify /DART to get sound that doesn't stutter or cause 100% CPU usage (eCS v2.2 installations).
/VMAN seem to be the best option for me regaring video for most machines, though one have a Matrox G400 graphics card.
as it's just a search order, it falls back to the next, if the former is not found.
Yes, but it use up all cpu and/or stutter if I install without any options ( have to force the mode /DART ). :-/
This is not specific to eCS v2.2, I've seen it for a long time.
« Last Edit: August 16, 2013, 08:08:59 am by Jan-Erik Lärka »

Silvan Scherrer

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 136
    • View Profile
Re: mPlayer install script & add dereg of old avi codecs ???
« Reply #14 on: August 16, 2013, 11:35:35 am »
did you ever send a note about that to the mplayer porter? He did also the libkva and libkai
kind regards
Silvan
CTO bww bitwise works GmbH