Я пытаюсь использовать субтитры с файлом MKV следующим образом:
mplayer video.mkv
mplayer -sub video.srt video.mkv
mplayer video.mkv -sub video.srt
но воспроизводилось только видео, но без субтитров. Я также нажимал несколько кнопок во время воспроизведения видео ('j', 'u', 's'), но без каких-либо изменений.
ОС: MacOS 10.13.16 mplayer: 1.3.0-4.2.1
Может я что-то упустил? Или mplayer
должен быть скомпилирован каким-то особым, сложным способом? Или библиотека отсутствует? Или потому что это Mac?
Есть ли способ использовать субтитры в файле srt с видео mkv с mplayer
?
Я попытался, как предложено в комментарии, чтобы установить конфигурацию, как показано здесь. Но я получаю следующую ошибку при воспроизведении файла mkv
файлом srt в той же папке:
Warning unknown option subfont-text-scale at line 3
Warning unknown option subfont-osd-scale at line 4
The fontconfig option can't be used in a config file.
Error parsing option fontconfig=yes at line 5
Первые две записи в файле srt:
1
00:00:00,000 --> 00:00:05,000
<font face="Hiruko" size="38">Test</font>
2
00:00:05,000 --> 00:00:14,060
<font face="Hiruko" size="38">Subs: English</font>
Текущее содержание .mplayer/config
:
# Write your default config options here!
subalign=2
font = "Arial"
subcp = iso8859-1
# Set font.
#font=/home/osmo/.fonts/microsoft-vista/calibri.ttf
# Set font encoding.
subfont-encoding=unicode
# Set subtitle file encoding.
unicode=yes
utf8=yes
Когда я просто играю файл следующим образом
mplayer -v video.mkv
видео отлично воспроизводится со звуком, но без субтитров. Вывод в консоли следующий:
Configuration: --cc=clang --host-cc=clang --disable-cdparanoia --prefix=/usr/local/Cellar/mplayer/1.3.0 --disable-x11
CommandLine: '-v' 'video.mkv'
Using Darwin accurate timing
get_path('input.conf') -> '/Users/adietz/.mplayer/input.conf'
Reading optional input config file /Users/adietz/.mplayer/input.conf: No such file or directory
Reading optional input config file /usr/local/Cellar/mplayer/1.3.0/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config
Can't init Apple Remote.
get_path('video.mkv.conf') -> '/Users/adietz/.mplayer/video.mkv.conf'
Playing video.mkv.
get_path('sub/') -> '/Users/adietz/.mplayer/sub/'
[file] File size is 745530259 bytes
STREAM: [file] video.mkv
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
libavformat version 57.25.100 (internal)
Configuration: --enable-gpl --enable-postproc
LAVF_check: Matroska / WebM
libavformat file format detected.
st:0 removing common factor 1000000 from timebase
st:1 removing common factor 1000000 from timebase
[matroska,webm @ 0x103b35490]Before avformat_find_stream_info() pos: 5647 bytes read:32768 seeks:0
[h264 @ 0x103b53440]user data:"x264 - core 125 r2200 999b753 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:1:1 analyse=0x3:0x133 me=umh subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=4 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=0 open_gop=0 weightp=2 keyint=240 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.40 aq=1:1.00"
[h264 @ 0x103b53440]user data:"x264 - core 125 r2200 999b753 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:1:1 analyse=0x3:0x133 me=umh subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=4 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=0 open_gop=0 weightp=2 keyint=240 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 ip_ratio=1.40 aq=1:1.00"
[h264 @ 0x103b53440]no picture
[matroska,webm @ 0x103b35490]All info found
[matroska,webm @ 0x103b35490]After avformat_find_stream_info() pos: 213450 bytes read:229205 seeks:0 frames:12
==> Found video stream: 0
======= VIDEO Format ======
biSize 82
biWidth 1440
biHeight 1080
biPlanes 1
biBitCount 0
biCompression 875967048='H264'
biSizeImage 0
Unknown extra header dump: [1] [64] [0] [28] [ff] [e1] [0] [19] [67] [64] [0] [28] [ac] [d9] [80] [5a] [2] [27] [e5] [c0] [44] [0] [0] [f] [a4] [0] [2] [ee] [2] [3c] [60] [c6] [68] [1] [0] [6] [68] [e9] [70] [6c] [b2] [2c]
===========================
[lavf] stream 0: video (h264), -vid 0
==> Found audio stream: 1
======= WAVE Format =======
Format Tag: 61868 (0xF1AC)
Channels: 2
Samplerate: 48000
avg byte/sec: 0
Block align: 1
bits/sample: 24
cbSize: 34
Unknown extra header dump: [10] [0] [10] [0] [0] [1] [89] [0] [1e] [54] [b] [b8] [3] [70] [4] [6d] [31] [30] [6b] [fc] [52] [fd] [5d] [86] [7e] [6f] [3] [e] [0] [89] [52] [77] [46] [67]
==========================================================================
[lavf] stream 1: audio (flac), -aid 0
LAVF: 1 audio and 1 video streams found
LAVF: build 3742052
VIDEO: [H264] 1440x1080 0bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44 fourcc:0x34363248 size:1440x1080 fps:23.976 ftime:=0.0417
2018-10-16 08:08:13.995 mplayer[62669:997915] *** WARNING: Textured window <NSWindow: 0x7fa16f51f4a0> is getting an implicitly transparent titlebar. This will break when linking against newer SDKs. Use NSWindow's -titlebarAppearsTransparent=YES instead.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 57.24.102 (internal)
Configuration: --enable-gpl --enable-postproc
INFO: libavcodec init OK!
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Clip info:
encoder: libebml v1.2.3 + libmatroska v1.3.0
creation_time: 2012-09-12 10:05:57
Load subtitles in ./
get_path('sub/') -> '/Users/adietz/.mplayer/sub/'
[file] File size is 43583 bytes
STREAM: [file] ./video.srt
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
SUB: Detected subtitle file format: subviewer
SUB: opened iconv descriptor.
SUB: closed iconv descriptor.
SUB: Read 318 subtitles, 0 bad line(s).
SUB: Adjusted 102 subtitle(s).
SUB: Added subtitle file (1): ./video.srt
Полный вывод установки mplayer
:
$ brew install mplayer
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/mplayer-1.3.0.high_sierra.bottle.tar.gz
Already downloaded: /Users/adietz/Library/Caches/Homebrew/downloads/2c54638881d1afb804282a3afa22709af0d3dec157559541892847a555610955--mplayer-1.3.0.high_sierra.bottle.tar.gz
==> Pouring mplayer-1.3.0.high_sierra.bottle.tar.gz
/usr/local/Cellar/mplayer/1.3.0: 11 files, 26.9MB