Author Topic: Opie-sh-mplayer  (Read 5143 times)

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh-mplayer
« on: February 12, 2005, 09:52:56 pm »
I was asked by someone to share this, so here it is.

I have both Mplayers (xmms-embedded.sourceforge.net and the 3.5.2 one) installed.
The xmms-embedded one works better for Xmms, while the 3.5.2 version has a lot more features.

I renamed the 3.5.2 version to /usr/bin/mplayer10pre3 and changed opie-sh-mplayer.sh to call that.  If you want to do the same, I encourage it.

But this is packaged for everyone to pickup and use.

It'll turn the power settings off, so you dont have to hit any keys to keep it alive.
Other than that, all functionality is for Mplayer.

The ARGS dialog is for additional arguments.  Such as "-aspect=16:9"

Oh, and this script doesnt work for music, it'll just beep at you. (Which is why I use XMMS).

If anyone has some Opie-SH Requests, (Such as "Stop flooding the board with your stupid scripts") let me know, I'll happily write them.

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Opie-sh-mplayer
« Reply #1 on: February 14, 2005, 09:43:37 am »
Quote
If anyone has some Opie-SH Requests, (Such as "Stop flooding the board with your stupid scripts") let me know, I'll happily write them.

No request at this time but thanks for the offer, and don't worry about flooding the board with working scripts. I'm using them and learning from them... they have helped me to improve my own scripts.

Thanks

Greg

2tomcats

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • http://www.wach-o-witz.de
Opie-sh-mplayer
« Reply #2 on: February 14, 2005, 05:46:52 pm »
Quote
If anyone has some Opie-SH Requests
No request but a question. I'm writing some scripts myself like this one: 'wlanswitch'
Do you know how to center the dialogboxes? Usually they don't start centered so you have to drag them manually to somewhere to see them completely. Kind of annoying.

Uli
SL5500G, D-Link DCF-660W, Lexar SD 256, OZ 3.5.2 (Hentges), Hoary/FVWM 2.5.10...

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh-mplayer
« Reply #3 on: February 14, 2005, 07:10:08 pm »
I dont know how to center them, it sure would be nice to keep them from dropping off the right side of the screen.

And taking a look at your scripts... Wow.

I had no idea Opie-SH could look pretty.
I am rather embarassed at my simple scripts now.

endeey

  • Newbie
  • *
  • Posts: 14
    • View Profile
Opie-sh-mplayer
« Reply #4 on: March 01, 2005, 12:03:03 am »
@MrSquishy: Very elegant! A question: I am having a distinct lack of audio under the 3.5.2 mplayer.  It just clicks a little at the beginning of the movie. The video looks great.  Ironically, the xmms-embedded version of mplayer plays audio and video very nicely, but seems to screw up the framebuffer somehow upon exit.  Are you using mencoder? I am using
mencoder dvd://1 -ovc frameno -oac mp3lame -lameopts abr:br=128 -o frameno.avi
mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vhq:vpass=1:vbitrate=1000 -vop scale=320:240 -o Small_Movie-small.avi
mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vhq:vpass=2:vbitrate=1000 -vop scale=320:240 -o Small_Movie-small.avi


I am using 3.5.2 (non-hentges) on a 5500.
-endeey

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh-mplayer
« Reply #5 on: March 01, 2005, 12:29:03 am »
For mp3 encoded stuff, you'll have to add "-ac mad" in the "Args" box.

I'd advise against playing .mp3's using this as it seems to lockup the Zaurus until the song is over.

I use Cmisips (excelent) createogm script:
Code: [Select]
#!/bin/sh
#This site was taken from http://cmisip.home.insightbb.com/zaurus.htm

#version 1.1
#Changes 1-1.1
#Added aspect ratio.  There will be black bars on top and bottom to keep the resolution at 320x240 to avoid software scaling on the Z.
#Fixed AV_DELAY


#This script should convert any mplayer playable video file (audio + video) to ogm format playable on the sharp zaurus 5600, 760, 860 using mplayer with Tremor codec support. You need mencoder and mplayer of course, plus oggenc and ogmmerge.


#Variable assignment
ENCODE_RATE=22050
AV_DELAY=200
VIDEO_BITRATE=200
OUTPUT_FPS=15
BRIGHTNESS=15
AUDIO_QUALITY=3
X_RESOLUTION=320
Y_RESOLUTION=240




#Check the command line arguments
if [ -z "$1" ]; then
              echo "Usage is 'createogm   ' "
              exit
              fi

if [ -z "$2" ]; then
              echo "Usage is 'createogm   ' "
              exit
              fi

if [ -f "$2" ]; then
              echo "The file $2 exists. Aborting "
              exit
              fi

#find $1 2>/dev/null
#if [ $? = 1   ]; then
#              echo "Cannot find source file. Aborting"
#              exit
#fi

#Check the source audio rate

AUDIO_RATE=$(mplayer -vo null -ao null -frames 0 -identify "$1" 2>/dev/null | grep "ID_AUDIO_RATE" | sed "s/ID_AUDIO_RATE=//g")


if [ -z $AUDIO_RATE  ]; then
              echo "Cannot detect audio in source file. Aborting"
              exit
fi



#Delete log files from previous encodes

if [ -f divx2pass.log ]; then
rm divx2pass.log
fi
if [ -f audiotmp.wav ]; then
rm audiotmp.wav
fi
if [ -f videotmp.avi ]; then
rm videotmp.avi
fi
if [ -f audiotmp.ogg ]; then
rm audiotmp.ogg
fi




#Encode the video
#First Pass
    nice -19 mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:trell:mbd=2:vqmin=2:vqmax=31:v4mv:vmax_b_frames=1:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4:vqcomp=0.6:vlelim=9:vcelim=-4:idct=7:lumi_mask=0.05:dark_mask=0.01:vstrict=-1:cbp:vfdct=1:vbitrate=$VIDEO_BITRATE:keyint=150:vpass=1 -vop expand=$X_RESOLUTION:$Y_RESOLUTION,pp=hb/vb/dr,eq=$BRIGHTNESS,scale=$X_RESOLUTION:-2,hqdn3d=8:6:12:lavcdeint -ofps $OUTPUT_FPS -zoom -sws 2 -o /dev/null  "$1"

#Second Pass
    nice -19 mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:trell:mbd=2:vqmin=2:vqmax=31:v4mv:vmax_b_frames=1:vb_strategy=0:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4:vqcomp=0.6:vlelim=9:vcelim=-4:idct=7:lumi_mask=0.05:dark_mask=0.01:vstrict=-1:cbp:vfdct=1:vbitrate=$VIDEO_BITRATE:keyint=150:vpass=2 -vop expand=$X_RESOLUTION:$Y_RESOLUTION,pp=hb/vb/dr,eq=$BRIGHTNESS,scale=$X_RESOLUTION:-2,hqdn3d=8:6:12:lavcdeint -ofps $OUTPUT_FPS -zoom -sws 2 -o ./videotmp.avi "$1"

#Extract the audio
    nice -n 19 mplayer -vc dummy -vo null -ao pcm -aofile ./audiotmp.wav "$1" 2>/dev/null

#Convert to ogg

    if [ $AUDIO_RATE -eq $ENCODE_RATE ]; then
         nice -n 19 oggenc -r -C 2 -R $AUDIO_RATE -B 16 -q $AUDIO_QUALITY -o audiotmp.ogg  audiotmp.wav
    else
         nice -n 19 oggenc -r -C 2 -R $AUDIO_RATE -B 16 -q $AUDIO_QUALITY --resample $ENCODE_RATE -o audiotmp.ogg  audiotmp.wav
    fi


#Multiplex the audio and video streams
    nice -n 19 ogmmerge -o  "$2" videotmp.avi --sync $AV_DELAY  audiotmp.ogg

#Delete the temporary files
rm audiotmp.ogg
rm audiotmp.wav
rm videotmp.avi
rm divx2pass.log

Here is the "new" mplayer.png I promised in another post.
 [ Invalid Attachment ]

endeey

  • Newbie
  • *
  • Posts: 14
    • View Profile
Opie-sh-mplayer
« Reply #6 on: March 01, 2005, 02:34:47 am »
"-ac mad" works! Thanks for the fastest fix I have ever gotten in a public forum. Sorry for my klutzyness with mplayer. I will play with the encoding script.
endeey

DeGT

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • http://
Opie-sh-mplayer
« Reply #7 on: March 01, 2005, 07:26:00 am »
You can also simply write ac=mad into /root/.mplayer/config

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh-mplayer
« Reply #8 on: March 01, 2005, 11:41:03 am »
Quote
You can also simply write ac=mad into /root/.mplayer/config
[div align=\"right\"][a href=\"index.php?act=findpost&pid=68955\"][{POST_SNAPBACK}][/a][/div]

That'll set all your decoding to mad, and it may screwup OGMs/OGGs.

You can also create individual .config's for a file, you might want to try that if you only have a few mp3 encoded files.