cubieplayer / Cubian

Debian for Cubieboard
http://cubian.org
271 stars 49 forks source link

mplayer 无法显示字幕 #327

Open ETiV opened 10 years ago

ETiV commented 10 years ago

可能很多人看了标题都觉得是字幕编码问题, 但这个真不是. 字幕还没有显示出来, 我也不知道这个问题解决后, 等下会不会遇到编码问题

板子是A10. 系统是 Cubian-desktop-r1-a10.img.7z

mplayer 按照这个装的 WIKI: 简单的视频播放器

只不过最后的 play.sh 里面的设置项目, 我给写到了 ~/.mplayer/config 里:

# Write your default config options here!
sub-fuzziness=1
#slang=chs
vo=vdpau
vc=ffmpeg12vdpau,ffh264vdpau,

同时在 .zshrc 里配了 (因为我想从ssh执行命令, 在电视上显示.):

export VDPAU_DRIVER=sunxi
export DISPLAY=:0

调用依旧从命令行使用 mplayer filename.

但是, 这里的 mplayer 无法显示字幕.

从命令行的输出可以看到, 字幕已经无错加载. 字幕文件: Rio.2.2014.720p.BluRay.x264.DTS-WiKi.eng.srt. 英文字幕.

...
3 00:00:49,384 --> 00:00:52,804
# What is love if it's not with you? #
...
9
00:01:09,279 --> 00:01:12,740
# I wake up every morning thinking about the way you feel #
....

但等到应该显示字幕的时间的时候, 会出现这样一条日志

A:  49.3 V:  49.3 A-V: -0.001 ct: -0.000   0/  0 13% 20%  5.6% 0 0
[   vdpau] EOSD: error when creating surface: A catch-all error, used when no other error code applies.
A:  69.2 V:  69.2 A-V: -0.001 ct: -0.000   0/  0 13% 25%  5.7% 0 0
[   vdpau] EOSD: error when creating surface: A catch-all error, used when no other error code applies.

我Google了一圈, 没有跟字幕有关系的讨论. 不过有一帖子说因为显存128M, 所以mplayer无法用 Link >> 然后我调整了一下 sunxi_fb_mem_reserve=11 -> sunxi_fb_mem_reserve=64

但重启后还是一样的错误提示. 所以现在有点走投无路.

请那位大仙儿帮忙指条路吧.

ETiV commented 10 years ago

在 apt-get remove libvdpau-sunxi 后

使用了 github 上的源代码 make install 而且按照其 README 说明的步骤操作后, 错误变成了

EOSD: error when creating surface: An invalid/unsupported VdpRGBAFormat value was supplied.

经过一番检查, 发现 rgba.c 里的 rgba_create 函数的 format 参数, 值为 3. 而非函数里校验的 0 或者 1.

这咋办...我还需要自己编译 mplayer 吗?

aaron0x commented 9 years ago

請問你解決這個問題了嗎?

ETiV commented 9 years ago

@aaron0x 我说不好算不算是"解决"了这个问题, 但最后我这里字幕都是可以上屏幕的了.

我自行编译了mplayer.

而后又遇到了英文和数字显示, 但中文字显示下划线(这个问题, 应该是使用subcp="GBK"这条配置可以解决).

现在工作都挺正常的, 除了字幕会显示出ass文件里每行字幕的字体字号什么的, 不过我都是用正则处理后再播放的...

附上我的配置文件:

# Write your default config options here!
fontconfig="no"
ao=alsa
zoom=yes
subfont-autoscale=3
subfont-text-scale=3
slang="chs,cht,eng"
sub-fuzziness=1
vo="vdpau,"
vc="ffmpeg12vdpau,ffh264vdpau,"
subcp="GBK"
subfont="/usr/share/fonts/truetype/wqy/wqy-microhei.ttc"
volume=10
user-agent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16"
prefer-ipv4="yes"
fs="yes"
aaron0x commented 9 years ago

我編譯了libvdpau和mplayer然後使用你的配置文件 仍然沒有字幕 以下是mplayer -v的輸出 請問有什麼看法? MPlayer SVN-r37268-4.6 (C) 2000-2014 MPlayer Team CPU: ARM get_path('codecs.conf') -> '/home/cubie/.mplayer/codecs.conf' Reading optional codecs config file /home/cubie/.mplayer/codecs.conf: No such file or directory Reading optional codecs config file /usr/local/etc/mplayer/codecs.conf: No such file or directory Using built-in default codecs.conf. init_freetype get_path('font/font.desc') -> '/home/cubie/.mplayer/font/font.desc' font: can't open file: /home/cubie/.mplayer/font/font.desc font: can't open file: /usr/local/share/mplayer/font/font.desc Syntax error in font desc: ttcfUsing Unoptimized OnScreenDisplay get_path('fonts') -> '/home/cubie/.mplayer/fonts' Configuration: --disable-gui --enable-vdpau CommandLine: '-v' 'abc.mp4' Using nanosleep() timing get_path('input.conf') -> '/home/cubie/.mplayer/input.conf' Reading optional input config file /home/cubie/.mplayer/input.conf: No such file or directory Reading optional input config file /usr/local/etc/mplayer/input.conf: No such file or directory Falling back on default (hardcoded) input config Setting up LIRC support... mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. get_path('abc.mp4.conf') -> '/home/cubie/.mplayer/abc.mp4.conf'

Playing abc.mp4. get_path('sub/') -> '/home/cubie/.mplayer/sub/' [file] File size is 2897929536 bytes STREAM: [file] abc.mp4 STREAM: Description: File STREAM: Author: Albeu STREAM: Comment: based on the code from ??? (probably Arpi) libavformat version 56.4.101 (internal) Configuration: --enable-gpl --enable-postproc LAVF_check: QuickTime / MOV libavformat file format detected. [mov,mp4,m4a,3gp,3g2,mj2 @ 0xbcc3d0]ISO: File Type Major Brand: isom [mov,mp4,m4a,3gp,3g2,mj2 @ 0xbcc3d0]Before avformat_find_stream_info() pos: 2897929536 bytes read:4820345 seeks:1 [h264 @ 0xcc4300]no picture [mov,mp4,m4a,3gp,3g2,mj2 @ 0xbcc3d0]All info found [mov,mp4,m4a,3gp,3g2,mj2 @ 0xbcc3d0]After avformat_find_stream_info() pos: 4804927 bytes read:4853113 seeks:2 frames:25 ==> Found video stream: 0 ======= VIDEO Format ====== biSize 81 biWidth 1920 biHeight 1080 biPlanes 1 biBitCount 24 biCompression 875967048='H264' biSizeImage 6220800

Unknown extra header dump: [1] [64] [0] [28] [ff] [e1] [0] [19] [67] [64] [0] [28] [ac] [d9] [40] [78] [2] [27] [e5] [84] [0] [0] [3] [1] [f4] [0] [0] [5d] [aa] [3c] [60] [c6] [58] [1] [0] [5] [68] [eb] [ec] [f2] [3c]

[lavf] stream 0: video (h264), -vid 0 ==> Found audio stream: 1 ======= WAVE Format ======= Format Tag: 20557 (0x504D) Channels: 2 Samplerate: 48000 avg byte/sec: 9992 Block align: 1 bits/sample: 16 cbSize: 7

Unknown extra header dump: [13] [10] [56] [e5] [9d] [48] [0]

[lavf] stream 1: audio (aac), -aid 0, -alang eng ==> Found audio stream: 2 ======= WAVE Format ======= Format Tag: 20557 (0x504D) Channels: 6 Samplerate: 48000 avg byte/sec: 26092 Block align: 1 bits/sample: 16 cbSize: 7

Unknown extra header dump: [13] [30] [56] [e5] [9d] [48] [0]

[lavf] stream 2: audio (aac), -aid 1, -alang eng LAVF: 2 audio and 1 video streams found LAVF: build 3671141 VIDEO: [H264] 1920x1080 24bpp 23.976 fps 2245.5 kbps (274.1 kbyte/s) [V] filefmt:44 fourcc:0x34363248 size:1920x1080 fps:23.976 ftime:=0.0417 Clip info: major_brand: isom minor_version: 1 compatible_brands: isomavc1 creation_time: 2013-01-24 03:32:31 Load subtitles in ./ get_path('sub/') -> '/home/cubie/.mplayer/sub/' X11 opening display: :0.0 vo: X11 color mask: FFFFFF (R:FF0000 G:FF00 B:FF) vo: X11 running at 1360x768 with depth 24 and 32 bpp (":0.0" => local display) [x11] Detected wm supports NetWM. [x11] Detected wm supports FULLSCREEN state. [x11] Detected wm supports ABOVE state. [x11] Detected wm supports BELOW state. [x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms

[VDPAU SUNXI] VE version 0x1623 opened.

Forced video codec: ffmpeg12vdpau Forced video codec: ffh264vdpau Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family libavcodec version 56.1.100 (internal) Configuration: --enable-gpl --enable-postproc INFO: libavcodec init OK!

Selected video codec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders dec_audio: Allocating 1536000 + 131072 = 1667072 bytes for output buffer. FFmpeg's libavcodec audio codec INFO: libavcodec "aac" init OK! AUDIO: 48000 Hz, 2 ch, floatle, 79.9 kbit/2.60% (ratio: 9992->384000)

Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))

Building audio filter chain for 48000Hz/2ch/floatle -> 0Hz/0ch/??... [libaf] Adding filter dummy [dummy] Was reinitialized: 48000Hz/2ch/floatle [dummy] Was reinitialized: 48000Hz/2ch/floatle Trying preferred audio driver 'alsa', options '[none]' alsa-init: requested format: 48000 Hz, 2 channels, 1d alsa-init: using ALSA 1.0.28 alsa-init: setup for 1/2 channel(s) alsa-init: using device default alsa-init: opening device in blocking mode alsa-init: device reopened in blocking mode [AO_ALSA] Format floatle is not supported by hardware, trying default. alsa-init: got buffersize=96000 alsa-init: got period size 3000 alsa: 48000 Hz/2 channels/4 bpf/96000 bytes buffer/Signed 16 bit Little Endian AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample) AO: Description: ALSA-0.9.x-1.x audio output AO: Author: Alex Beregszaszi, Zsolt Barat joy@streamminister.de AO: Comment: under development Building audio filter chain for 48000Hz/2ch/floatle -> 48000Hz/2ch/s16le... [dummy] Was reinitialized: 48000Hz/2ch/floatle [libaf] Adding filter format [format] Changing sample format from little-endian 32-bit float to little-endian 16-bit signed int [format] Accelerated little-endian 32-bit float to little-endian 16-bit signed int conversion [dummy] Was reinitialized: 48000Hz/2ch/floatle [format] Changing sample format from little-endian 32-bit float to little-endian 16-bit signed int [format] Accelerated little-endian 32-bit float to little-endian 16-bit signed int conversion [AO_ALSA] Unable to find simple control 'PCM',0. [AO_ALSA] Available elements for device:

[Mixer] No hardware mixing, inserting volume filter. [libaf] Adding filter volume [dummy] Was reinitialized: 48000Hz/2ch/floatle [format] Changing sample format from little-endian 32-bit float to little-endian 16-bit signed int [format] Accelerated little-endian 32-bit float to little-endian 16-bit signed int conversion [dummy] Was reinitialized: 48000Hz/2ch/floatle [format] Changing sample format from little-endian 32-bit float to little-endian 16-bit signed int [format] Accelerated little-endian 32-bit float to little-endian 16-bit signed int conversion Starting playback... [libaf] Reallocating memory in module format, old len = 0, new len = 65545 Increasing filtered audio buffer size from 0 to 65536 Increasing filtered audio buffer size from 65536 to 98048 [VD_FFMPEG] Trying pixfmt=0. [VD_FFMPEG] VDPAU accelerated decoding [ffmpeg] aspect_ratio: 0.000000 VDec: vo config request - 1920 x 1080 (preferred colorspace: H.264 VDPAU acceleration) Trying filter chain: vo [vdpau] Creating H264 hardware decoder for 2 reference frames. VDec: using H.264 VDPAU acceleration as output csp (no 0) Movie-Aspect is undefined - no prescaling applied. VO Config (1920x1080->1920x1080,flags=5,'MPlayer',0x1DC80003) VO: [vdpau] 1920x1080 => 1920x1080 H.264 VDPAU acceleration [fs] [zoom] VO: Description: VDPAU with X11 VO: Author: Rajib Mahapatra rmahapatra@nvidia.com and others [vdpau] Creating H264 hardware decoder for 2 reference frames. [vdpau] Creating H264 hardware decoder for 2 reference frames. [vdpau] Updating CSC matrix for BT.601 [VD_FFMPEG] VDPAU accelerated decoding * [vo] Direct Rendering mp_image_t, 1920x1090x0bpp RGB packed, 0 bytes [h264 @ 0xcc4300]no picture [vdpau] Creating H264 hardware decoder for 4 reference frames. * [vo] Direct Rendering mp_image_t, 1920x1090x0bpp RGB packed, 0 bytes [h264 @ 0xcc4300]no picture * [vo] Direct Rendering mp_image_t, 1920x1090x0bpp RGB packed, 0 bytes get_path('subfont.ttf') -> '/home/cubie/.mplayer/subfont.ttf' Unicode font: 4124 glyphs. Unicode font: 34592 glyphs. [ASPECT] Warning: No suitable new res found! [ASPECT] Warning: No suitable new res found! A: 0.4 V: 0.0 A-V: 0.418 ct: 0.000 0/ 0 ??% ??% ??,?% 2 0  * [vo] Direct Rendering mp_image_t, 1920x1090x0bpp RGB packed, 0 bytes get_path('subfont.ttf') -> '/home/cubie/.mplayer/subfont.ttf' Unicode font: 4124 glyphs. Unicode font: 34592 glyphs. A: 0.5 V: 0.0 A-V: 0.470 ct: 0.004 0/ 0 ??% ??% ??,?% 3 0  * [vo] Direct Rendering mp_image_t, 1920x1090x0bpp RGB packed, 0 bytes A: 0.5 V: 0.1 A-V: 0.461 ct: 0.008 0/ 0 ??% ??% ??,?% 4 0  * [vo] Direct Rendering mp_image_t, 1920x1090x0bpp RGB packed, 0 bytes [h264 @ 0xcc4300]no picture A: 202.3 V: 202.2 A-V: 0.014 ct: 0.006 0/ 0 ??% ??% ??,?% 0 0 [h264 @ 0xcc4300]no picture Uninit audio filters... [libaf] Removing filter volume [libaf] Removing filter dummy [libaf] Removing filter format Uninit audio: ffmpeg Uninit video: ffmpeg alsa-uninit: pcm closed vo: uninit ...

Exiting... (Quit)