eni*_*ist 5 video linux mplayer
默认情况下 mplayer 以秒为单位显示视频中的当前位置,这几乎没有用。例子:
A:4086.2 V:4086.2 A-V: 0.000 ct: 0.039 0/ 0 17% 2% 2.1% 3 0
^--------^----- This is the current location in seconds.
Run Code Online (Sandbox Code Playgroud)
那么,那又怎样?Mplayer 有可怕的默认设置。还有什么是新的?但是 mplayer 是高度可配置的,因此必须有一种方法可以更改该行并将您想要的任何信息放在那里。不过,我搜索了联机帮助页,但找不到可以执行此操作的选项。理想行为:
A:1:08:06.2 V:1:08:06.2 A-V: 0.000 ct: 0.039 0/ 0 17% 2% 2.1% 3 0
^-----------^----- This is the current location in hours:minutes:seconds.
Run Code Online (Sandbox Code Playgroud)
有没有人想出一种方法来做到这一点?
我们看一下mplayer的源代码,mplayer.c:
...
// Audio time
if (mpctx->sh_audio) {
saddf(line, &pos, width, "A:%6.1f ", a_pos);
if (!sh_video) {
float len = demuxer_get_time_length(mpctx->demuxer);
saddf(line, &pos, width, "(");
sadd_hhmmssf(line, &pos, width, a_pos);
saddf(line, &pos, width, ") of %.1f (", len);
sadd_hhmmssf(line, &pos, width, len);
saddf(line, &pos, width, ") ");
}
}
// Video time
if (sh_video)
saddf(line, &pos, width, "V:%6.1f ", sh_video->pts);
// A-V sync
if (mpctx->sh_audio && sh_video)
saddf(line, &pos, width, "A-V:%7.3f ct:%7.3f ", a_v, corr);
...
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,只有if (mpctx->sh_audio) AND if (!sh_video)audio-only 才会调用它将hh:mm:sssadd_hhmmssf()格式打印到标准输出。但音频+视频则不然。mpctx->sh_audio && sh_video
因此,如果您使用选项调用该mplayer命令-novideo,它将包含hh:mm:ss格式:
[xiaobai@xiaobai example]$ mplayer -novideo example.mkv
MPlayer SVN-r37391-5.1.1 (C) 2000-2015 MPlayer Team
...
Video: no video
Position: 58 %
A: 90.5 (01:30.4) of 145.4 (02:25.4) 0.0%
Run Code Online (Sandbox Code Playgroud)
[MPlayer-dev-eng] [PATCH] 纯音频文件的总时间解释了纯音频的起源:
附加的补丁使 MPlayer 在状态行中显示纯音频文件的总时间。我认为这对于仅音频很有用,因为
1)状态行仍然很小
2) 您不能仅激活 OSD 来查找总时间
从这个解释中,我们知道可以激活 OSD 来实现相同的目标。所以现在只需阅读man mplayer并搜索 OSD 关键字:
...
o
Toggle OSD states: none / seek / seek + timer / seek + timer + total time.
...
P
Show progression bar, elapsed time and total duration on the OSD.
...
-osdlevel <0-3> (MPlayer only)
Specifies which mode the OSD should start in.
0 subtitles only
1 volume + seek (default)
2 volume + seek + timer + percentage
3 volume + seek + timer + percentage + total time
...
Run Code Online (Sandbox Code Playgroud)
这意味着按P将动态切换当前时间/总时间,或调用mplayer -osdlevel 3 file以一致地显示当前时间/总时间:

[更新]
请记住,如果连续按o有 4 种状态:
-osdlevel 3)由于未知原因,-novideo仍然接受o键,并且仅引入2种状态,即启用OSD和禁用OSD。如果您按o启用 OSD,然后按P ,则会出现错误,它将显示00:00:00/总时间。
| 归档时间: |
|
| 查看次数: |
3693 次 |
| 最近记录: |