China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-23 23:37
中国DOS联盟论坛 » DOS媒体世界 & 网络技术 (多媒体室) » mplayer——A player under the command line View 6,477 Replies 18
Original Poster Posted 2006-10-03 00:00 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
It is said that the video of a movie can be extracted in this way:

mplayer -novideo a.rm>>a.mpg

Other playways are being studied ing...

http://www1.mplayerhq.hu/MPlayer/releases/win32/MPlayer-mingw32-1.0pre8.zip


Introduction to MPlayer
With the continuous progress of technology, there are more and more media players. It is really not easy to choose a multi-functional green player. In fact, it is not a difficult task to really look for one. For example, MPlayer is a good media player. It has extremely low resource occupancy, extremely wide support for formats, and extremely many supported output devices. Moreover, what is more attractive is that it can make the playback of damaged MPEG files on VCDs smoother! I. Wide support for formats MPlayer supports a quite large number of media formats. Whether in audio playback or video playback, it can be said that the formats it supports are quite comprehensive, completely surpassing the famous "Haojie Super DVD Player". Video format support: MPEG, AVI, ASF and WMV, QuickTime and OGG/OGM, SDP, PVA, GIF. Audio format support: MP3, WAV, OGG/OGM files (Vorbis), WMA and ASF, MP4, CD audio, XMMS. Since it supports playing more audio files and video files, users can completely only choose one player. I once encountered that when using Windows Media Player, playing audio files was all normal, but when playing some video files with it, it popped up an unrecognizable format, which made me have to install other video players. So with it, there is no need to install other media players anymore! II. Wide support for output devices Another major feature of MPlayer is the wide support for output devices. It can work under X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, DirectFB, and you can also use GGI, SDL (from which you can use various driver modes they support) and some low-level hardware-related driver modes (such as Matrox, 3Dfx and RADEON, Mach64, Permedia3)! Most of them support software or hardware scaling, so you can watch movies in full screen. At the same time, MPlayer also supports displaying through hardware MPEG decoding cards, such as DVB and DXR3 and Hollywood+. It supports Hungarian, English, Czech, Cyrillic, etc., and the Korean font can be clearly enlarged and anti-aliased subtitles. It can be said that it is unique in this aspect. III. Smooth playback of damaged MPEG files This characteristic application has made me have a personal experience. I have a damaged VCD disc that has been around for a long time. The playback effect on other players is extremely poor, but when using the MPlayer player, it can play the damaged MPEG file as stable as a rock. It can not only play the damaged MPEG file in VCD, but also play the damaged AVI file that even Windows Media Player cannot open. Even AVI files without index parts can be played. You can temporarily rebuild their index or use MEncoder to permanently rebuild it, so that you can search in the movie! It is relatively stable and has good quality, and its playback speed is also very smooth. In short: Playing XviD/DivX smoothly on a low-configured computer is not a dream!

Basic features
1. Comprehensive support for formats
2. Wide support for output devices
3. Smooth playback of damaged MPEG files


Related links
Official website http://www.mplayerhq.hu/
Download http://www.mplayerhq.hu/design7/dload.html


Simply put, mplayer is the all-rounder under Linux, the most NB player, based on shell, and can use skin to support x-window. In fact, things under Linux are easy to port to Win32 (and vice versa is not necessarily true ^_^), so mplayer has naturally become the best and most NB player under the Windows command line

[ Last edited by electronixtar on 2006-10-3 at 00:09 ]

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 2 Posted 2006-10-03 00:44 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
I estimate these techniques won't work under cmd. It seems there's a gap between cmd and Linux shell.

1. Playing rmvb files online

This is the simplest because rmvb files don't involve subtitle issues. First, make sure you have installed realcodecs. Suppose I want to watch a certain rmvb movie in a ftp, the command line format is:
wget ftp://username:password@ftpserver/directory/movie.rmvb -O - | mplayer -cache 8192 -

Let's explain. The parameter "-O" of wget means save as, and the following "-" means output to StdOut; "|" is the pipe character, -cache 8192 sets the buffer size of mplayer to 8192K, and the final "-" tells Mplayer to read data from StdIn. Generally, the bandwidth required for smooth playback is about 60KB/s. If the network speed is very fast, Mplayer will automatically control wget to slow down to keep the buffer around 49%.

2. Playing avi files online

Such files generally have separate subtitle files. Subtitle files need to be downloaded to the local hard disk, and putting subtitle files into StdIn is not possible. There are generally two subtitle formats, srt and sub. For srt subtitles, assuming the storage location is tmp/movie.srt, the overall command line format is
wget ftp://username:password@ftpserver/directory/movie.avi -O - | mplayer -cache 8192 -sub tmp/movie.srt -font /usr/share/fonts/simsun.ttf -subcp cp936 -

Let's explain. "-sub" of Mplayer specifies the subtitle file, "-font" specifies the font of the subtitle file, here simsun.ttf corresponds to Simplified Chinese Songti, and for traditional Chinese subtitles, change to the traditional font file. "-subcp" specifies the encoding of the subtitle file, Simplified Chinese is cp936, and traditional Chinese is big5.

For sub format subtitles, you need to download movie.sub and movie.idx files, and the overall command line format is
wget ftp://username:password@ftpserver/directory/movie.avi -O - | mplayer -cache 8192 -vobsub movie -

Note that here "-vobsub" specifies the subtitle in sub format, and only the prefix of the subtitle file is needed later, and the suffix is not needed! The parameters "-font" and "-subcp" are not needed because sub subtitles are special bitmap formats, which have nothing to do with fonts and encodings.

Generally, the bandwidth required for smooth playback is about 130KB/s. For the problem of loading subtitles, you can refer to my other article
http://www.linuxsir.org/bbs/showthread.php?t=249835

3. Listening to songs online

There are also several methods for listening to songs online, for example, listening to all songs in a certain directory of a certain ftp server, the format is:
wget ftp://username:password@ftpserver/directory/*.mp3 -O - | mplayer -cache 1000 -
If there are Chinese characters in the file name of a certain song, then this song cannot be played. This is related to how wget obtains the list.

There are many music websites that also provide online listening to songs (such as http://music.trueice.net). After clicking play, a list file will be generated (assuming it is stored in tmp/playlist.m3u), so wget can be used to read this list file and download it, the format is:
wget -i tmp/playlist.m3u -O - | mplayer -cache 1000 -

If such a website requires logging in to play, that is, requires Cookies (such as http://music.xjtust.com), it doesn't matter, the command format is as follows:
wget -i tmp/playlist.m3u --load-cookies .mozilla/firefox/default/cookies.txt - O | mplayer -cache 1000 -
Here, "--load-cookies" is followed by the file where Firefox stores Cookies.

There are also some websites that must be played with Winamp, and XMMS can't, that's okay, the command format is as follows:
wget -i tmp/playlist.m3u --load-cookies .mozilla/firefox/default/cookies.txt --user-agent="WinampMPEG/5.0" - O | mplayer -cache 1000 -
This will send the player identifier of Winamp to the server.

Generally, the bandwidth required for smooth playback is about 20KB/s.

4. Others

There is also a parameter of wget that is very useful when connecting to an ftp server, which is "--no-passive-ftp". As the name implies, without this parameter, it is Passive mode, and with it, it is Port mode. If during playback, the speed of wget becomes 0, you can try adding or removing this parameter.

When playing a list of mp3 files, it is possible that wget is downloading one of the files, but mplayer just doesn't play it. This is because mplayer defaults to judging the audio decoding type from the file extension, and possibly due to the encoding problem of the file name, there is no relevant information in stdin. Then mplayer may not know how to decode and refuse to play. You can add such a parameter "-demuxer 17" after mplayer to force it to process according to the audio format.

The basic command for playing with curl is:
curl url -o - | mplayer -cache -

Note that the save parameter of curl is lowercase o, but I haven't tried whether curl supports Cookies and whether it can set user-agent.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 3 Posted 2006-10-03 00:53 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Let me think. Wait, no, the original text is in Chinese. Let's translate it properly.

Another thought, if mplayer supports outputting video to handle 3, left channel to handle 4, right channel to handle 5, then in cmd we can do mplayer xxx.avi 3>xxx.avi 4>xxx.wav 5>xxx.wav, right? ^_^

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 4 Posted 2006-10-03 07:52 ·  中国 四川 阿坝藏族羌族自治州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Things under Linux are really good. I'm currently learning Linux.
Floor 5 Posted 2006-10-03 08:22 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
I have MPLAYER in my LINUX, but is there a pure DOS version?
Floor 6 Posted 2006-10-03 08:52 ·  中国 四川 成都 电信
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Mplayer still needs codec support, so it's not very realistic under pure DOS. You can try hx~

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 7 Posted 2006-10-06 21:10 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Originally posted by electronixtar at 2006-10-3 12:44 AM:
I guess these tricks don't work under cmd. It seems there is a gap between cmd and Linux shell.


Actually, the Linux shell is the Unix shell. The Unix shell has been developed for decades, mainly aimed at experts, so it's powerful but also complicated. Later, as one of the Unix-like operating systems, Linux directly copied the classic Unix shell environment, which is basically the same, and is more powerful than cmd.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 8 Posted 2006-10-06 21:13 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Originally posted by electronixtar at 2006-10-3 08:52 AM:
Mplayer still needs codec support, so it's not really feasible in pure DOS. You can try hx~~


I tried it some time ago. Mplayer can run in pure DOS with HX, and its codecs can also be used. However, since HX itself currently has some issues, in pure DOS + HX, Mplayer can only play the audio of multimedia formats such as RMVB and AVI (using the -ao win32 parameter), but cannot play the video. But you can save the video as formats like PNG (using the -vo xx parameter) to view later.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 9 Posted 2006-10-06 21:34 ·  中国 浙江 衢州 江山市 电信
银牌会员
★★★
Credits 1,270
Posts 548
Joined 2004-05-31 00:00
22-year member
UID 25754
Gender Male
Status Offline
Wanting to watch DVDs under DOS is just a dream.
Floor 10 Posted 2006-10-07 17:20 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Originally posted by weilong888 at 2006-10-6 09:34 PM:
Wanting to view a DVD under DOS is just a dream.


It's not entirely a dream. You can try the following DVD4DOS beta version, although its functions are not very strong yet:

ftp://ftp.elf.stuba.sk/pub/pc/graph/dvd4dos1.zip
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 11 Posted 2006-10-08 01:54 ·  中国 浙江 衢州 电信
银牌会员
★★★
Credits 1,270
Posts 548
Joined 2004-05-31 00:00
22-year member
UID 25754
Gender Male
Status Offline
Let's try it. The webmaster is amazing!
Floor 12 Posted 2006-10-08 05:19 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
It seems that it is not very realistic to play RM videos under pure DOS personally. First, pure DOS lacks drivers for hardware video acceleration. Second, the graphics mode of pure DOS seems to have very poor support for video playback.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 13 Posted 2006-10-08 07:29 ·  中国 浙江 衢州 电信
银牌会员
★★★
Credits 1,270
Posts 548
Joined 2004-05-31 00:00
22-year member
UID 25754
Gender Male
Status Offline
It's really not easy to test. It didn't succeed on VPC. On the actual machine, I don't dare to test easily.
Floor 14 Posted 2006-10-09 22:02 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
mplayer e:\wma\*.wma 歌曲 continuous play
Floor 15 Posted 2006-10-11 05:32 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Forum Jump: