Difference between revisions of "MPlayer"
m |
m (→Problems) |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
MPlayer is a command line application which has different optional GUI front-ends for each of its supported operating systems. Commonly used GUIs are gMplayer written in GTK+, MPlayer OS X Extended (for Mac OS X) and MPUI-hcb (for Windows). Cross-platform GUIs are also available, like SMPlayer (Windows and Linux). | MPlayer is a command line application which has different optional GUI front-ends for each of its supported operating systems. Commonly used GUIs are gMplayer written in GTK+, MPlayer OS X Extended (for Mac OS X) and MPUI-hcb (for Windows). Cross-platform GUIs are also available, like SMPlayer (Windows and Linux). | ||
+ | |||
+ | MPlayer is a movie player for Linux and also works on Windows and other operating systems. It plays most MPEG/VOB, AVI, ASF/WMA/WMV, RM, QT/MOV/MP4, Ogg/OGM, MKV, VIVO, FLI, NuppelVideo, yuv4mpeg, FILM and RoQ files, supported by many native and binary codecs. You can watch VCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264. MPlayer has a fully configurable, command-driven control layer which allows you to control MPlayer using keyboard, mouse, joystick or remote control. | ||
+ | |||
+ | video and audio output drivers: X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, libcaca, DirectFB, Quartz, Mac OS X CoreVideo, GGI, SDL, VESA. | ||
+ | |||
+ | The mplayer family: | ||
+ | #mplayer - command line driven video and audio player | ||
+ | #mencoder - video encoder and converter | ||
+ | #gmplayer - MPlayer with a graphical user interface | ||
+ | |||
+ | == mplayer == | ||
+ | |||
+ | For Windows users go to the downloads page and look for the link "MPlayer SVN Windows with SMPlayer GUI (recommended)" You can use the SMPlayer frontend or see our front end section below for other examples, including the popular MPUI front end for Windows. | ||
+ | |||
+ | === Useful MPlayer Command Line Operations === | ||
+ | |||
+ | These commands are to be used from console (MSDOS Prompt or Linux Shell) etc | ||
+ | |||
+ | mplayer filename (open a video or audio file) | ||
+ | mplayer filename -subfile filename.sub (video file with subtitles) | ||
+ | mplayer -vcd <trackno> (open a vcd track) | ||
+ | mplayer -o vesa -cache 8192 -fs -dvd <trackno> (play dvd using vesa mode) | ||
+ | mplayer -framedrop (fix slow hardware related video skips) | ||
+ | |||
+ | Playing a DVD with MPlayer on Linux | ||
+ | |||
+ | mplayer -dvd <track> [-dvd-device <device>] | ||
+ | mplayer -dvd 1 -dvd-device /dev/hdc | ||
+ | |||
+ | VCD on Linux | ||
+ | |||
+ | mplayer vcd://1 -cdrom-device /dev/hdc | ||
+ | |||
+ | Open Analog TV Tuner or Capture Device | ||
+ | |||
+ | mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:amode=1:outfmt=yv12:device=/dev/video0 | ||
+ | |||
+ | === rtsp === | ||
+ | although mplayer does rtsp and depending on how it is compiled, it demonstrated poor ability with dropped frames compared to other options. | ||
+ | mplayer rtsp://192.168.0.15:554 | ||
+ | obviously depends on encoding, however better results were achieved by alternatively using ffplay like this: | ||
+ | ffplay rtsp://192.168.0.15:554 | ||
+ | ffplay uses FFmpeg libraries and the SDL library. On Ubuntu Mplayer has it's own FFmpeg implementation. Depending on your distribution and/or if you build from source your results will differ. You can build mplayer against the ffmpeg you have installed on your system. To do so add --disable-libavcodec_a --disable-libavutil_a --disable-libavformat_a --disable-libpostproc_a and --disable-libswscale_a to the mplayer configure line. To find out how your mplayer is linked type this: | ||
+ | ldd `which mplayer`ldd `which mplayer`|grep ffmpeg | ||
+ | |||
+ | == mencoder == | ||
+ | |||
+ | MEncoder can convert all the formats that MPlayer recognizes into a variety of compressed and uncompressed formats using different codecs. It can decode all media which MPlayer can decode and it supports all filters which MPlayer can use. | ||
+ | |||
+ | Supported filters: cropping, scaling, vertical flipping, horizontal mirroring, expanding to create letterboxes, rotating, brightness/contrast, changing the aspect ratio, colorspace conversion, hue/saturation, color-specific gamma correction, filters for reducing the visibility of compression artifacts caused by MPEG compression (deblocking, deringing), automatic brightness/contrast enhancement (autolevel), sharpness/blur, denoising filters, several ways of deinterlacing, and reversing telecine. | ||
+ | |||
+ | === Rip / Encode a DVD === | ||
+ | |||
+ | You can use libavcodec to encode the video. Identify the source video. | ||
+ | * Identify video framerate | ||
+ | * Identify video frames/fields/pulldown/telecine | ||
+ | * Encode constant bitrate (CBR), constant quantizer, and multipass | ||
+ | * Crop black borders or letterboxing | ||
+ | * select resolution and bitrate | ||
+ | |||
+ | see: http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-dvd-mpeg4.html | ||
+ | |||
+ | === Rip from TV or Composite Source (V4L capture) === | ||
+ | |||
+ | Using mencoder for this is considered inefficient. It is possible to capture and encode live TV in [[H.264]]. | ||
+ | |||
+ | mencoder -tv driver=v4l2:device=/dev/video0$DEV:fps=30000/1001:audiorate=32000:adevice=/dev/dsp$DEV:input=0:amode=1:normid=4:width=512:height=384-ovc x264 -x264encopts threads=2:bitrate=800:subq=2:me=2:frameref=4:8x8dct-oac mp3lame -lameopts cbr:br=96 -endpos $TIM -o $DIR/$FIL.avi tv:// > /dev/null | ||
== GUI Frontends == | == GUI Frontends == | ||
− | === SMPlayer === | + | === [http://smplayer.sourceforge.net/ SMPlayer] === |
+ | This is a Qt5 front-end for mplayer. SMPlayer remembers the settings of all files you play including time position. | ||
+ | |||
+ | Warning: The developers added an annoying DONATE NAG that occasionally pops up on launch. See [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964359 Debian Bug report logs - #964359] and request to remove from Debian repository. | ||
+ | |||
+ | Playback Speed Shortcuts | ||
+ | Action SMPlayer Shortcut Keys | ||
+ | Normal speed Backspace | ||
+ | Half the speed of the video Shift + ] | ||
+ | Double speed of video Shift + [ | ||
+ | |||
+ | Zoom Shortcuts | ||
+ | Action SMPlayer Shortcut Keys | ||
+ | Zoom increase E | ||
+ | Zoom decrease W | ||
+ | Zoom 100% Ctrl + 1 | ||
+ | Zoom 200% Ctrl + 2 | ||
+ | Reset Shift + E | ||
+ | Auto zoom Shift + W | ||
+ | Zoom for 16:9 Shift + A | ||
+ | Zoom for 2.35:1 Shift + S | ||
+ | |||
+ | === [http://mpui.sourceforge.net/ MPUI] === | ||
+ | |||
+ | == Problems == | ||
+ | ===SMPlayer on X11 error Could not find the Qt platform plugin=== | ||
+ | |||
+ | Error experienced on Mint Linux when using MPlayer with SMPlayer front-end. This is on x11 and not Wayland. | ||
+ | |||
+ | $ smplayer | ||
+ | qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" | ||
+ | This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. | ||
+ | |||
+ | Aborted (core dumped) | ||
+ | |||
+ | The problem is caused by the environment variable LD_LIBRARY_PATH. Some poorly written software, such as newshosting, requires LD_LIBRARY_PATH set to an alternative location such as within the installation directory of newshosting, as an example. SMPlayer relies on access to the "correct" library, not the hacked up copy needed for poorly written software. Type this in console: | ||
+ | unset LD_LIBRARY_PATH | ||
+ | |||
+ | Now SMPlayer should function again. ''Be careful running hack-job poorly written scabware like newshosting or other software that requires you to substitute libraries in local directories over system libraries.'' | ||
+ | |||
+ | On a related note, if you are using Wayland rather than x11 there are discussions online about SMPlayer compatibility not covered here. | ||
+ | |||
+ | == References and External Resources == | ||
− | + | * http://www.mplayerhq.hu/design7/news.html | |
| | ||
Line 19: | Line 128: | ||
[[Category:Digital Video]] | [[Category:Digital Video]] | ||
[[Category:Desktop Software]] | [[Category:Desktop Software]] | ||
+ | [[Category:Video Tools]] | ||
+ | [[Category:MP3]] |
Latest revision as of 20:03, 10 February 2024
MPlayer is one of the best media player applications available. Is is almost strictly monolithic, which means that it mainly consists of a single, relatively small executable, that already contains all necessary codecs. It doesn't need Windows codecs, but does have the ability to utilize external codecs for new formats it may not support natively.
MPlayer is available for all major operating systems, including Linux and other Unix-like systems, Microsoft Windows and Mac OS X. Versions for OS/2, Syllable, AmigaOS and MorphOS are also available.
MPlayer is a command line application which has different optional GUI front-ends for each of its supported operating systems. Commonly used GUIs are gMplayer written in GTK+, MPlayer OS X Extended (for Mac OS X) and MPUI-hcb (for Windows). Cross-platform GUIs are also available, like SMPlayer (Windows and Linux).
MPlayer is a movie player for Linux and also works on Windows and other operating systems. It plays most MPEG/VOB, AVI, ASF/WMA/WMV, RM, QT/MOV/MP4, Ogg/OGM, MKV, VIVO, FLI, NuppelVideo, yuv4mpeg, FILM and RoQ files, supported by many native and binary codecs. You can watch VCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV and H.264. MPlayer has a fully configurable, command-driven control layer which allows you to control MPlayer using keyboard, mouse, joystick or remote control.
video and audio output drivers: X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, libcaca, DirectFB, Quartz, Mac OS X CoreVideo, GGI, SDL, VESA.
The mplayer family:
- mplayer - command line driven video and audio player
- mencoder - video encoder and converter
- gmplayer - MPlayer with a graphical user interface
Contents
mplayer
For Windows users go to the downloads page and look for the link "MPlayer SVN Windows with SMPlayer GUI (recommended)" You can use the SMPlayer frontend or see our front end section below for other examples, including the popular MPUI front end for Windows.
Useful MPlayer Command Line Operations
These commands are to be used from console (MSDOS Prompt or Linux Shell) etc
mplayer filename (open a video or audio file) mplayer filename -subfile filename.sub (video file with subtitles) mplayer -vcd <trackno> (open a vcd track) mplayer -o vesa -cache 8192 -fs -dvd <trackno> (play dvd using vesa mode) mplayer -framedrop (fix slow hardware related video skips)
Playing a DVD with MPlayer on Linux
mplayer -dvd <track> [-dvd-device <device>] mplayer -dvd 1 -dvd-device /dev/hdc
VCD on Linux
mplayer vcd://1 -cdrom-device /dev/hdc
Open Analog TV Tuner or Capture Device
mplayer tv:// -tv driver=v4l2:norm=NTSC:input=0:amode=1:outfmt=yv12:device=/dev/video0
rtsp
although mplayer does rtsp and depending on how it is compiled, it demonstrated poor ability with dropped frames compared to other options.
mplayer rtsp://192.168.0.15:554
obviously depends on encoding, however better results were achieved by alternatively using ffplay like this:
ffplay rtsp://192.168.0.15:554
ffplay uses FFmpeg libraries and the SDL library. On Ubuntu Mplayer has it's own FFmpeg implementation. Depending on your distribution and/or if you build from source your results will differ. You can build mplayer against the ffmpeg you have installed on your system. To do so add --disable-libavcodec_a --disable-libavutil_a --disable-libavformat_a --disable-libpostproc_a and --disable-libswscale_a to the mplayer configure line. To find out how your mplayer is linked type this:
ldd `which mplayer`ldd `which mplayer`|grep ffmpeg
mencoder
MEncoder can convert all the formats that MPlayer recognizes into a variety of compressed and uncompressed formats using different codecs. It can decode all media which MPlayer can decode and it supports all filters which MPlayer can use.
Supported filters: cropping, scaling, vertical flipping, horizontal mirroring, expanding to create letterboxes, rotating, brightness/contrast, changing the aspect ratio, colorspace conversion, hue/saturation, color-specific gamma correction, filters for reducing the visibility of compression artifacts caused by MPEG compression (deblocking, deringing), automatic brightness/contrast enhancement (autolevel), sharpness/blur, denoising filters, several ways of deinterlacing, and reversing telecine.
Rip / Encode a DVD
You can use libavcodec to encode the video. Identify the source video.
- Identify video framerate
- Identify video frames/fields/pulldown/telecine
- Encode constant bitrate (CBR), constant quantizer, and multipass
- Crop black borders or letterboxing
- select resolution and bitrate
see: http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-dvd-mpeg4.html
Rip from TV or Composite Source (V4L capture)
Using mencoder for this is considered inefficient. It is possible to capture and encode live TV in H.264.
mencoder -tv driver=v4l2:device=/dev/video0$DEV:fps=30000/1001:audiorate=32000:adevice=/dev/dsp$DEV:input=0:amode=1:normid=4:width=512:height=384-ovc x264 -x264encopts threads=2:bitrate=800:subq=2:me=2:frameref=4:8x8dct-oac mp3lame -lameopts cbr:br=96 -endpos $TIM -o $DIR/$FIL.avi tv:// > /dev/null
GUI Frontends
SMPlayer
This is a Qt5 front-end for mplayer. SMPlayer remembers the settings of all files you play including time position.
Warning: The developers added an annoying DONATE NAG that occasionally pops up on launch. See Debian Bug report logs - #964359 and request to remove from Debian repository.
Playback Speed Shortcuts Action SMPlayer Shortcut Keys Normal speed Backspace Half the speed of the video Shift + ] Double speed of video Shift + [
Zoom Shortcuts Action SMPlayer Shortcut Keys Zoom increase E Zoom decrease W Zoom 100% Ctrl + 1 Zoom 200% Ctrl + 2 Reset Shift + E Auto zoom Shift + W Zoom for 16:9 Shift + A Zoom for 2.35:1 Shift + S
MPUI
Problems
SMPlayer on X11 error Could not find the Qt platform plugin
Error experienced on Mint Linux when using MPlayer with SMPlayer front-end. This is on x11 and not Wayland.
$ smplayer qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Aborted (core dumped)
The problem is caused by the environment variable LD_LIBRARY_PATH. Some poorly written software, such as newshosting, requires LD_LIBRARY_PATH set to an alternative location such as within the installation directory of newshosting, as an example. SMPlayer relies on access to the "correct" library, not the hacked up copy needed for poorly written software. Type this in console:
unset LD_LIBRARY_PATH
Now SMPlayer should function again. Be careful running hack-job poorly written scabware like newshosting or other software that requires you to substitute libraries in local directories over system libraries.
On a related note, if you are using Wayland rather than x11 there are discussions online about SMPlayer compatibility not covered here.
References and External Resources