|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『楼 主』:
mplayer——命令行下的播放器
使用 LLM 解释/回答一下
据说可以这样提取电影的视频:
mplayer -novideo a.rm>>a.mpg
其他的玩法正在研究ing...
http://www1.mplayerhq.hu/MPlayer/releases/win32/MPlayer-mingw32-1.0pre8.zip
MPlayer简介
随着技术的不断进步,媒体播放器已越来越多,选择一款多功能绿色播放器,实在不容易,其实要真正去寻找也不是件难事。如MPlayer 它就是个好的媒体播放器,资源占用率极低,支持格式极广、输出设备支持极多,同时更为诱人的是它可以让VCD 上损坏的MPEG文件播放更流畅!一、支持格式多 MPlayer 支持相当多的媒体格式,无论在音频播放还是在视频播放方面,可以说它支持的格式是相当全面的,完全能够胜于有名的“豪杰超级解霸”。视频格式支持:MPEG、AVI、ASF 与WMV、QuickTime与 OGG/OGM、SDP、PVA、GIF。音频格式支持:MP3、WAV、OGG/OGM 文件(Vorbis)、WMA与 ASF、MP4、CD音频、XMMS。由于它支持播放音频文件和视频文件比较多,这样一来用户完全只用选择一个播放器即可。笔者曾在使用Windows Media Player时,听音频文件一切正常,但再用它播放一些视频文件时,它却弹出不可识别的格式,使我不得不再安装其它的视频播放器。所以说有了它就不用再安装其它的媒体播放器啦!二、支持输出设备广 MPlayer的另一个大的特色是支持广泛的输出设备。它可以在X11、Xv、DGA、 OpenGL、SVGAlib、fbdev、AAlib、DirectFB下工作,而且你也能使用 GGI、SDL(由此可以使用它们支持的各种驱动模式)和一些低级的硬件相关的驱动模式 (比如 Matrox、3Dfx 和RADEON、Mach64、Permedia3)!它们大多数支持软件或者硬件缩放,因此你能在全屏下观赏电影。同时,MPlayer 还支持通过硬件MPEG解码卡显示,诸如DVB 和DXR3与Hollywood+。支持匈牙利语、英语、捷克语、西里尔语等等,韩语字体的清晰放大并且反锯齿的字幕,可以说它在这一方面堪称一绝。三、让损坏的MPEG文件流畅播放这一特色应用,让笔者更是亲有体会,笔者有一张年代已久的破损VCD光碟,在其它播放器上播放效果极差,但是使用MPlayer播放器,它能够稳如泰山地播放被破坏的 MPEG 文件。不仅能播放VCD中破损的MPEG文件,同时还能播放连 Windows Media Player都打不开的已被损坏的AVI文件。甚至,没有索引部分的AVI文件都可播放,你能暂时重建它们的索引或者用MEncoder永久重建,使你能够在影片中搜索!稳定和质量都比较好,而且它的播放速度也很流畅。总之:想在低配备计算机上流畅播放XviD/DivX不是梦!
基本特色
1。支持格式全面
2。支持广泛的输出设备
3。让损坏的MPEG文件流畅播放
相关链接
官方网站 http://www.mplayerhq.hu/
下载 http://www.mplayerhq.hu/design7/dload.html
简单的说,mplayer就是Linux下的全能通杀,最NB的播放器,基于shell的,可以用skin支持x-window,其实Linux下的东西很好移植到Win32(反之未必^_^),所以mplayer顺理成章的成为了Windows命令行下最好的最牛B的播放器
Last edited by electronixtar on 2006-10-3 at 00:09 ]
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'>" |
|
2006-10-3 00:00 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
估计这些技巧在cmd下不行,看来cmd和Linux的shell还是有差距啊
1、在线播放rmvb文件
这个是最简单的,因为rmvb文件不牵涉到字幕问题。请先确定你已经安装realcodecs。假设我想看某一电影ftp里的某个rmvb电影,那么命令行格式为:
wget ftp://username:password@ftpserver/directory/movie.rmvb -O - | mplayer -cache 8192 -
解释一下,wget的参数“-O”是指另存为,后面的“-”就是指输出到StdOut;“|”是管道符,-cache 8192设置mplayer的缓冲区大小为8192K,最后的“-”告诉Mplayer从StdIn读数据。一般来说,流畅播放需要的带宽为60KB/s 左右。如果网速飞快的话,Mplayer会自动控制wget降速,以保持缓冲区在49%左右。
2、在线播放avi文件
这种文件一般都有单独的字幕文件。字幕文件是需要下载到本地硬盘的,把字幕文件放到StdIn中是不可以的。字幕一般有两个格式,srt和sub。对于srt字幕,假设存放位置为tmp/movie.srt,则总的命令行格式为
wget ftp://username:password@ftpserver/directory/movie.avi -O - | mplayer -cache 8192 -sub tmp/movie.srt -font /usr/share/fonts/simsun.ttf -subcp cp936 -
解释一下,Mplayer的“-sub”指定字幕文件,“-font”指定字幕文件的字体,这里的simsun.ttf对应简体宋体,繁体字幕就换繁体字体文件。“-subcp”指定字幕文件的编码,简体就是cp936,繁体就是big5。
对于sub格式字幕,需要下载movie.sub和movie.idx文件,总的命令行格式为
wget ftp://username:password@ftpserver/directory/movie.avi -O - | mplayer -cache 8192 -vobsub movie -
注意,这里“-vobsub”指定sub格式的字幕,后面只需要字幕文件的前缀名,后缀名不要!!“-font”和“-subcp”参数都用不着,因为sub字幕是特殊位图格式,跟字体和编码都没有关系。
一般来说,流畅播放需要的带宽为130KB/s左右。关于加载字幕的问题,可以参见我的另外一篇文章
http://www.linuxsir.org/bbs/showthread.php?t=249835
3、在线听歌
在线听歌也有几种方法,例如听某个ftp服务器某一目录的所有歌,那个格式就是:
wget ftp://username:password@ftpserver/directory/*.mp3 -O - | mplayer -cache 1000 -
如果某首歌的文件名中有中文,那这首歌就播不了了。这跟wget如何获取列表有关。
有很多音乐网站,也提供在线听歌(比如http://music.trueice.net),点击播放后,会生成一个列表文件(假设报存在tmp/playlist.m3u),这样就可以让wget读取这个列表文件并下载,格式为:
wget -i tmp/playlist.m3u -O - | mplayer -cache 1000 -
如果这样的网站需要登录后才能播放,也就是需要Cookies(比如http://music.xjtust.com),那也没关系,命令格式如下:
wget -i tmp/playlist.m3u --load-cookies .mozilla/firefox/default/cookies.txt - O | mplayer -cache 1000 -
这里,“--load-cookies”后面跟的就是Firefox存放Cookies的文件。
还有些网站,必须用Winamp才能播放,XMMS都不行,那也没有问题,命令格式如下:
wget -i tmp/playlist.m3u --load-cookies .mozilla/firefox/default/cookies.txt --user-agent="WinampMPEG/5.0" - O | mplayer -cache 1000 -
这样就会向服务器发送Winamp的播放器标识。
一般来说,流畅播放的带宽为20KB/s左右。
4、其它
wget 还有一个参数在连接ftp服务器的时候也很有用,就是“--no-passive-ftp”。顾名思义,不加这个参数就是Passive模式,加上就是Port模式。如果在播放过程中,wget速度变为0了,可以试试加上或者去掉这个参数。
在播放mp3文件列表时,有可能出现wget在下载其中的一个文件,但是mplayer就是不播放它。这是因为由于mplayer默认从文件的扩展名判断其音频解码类型,而可能由于文件名编码的问题,在stdin中找不到相关信息。这样mplayer就可能不知道如何解码而拒绝播放。可以在mplayer 后面增加这样一个参数“-demuxer 17”,强制它按音频格式处理。
使用curl播放的基本命令为:
curl url -o - | mplayer -cache -
注意是curl另存的参数为小写o,但是curl是否支持Cookies以及是否可以设定user-agent没有试过
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'>" |
|
2006-10-3 00:44 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
又想了一下,如果mplayer支持把 视频输出到 句柄 3,左声道到 句柄4,右声道到 句柄5,那么我们在cmd里不是可以 mplayer xxx.avi 3>xxx.avi 4>xxx.wav 5>xxx.wav了吗?^_^
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'>" |
|
2006-10-3 00:53 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
linux 下的东西就是好,现在正在学习linux
Things under Linux are really good. I'm currently learning Linux.
|
|
2006-10-3 07:52 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
我的LINUX有MPLAYER,但有纯DOS版的吗?
I have MPLAYER in my LINUX, but is there a pure DOS version?
|
|
2006-10-3 08:22 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Mplayer还是需要codec的支持,所以纯DOS下不太现实。可以用hx试试~~
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'>" |
|
2006-10-3 08:52 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by electronixtar at 2006-10-3 12:44 AM:
估计这些技巧在cmd下不行,看来cmd和Linux的shell还是有差距啊
其实Linux的shell就是Unix的shell,Unix的shell发展了几十年,主要面向高手,功能当然强大,同时也比较复杂。后来,作为Unix类操作系统之一的Linux照搬了经典Unix的shell环境,基本上是一回事,都比cmd强大。
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和雨露,谢谢!)
 |
|
2006-10-6 21:10 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by electronixtar at 2006-10-3 08:52 AM:
Mplayer还是需要codec的支持,所以纯DOS下不太现实。可以用hx试试~~
我前段时间就试过,Mplayer可以在有HX的纯DOS下运行,而且其codec也能用。但是,由于HX自身目前还存在一些问题,所以在纯DOS+HX下只能用Mplayer来放RMVB、AVI等多媒体格式的声音(使用-ao win32参数),而不能放图像,但可以将图像保存为PNG等格式(用-vo xx参数)来事后观看。
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和雨露,谢谢!)
 |
|
2006-10-6 21:13 |
|
|
weilong888
银牌会员
    
积分 1270
发帖 548
注册 2004-5-31
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
想在DOS下看DVD,这只能是梦想的事情了。
Wanting to watch DVDs under DOS is just a dream.
|
|
2006-10-6 21:34 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
|
2006-10-7 17:20 |
|
|
weilong888
银牌会员
    
积分 1270
发帖 548
注册 2004-5-31
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
下了试试,站长利害啊。
Let's try it. The webmaster is amazing!
|
|
2006-10-8 01:54 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
个人纯DOS下放RM视频似乎不太现实。一是纯DOS缺少硬件视频加速的驱动,二是纯DOS的图形模式似乎对视频回放支持很差
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'>" |
|
2006-10-8 05:19 |
|
|
weilong888
银牌会员
    
积分 1270
发帖 548
注册 2004-5-31
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
还真是不好试,在vpc上没试成功。在实机上又不大敢试。
It's really not easy to test. It didn't succeed on VPC. On the actual machine, I don't dare to test easily.
|
|
2006-10-8 07:29 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
mplayer e:\wma\*.wma 歌曲连续播放
mplayer e:\wma\*.wma 歌曲 continuous play
|
|
2006-10-9 22:02 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
|
2006-10-11 05:32 |
|
|