When trying to play a video, I get a black screen. It’s the same with VLC and mplayer.
alias mplayer='mplayer -vo x11'
Go to Tools -> Preferences -> Video. At the Output, choose “X11 video output (XCB)” from the dropdown list. If it doesn’t work, untick the option “Accelerated video output (Overlay)”.
When I play a song with mplayer (from the package mplayer2), the song is played but mplayer doesn’t quit, I don’t get the prompt back. This is annoying if I want to play sound effects from a script and tens of mplayer processes are hanging…
Add the “
-ao alsa” switch as a temporary solution (tip from here):
mplayer -ao alsa audio.mp3
Mplayer has an option for that :) Try this:
mplayer -vf pp=lb interlaced_video.iso
This procedure is called deinterlacing.
VLC can do this too. Available under Video -> Deinterlace. You can also choose the deinterlacing method under Video -> Deinterlace mode.
mplayer -endpos 00:00:30 song.mp3
I have an alarm script that loads a bunch of MP3s and starts playing them in random order in the morning. However, some songs are very long, some of them are boring, etc. So I prefer playing just the first X seconds of each song.
This tip is from here.
Let our test file be “
Getting video info
mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify
It will produce a long output. You can refine the output:
(mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify | grep ID_) 2>/dev/null
Again, it will produce a long output that I omit. The video length is here (given is sec.):
Another interesting line is the video summary:
(mplayer '/tmp/test.wmv' -ao null -vo null -frames 1 -identify | grep 'VIDEO:') 2>/dev/null
VIDEO: [WMV3] 320x240 24bpp 1000.000 fps 386.0 kbps (47.1 kbyte/s)
Taking a screenshot at a given time
mplayer '/tmp/test.wmv' -ss '20' -noautosub -frames 1 -ao null -vo png:outdir='/tmp'
Here we take a screenshot from the video at 20 sec. The output file will be
/tmp/00000001.png (mplayer gives this name automatically).
Ref.: I found these tricks in this project.
You use Midnight Commander (mc) for all your file operations. So far it’s not a problem :) However, when you hit Enter on a file, you would like to set what application mc should use for opening the given file.
For instance, you want to open an
.avi file with VLC instead of X player, etc.
Steps to follow:
cd ~/.mc cp /etc/mc/mc.ext . ln -s mc.ext bindings
That is, copy the global
mc.ext to your local
.mc directory and put a symbolic link on it called
bindings. Now you can start customizing your local
Don’t forget to restart mc after editing
(1) You want to open all your video files with VLC. You also want to add support for
# add these lines regex/\.([wW][mM][vV])$ Include=video # modify the include/video section include/video #Open=(mplayer %f >/dev/null 2>&1 &) # for mplayer Open=(vlc %f >/dev/null 2>&1 &) # for VLC
.docx files with OpenOffice.org.
# add these lines regex/\.([Dd][oO][cC][xX])$ Open=(ooffice %f &)
(Thanks for the mc mailing list for their help).
To customize mplayer, modify the file
~/.mplayer/config. Every time you launch mplayer, settings are read from this file. Reduce command-line arguments and put them in this file.
Here is my config file:
# Write your default config options here! # Font font=/home/jabba/.mplayer/fonts/comic.ttf fs = "1" #subfont-text-scale = "3" subfont-text-scale = "4" #subfont-text-scale = "5" subcp = "iso-8859-2" #aspect="4:3" #aspect="16:9" # audio output: ALSA # PulseAudio caused a problem in Jaunty 9.04 beta ao=alsa # video driver vo=xv # Find subtitle files (1: load all subs containing movie name) sub-fuzziness=1 # Font encoding subfont-encoding=unicode # Subtitle file encoding utf8=yes # Resample the font alphamap (10: bold black outline) ffactor=10 # Font size (2: proportional to movie width) subfont-autoscale=2 # Font blur radius (default: 2) subfont-blur=1.0 # font outline thickness (default: 2) subfont-outline=1.0
For subtitles I use the Comic font. Download it somewhere and specify its absolute path. Videos start in fullscreen (
fs). Previously I had some problems with the accents in Hungarian subtitles but with
subcp I managed to solve it. The other settings are mainly for the subtitles.