Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

MPlayer/MEncoder Tips and Tricks

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#21 Post by garrincha »

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."

reassuringlyoffensive
Posts: 45
Joined: 2007-10-16 15:21
Location: England, UK

#22 Post by reassuringlyoffensive »

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."

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#23 Post by garrincha »

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: 2335
Joined: 2006-06-02 16:38

#24 Post by garrincha »

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: 2335
Joined: 2006-06-02 16:38

#25 Post by garrincha »

Howto suppress MPlayer "spectral overflow in RLE" by Gonky:
http://forums.debian.net/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
debil
Posts: 1336
Joined: 2008-05-11 08:55
Location: Mazes of Menace, surrounded by brown puddings

#26 Post by debil »

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.

oompa
Posts: 25
Joined: 2008-11-14 15:39

#27 Post by oompa »

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

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#28 Post by garrincha »

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: 2335
Joined: 2006-06-02 16:38

#29 Post by garrincha »

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: 2335
Joined: 2006-06-02 16:38

#30 Post by garrincha »

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."

corra
Posts: 43
Joined: 2008-04-20 22:10
Location: Catania, Italy

#31 Post by corra »

Hi,
congratulations for this nice how-to...I'd like to know if it's possible to jump from a track to another (by keyboard) when you listen to an audio cd with mplayer. I read the manual but ->, -<, Pg up and pg down are what I'm looking for...
Thank you,
Corra

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#32 Post by garrincha »

corra wrote:Hi,
congratulations for this nice how-to...I'd like to know if it's possible to jump from a track to another (by keyboard) when you listen to an audio cd with mplayer. I read the manual but ->, -<, Pg up and pg down are what I'm looking for...
Thank you,
Corra
If you play audio cd like this:

Code: Select all

 $ mplayer -identify cdda://
it will list numbers of track and spew out information about each track (though not the title). From man mplayer:

Code: Select all

! and @
                   Seek to the beginning of the previous/next chapter
So holding down the SHIFT key and pressing @ will make mplayer jump to next track, while holding SHIFT and pressing ! will make it jump to previous.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

corra
Posts: 43
Joined: 2008-04-20 22:10
Location: Catania, Italy

#33 Post by corra »

It doesn't work...here is what happens when I press @:

Code: Select all

corrado@corrado:~$ mplayer -identify -cache 512 cdda://
MPlayer 1.0rc1-4.1.2-DFSG-free (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) M processor 1.86GHz (Family: 6, Model: 13, Stepping: 8)CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing cdda://.
ID_CDDA_TRACKS=17
ID_CDDA_TRACK_1_MSF=03:07:27
ID_CDDA_TRACK_2_MSF=03:06:34
ID_CDDA_TRACK_3_MSF=03:34:68
ID_CDDA_TRACK_4_MSF=04:08:04
ID_CDDA_TRACK_5_MSF=02:58:53
ID_CDDA_TRACK_6_MSF=04:29:33
ID_CDDA_TRACK_7_MSF=03:54:30
ID_CDDA_TRACK_8_MSF=03:53:02
ID_CDDA_TRACK_9_MSF=04:55:34
ID_CDDA_TRACK_10_MSF=04:35:10
ID_CDDA_TRACK_11_MSF=03:21:03
ID_CDDA_TRACK_12_MSF=03:05:07
ID_CDDA_TRACK_13_MSF=03:50:67
ID_CDDA_TRACK_14_MSF=04:59:08
ID_CDDA_TRACK_15_MSF=03:18:03
ID_CDDA_TRACK_16_MSF=04:02:46
ID_CDDA_TRACK_17_MSF=08:37:44
Found audio CD with 17 tracks.
Cache fill:  0.00% (0 bytes)
Track 1
ID_CDDA_TRACK=1

rawaudio file format detected.
ID_AUDIO_ID=0
ID_FILENAME=cdda://
ID_DEMUXER=rawaudio
ID_AUDIO_FORMAT=1
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_LENGTH=0.00
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
ID_AUDIO_BITRATE=1411200
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=pcm
Video: no video
Position: 0 %
A:   0.0 (unknown) of 4197.3 ( 1:09:57.2) ??,?% 0%

Exiting... (End of file)

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#34 Post by garrincha »

It worked fine with my svn mplayer however the debian-multimedia's mplayer seems to be struck. I'm not sure what's the difference in the mplayer I compiled and the one from debian repository.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

RoyFokker
Posts: 209
Joined: 2008-07-05 10:56

#35 Post by RoyFokker »

Unfortunately due to the inflexible linux sound implementation if you want to use mplayer to watch a video only and listen to audio only in another program, the audio will mix together from both apps. If you mute the PCM level on mplayer it will mute on every other running program as well.

I have found the commandline option:
mplayer -ao 0
is useful so you can listen to mp3 or flash audio with other programs while watching a muted video in mplayer.

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#36 Post by garrincha »

Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

#37 Post by garrincha »

Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

User avatar
glore2002
Posts: 101
Joined: 2008-07-19 16:33

#38 Post by glore2002 »

TonyT wrote:Good post!
re the debian-multimedia key, this is the key, the preceding characters are unnecessary:
# gpg --keyserver pgp.mit.edu --recv-keys 07DC563D1F41B907
# gpg --armor --export 1F41B907 | apt-key add -

You can also use this pgp url:
gpg --keyserver hkp://wwwkeys.eu.pgp.net --recv-keys 1F41B907
gpg --armor --export 1F41B907 | apt-key add
Sorry for waking up this old thread but it fits what I need to know:
When adding a repository, it asks for a key How do you know what that key is? Besides that What does that key mean?

Thanks in advance,
Glore2002

Athlon X2 4200. HD: 320Gb. Video: nVidia 9500GT. RAM: 4Gb. Samsung 732nPlus. Brother 2130 Printer. LiteOn DVD R/W. System: Trying to get back to Debian.

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

Re: MPlayer/MEncoder Tips and Tricks

#39 Post by garrincha »

Speed up the playback of 1080 H.264 files in MPlayer - see Addendum in the Troubleshooting Section in the 1st post.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

User avatar
garrincha
Posts: 2335
Joined: 2006-06-02 16:38

Re: MPlayer/MEncoder Tips and Tricks

#40 Post by garrincha »

Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."

Post Reply