MPlayer/MEncoder Tips and Tricks

Share your own howto's etc. Not for support questions!

Postby ingo » 2007-08-30 10:50

The stream I tried it on was the one you had posted but it was the next morning that I tried to play it, so that might have been the reason.

Will wait for Saturday and the next round of Premiership games to give it another try - will report back or be too depressed to log on - depending on the outcome...

Cheers for all your help, anyway :)
User avatar
ingo
 
Posts: 197
Joined: 2007-04-15 14:15
Location: http://www.hi-motorbiketours.com

How I got Mplayer to stream everything.

Postby reassuringlyoffensive » 2008-01-05 01:29

--REVISED 16 Jan 2008--

If you haven't already you should

apt-get remove xine-plugin totem-mozilla mozilla-plugin-vlc kaffeine-mozilla helix-player mozilla-helix-player

apt-get install mplayer mozilla-mplayer w32codecs (And RealPlayer, try and get a deb file and use the "dpkg -i"command, see bottom of how-to. Check if it's in the repo first. You can watch RM streams with MPlayer, but it's a bit random. You need w64codecs if you run a 64bit Debian)

Then paste the following settings into gedit $HOME/.mplayer/mplayerplug-in.conf (don't worry if it's empty or if you didn't already have this file there). They improve streaming a great deal with certain sites which have caused problems.


download=1
cachesize=1024
cache-percent=25
keep-download=0
dload-dir=$HOME
noembed=0
autoplay=1
enable-wmp=1
enable-qt=1
enable-rm=0
enable-gmp=1
enable-dvx=1
enable-mpeg=1
enable-mp3=1
enable-midi=0
enable-pls=1
enable-ogg=1
enable-smil=1
enable-helix=1
nomediacache=0
nopauseonhide=1
rtsp-use-tcp=0
rtsp-use-http=0

Then rm $HOME/.mozilla/firefox/pluginreg.dat

If you use RealPlayer, make sure you change the values of rm, smil and helix to '0' in the MPlayer conf.

Keep-download is an easy way to save streaming media, just change the value to 1 and it will download to your home directory. For an explaination of what the other settings do check out http://mplayerplug-in.sourceforge.net/config.php

You can add vo= and ao= if you want to change the default video and audio output. Otherwise you don't really need those settings in the list. You can add other settings from the link above if you think they will be useful to you.

Works great for me as outlined above. Only have problems with abcnews.com due to their belief that only Microsoft users matter. No big loss though.

Also, make sure you completely remove Helix Xine, VLC and Totem Mozilla plugins as they conflict with MPlayer, and Helix conflicts with RealPlayer.

Nathan

FYI: The Ubuntu RealPlayer will work in Debian, and there is a fix in my Ubuntu how-to for when RealPlayer stutters or freezes while playing. There are also other tips and fixes that will work in Debian. Go here.
Last edited by reassuringlyoffensive on 2008-02-16 03:09, edited 16 times in total.
"Imagination is a quality given a man to compensate him for what he is not, and a sense of humour was provided to console him for what he is."
reassuringlyoffensive
 
Posts: 48
Joined: 2007-10-16 15:21
Location: England, UK

Postby ingo » 2008-01-05 03:36

Cheers Nathan, but I've got the sopcast player up and running now... Good advice though if it works ;)
User avatar
ingo
 
Posts: 197
Joined: 2007-04-15 14:15
Location: http://www.hi-motorbiketours.com

Postby reassuringlyoffensive » 2008-01-05 17:43

ingo wrote:Cheers Nathan, but I've got the sopcast player up and running now... Good advice though if it works ;)


That's good. I posted it as these settings gave me the best performance. Mplayer doesn't start too soon, BBC streams work well (even real) and stage6 (divx.com) works well too.

Give it a try.

Nathan
"Imagination is a quality given a man to compensate him for what he is not, and a sense of humour was provided to console him for what he is."
reassuringlyoffensive
 
Posts: 48
Joined: 2007-10-16 15:21
Location: England, UK

Postby reassuringlyoffensive » 2008-01-16 19:15

My MPlayer how-to should work better with rm and ram streams now.

Nathan
"Imagination is a quality given a man to compensate him for what he is not, and a sense of humour was provided to console him for what he is."
reassuringlyoffensive
 
Posts: 48
Joined: 2007-10-16 15:21
Location: England, UK

Postby garrincha » 2008-01-20 20:16

Added a link to a nice tips & tricks in Linux Journal: Multimedia Dynamite, Linux Journal, October 1st, 2007.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby reassuringlyoffensive » 2008-01-22 16:47

Changed the conf to edit to gedit $HOME/.mplayer/mplayerplug-in.conf as it totally overrides the /etc conf.

Added rm $HOME/.mozilla/firefox/pluginreg.datas it updates Firefox on what plugins and settings you are using.

Nathan
"Imagination is a quality given a man to compensate him for what he is not, and a sense of humour was provided to console him for what he is."
reassuringlyoffensive
 
Posts: 48
Joined: 2007-10-16 15:21
Location: England, UK

Postby garrincha » 2008-01-25 02:48

It may or may not be relevant, however I found that my MPlayer playback of high quality videos is much smoother, crisp and crystal clear when playing in Enlightenment DR17 window manager (I use the http://edevelop.org/debian/ repo). It was noticeably smoother than in Fluxbox for example especially the re-encoded *.avi videos. DR17 is indeed excellent for multimedia.
Image
Also, it would be more efficient if you compile & build MPlayer from source. I built different player to optimize for two of my PC, an AMD 2.4GHz and an old PII 350mHz.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby garrincha » 2008-03-01 02:04

Rewritten HOWTO and dditional tips including creating and editing video for playback using EDL (Edit Decision List) - useful for skipping commercials, muting & cutting some portion of video for kids, and quick editing.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby garrincha » 2008-09-29 23:43

Howto suppress MPlayer "spectral overflow in RLE" by Gonky:
viewtopic.php?t=31313
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby debil » 2008-11-14 08:07

Here's a little bash script that executes mplayer to shuffle play all the music on your machine. Or sleep for certain amount of time before doing so. Use it as a kind of an alarm clock or an egg timer. It also checks if the playlist exists and if it does not, it is generated.

Code: Select all
#!/bin/bash

# Edit variables as you wish
AUDIOPATH='/media/disk/Storage/Audio/'
PLAYLISTDIR='/home/username/.playlists'
PLAYLIST='/home/username/.playlists/all'
TEMPLIST='/home/username/temporaryplaylist'
MPLAYER=$(which mplayer)

if [ ! -n $MPLAYER ]; then
    echo "Install mplayer and try again."
    exit 1
fi

make_playlist () {

    if [ -d "$PLAYLISTDIR" ]; then
        touch "$PLAYLIST"
    else
        mkdir -p "$PLAYLISTDIR"
        touch "$PLAYLIST"
    fi

    touch "$TEMPLIST"

    find $AUDIOPATH -print -type f > "$TEMPLIST"
    grep -i 'mp3$' "$TEMPLIST" > "$PLAYLIST"
    grep -i 'ogg$' "$TEMPLIST" >> "$PLAYLIST"
    grep -i 'm4a$' "$TEMPLIST" >> "$PLAYLIST"
    grep -i 'mid$' "$TEMPLIST" >> "$PLAYLIST"
    grep -i 'wma$' "$TEMPLIST" >> "$PLAYLIST"
    grep -i 'flac$' "$TEMPLIST" >> "$PLAYLIST"
    grep -i 'mp4$' "$TEMPLIST" >> "$PLAYLIST"

    rm "$TEMPLIST"

    echo Total files: $(wc -l "$PLAYLIST")
}

checkplay() {
   if [ ! -f "$PLAYLIST" ]; then
      make_playlist
      $MPLAYER -shuffle -playlist $PLAYLIST
   else
      $MPLAYER -shuffle -playlist $PLAYLIST
   fi
}

usage() {
    cat << EOF
Usage: $(basename "$0") [ARG]

  <digit>        Doze for <digit> seconds and start playing
  <digit>m     Doze for <digit> minutes and start playing
  <digit>h      Doze for <digit> hours and start playing
  -c | --create  Create playlist w/o playing it
  -h | --help     Show this help
  <digit> path-to-track
                      Doze for <digit> and play specified track,
                      continuing with random play

                      w/o ARG playing starts immediately
EOF
}

# Show usage
if [ "$1" == "-h" -o "$1" == "--help" ]; then
    usage
    exit 0
fi

# Just create playlist w/o playing it
if [ "$1" == "-c" -o "$1" == "--create" ]; then
    make_playlist
    exit 0
fi

# Start playing immediately
if [ "$#" -eq 0 ]; then
    checkplay
    exit 0
fi

# Doze first
if [ "$#" -eq 1 ]; then
    sleep "$1"
    checkplay
    exit 0
fi

# Doze and play "alarm"
if [ "$#" -eq 2 ]; then
    sleep "$1"
    $MPLAYER "$2"
    checkplay
    exit 0
fi


Note: I have also added MIDI files to be grepped into the playlist even though mplayer does not handle them. That's just because I consider them as "songs" too and this way can keep track of them as well.

Edit: Updated code somewhat.
Edit2: Updated code somewhat more.
Last edited by debil on 2010-02-21 00:09, edited 5 times in total.
Q: Why is the Eunux kernel so bloated?
A: It was made in the image of its founder.
User avatar
debil
 
Posts: 1338
Joined: 2008-05-11 08:55
Location: Mazes of Menace, surrounded by brown puddings

Postby oompa » 2008-12-05 13:31

I just want to mention smplayer which intends to be a complete frontend to mplayer.
oompa
 
Posts: 25
Joined: 2008-11-14 15:39

Postby garrincha » 2008-12-08 17:43

oompa wrote:I just want to mention smplayer which intends to be a complete frontend to mplayer.


Just a note that this project is not related to mplayer maintained by either Debian developer or Christian Marillat (debian-multimedia) and is not associated with www.mplayerhq.hu.

SMplayer is just one of several frontends that use mplayer and I think that it's maintained by Ubuntu developer.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby garrincha » 2008-12-18 05:00

It's over a year ago, however this write-up should be useful for anyone interested in playing 1080p H.264 video in Debian (and other distro) using a fairly mid-size range hardward:

HD Video Playback in Linux
http://blog.charlies-server.com/2007/09 ... k-in-linux

Check out a couple of mplayer options that you can use in this article.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

Postby garrincha » 2009-02-03 03:01

Although I use MPlayer's mencoder exclusively, I sometime use ffmpeg which can be quite powerful (non-linear) video editing tool as demonstrated in this excellent video tutorial, "Video Editing Magic with ffmpeg" by Elliot Isaacson. The tutorial cover transcoding, creating animations, screen captures and slow-motion effects:

http://www.linuxjournal.com/video/linux ... gic-ffmpeg
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2340
Joined: 2006-06-02 16:38

PreviousNext

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable