Skip to content

Commit

Permalink
Merge branch 'sub_mess2'
Browse files Browse the repository at this point in the history
...the return.
  • Loading branch information
wm4 committed Jun 24, 2013
2 parents 536871d + 54851d6 commit 403a266
Show file tree
Hide file tree
Showing 37 changed files with 1,348 additions and 924 deletions.
1 change: 1 addition & 0 deletions DOCS/man/en/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Command line switches
-dumpstream --stream-dump=<filename>
-capture --stream-capture=<filename>
-stop-xscreensaver --stop-screensaver
-subfile --sub
=================================== ===================================

*NOTE*: ``-opt val`` becomes ``--opt=val``.
Expand Down
55 changes: 33 additions & 22 deletions DOCS/man/en/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1447,11 +1447,6 @@
``show_progress`` command (by default mapped to ``P``), or in some
non-default cases when seeking. Expands properties. See property_expansion_.

--overlapsub
Allows the next subtitle to be displayed while the current one is still
visible (default is to enable the support only for specific formats). This
only matters for subtitles loaded with ``-sub``.

--panscan=<0.0-1.0>
Enables pan-and-scan functionality (cropping the sides of e.g. a 16:9
movie to make it fit a 4:3 display without black bands). The range
Expand Down Expand Up @@ -1996,15 +1991,16 @@
Use/display these subtitle files. Only one file can be displayed at the
same time.

--sub-fix-timing, --no-sub-fix-timing
By default, external text subtitles are preprocessed to remove minor gaps
or overlaps between subtitles (if the difference is smaller than 200 ms,
the gap or overlap is removed). This does not affect image subtitles,
subtitles muxed with audio/video, or subtitles in the ASS format.

--sub-demuxer=<[+]name>
Force subtitle demuxer type for ``--subfile``. Using a '+' before the name
will force it, this will skip some checks! Give the demuxer name as
Force subtitle demuxer type for ``--sub``. Give the demuxer name as
printed by ``--sub-demuxer=help``.

--sub-no-text-pp
Disables any kind of text post processing done after loading the
subtitles. Used for debug purposes.

--sub-paths=<path1:path2:...>
Specify extra directories where to search for subtitles matching the
video. Multiple directories can be separated by ":" (";" on Windows).
Expand Down Expand Up @@ -2035,34 +2031,39 @@
``--subcp=enca:<language>:<fallback codepage>``

You can specify your language using a two letter language code to make
ENCA detect the codepage automatically. If unsure, enter anything and
watch mpv ``-v`` output for available languages. Fallback codepage
specifies the codepage to use, when autodetection fails.
ENCA detect the codepage automatically. If unsure, enter anything (if the
language is invalid, mpv will complain and list valid languages).
Fallback codepage specifies the codepage to use if autodetection fails.

*EXAMPLE*:

- ``--subcp=enca:cs:latin2`` guess the encoding, assuming the subtitles
are Czech, fall back on latin 2, if the detection fails.
- ``--subcp=enca:pl:cp1250`` guess the encoding for Polish, fall back on
cp1250.
- ``--subcp=enca:pl`` guess the encoding for Polish, fall back on UTF-8.
- ``--subcp=enca`` try universal detection, fall back on UTF-8.

--sub-delay=<sec>
Delays subtitles by <sec> seconds. Can be negative.
If the player was compiled with libguess support you can use it with:

--subfile=<filename>
Open the given file with a demuxer, and use its subtitle streams. Same as
``--audiofile``, but for subtitle streams.
``--subcp=guess:<language>:<fallback codepage>``

*NOTE*: use ``--sub`` for subtitle files. This option is useless, unless
you want to force libavformat subtitle parsers instead of libass or
internal subtitle parsers.
Note that libguess always needs a language. There is no universal detection
mode. Use ``--subcp=guess:help`` to get a list of languages (like with ENCA,
it will be printed only if the conversion code is somehow called, for
example when loading an external subtitle).

--sub-delay=<sec>
Delays subtitles by <sec> seconds. Can be negative.

--subfps=<rate>
Specify the framerate of the subtitle file (default: movie fps).

*NOTE*: <rate> > movie fps speeds the subtitles up for frame-based
subtitle files and slows them down for time-based ones.

Also see ``--sub-speed`` option.

--sub-gauss=<0.0-3.0>
Apply gaussian blur to image subtitles (default: 0). This can help making
pixelated DVD/Vobsubs look nicer. A value other than 0 also switches to
Expand All @@ -2089,6 +2090,16 @@
*NOTE*: this affects ASS subtitles as well, and may lead to incorrect
subtitle rendering. Use with care, or use ``--sub-text-font-size`` instead.

--sub-speed=<0.1-10.0>
Multiply the subtitle event timestamps with the given value. Can be used
to fix the playback speed for frame-based subtitle formats. Works for
external text subtitles only.

*EXAMPLE*:

- ``--sub-speed=25/23.976`` play frame based subtitles, which have been
loaded assuming a framerate of 23.976, at 25 FPS.

--sws=<n>
Specify the software scaler algorithm to be used with ``--vf=scale``. This
also affects video output drivers which lack hardware acceleration,
Expand Down
32 changes: 19 additions & 13 deletions DOCS/tech-overview.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,31 @@ audio/out/:
why buggy audio drivers can have a bad influence on playback quality.

sub/:
Contains subtitle rendering, OSD rendering, and parts of subtitle loading.
Contains subtitle and OSD rendering.

sub.c/.h is actually the OSD code. It queries dec_sub.c to retrieve
decoded/rendered subtitles. osd_libass.c is the actual implementation of
the OSD text renderer (which uses libass, and takes care of all the tricky
fontconfig/freetype API usage and text layouting).

Subtitles are loaded either via libass (for .ass), subreader.c (the old
MPlayer subtitle loader code), or libavformat demuxers. The subtitles are
then passed to dec_sub.c and the subtitle decoders in sd_*.c. All text
subtitles are rendered by sd_ass.c. If text subtitles are not in the ASS
format, subtitle converters are inserted, for example sd_srt.c, which is
used to convert SRT->ASS. sd_srt.c is also used as general converter for
text->ASS (to prevent interpretation of text as ASS tags).

subreader.c should eventually go away. It should be replaced by either
libavformat's demuxers, or by mpv native demuxers for more common formats
like SRT. See commit message of commit 92ae48d what needs to be done to
replace subreader.c completely and why.
Subtitle loading is now in demux/ instead. demux_libass.c wraps loading
.ass subtitles via libass. demux_lavf.c loads most subtitle types via
FFmpeg. demux_subreader.c is the old MPlayer code. It's used as last
fallback, or to handle some text subtitle types on Libav. (It also can
load UTF-16 encoded subtitles without requiring the use of -subcp.)
demux_subreader.c should eventually go away (maybe).

The subtitles are passed to dec_sub.c and the subtitle decoders in sd_*.c
as they are demuxed. All text subtitles are rendered by sd_ass.c. If text
subtitles are not in the ASS format, subtitle converters are inserted, for
example sd_srt.c, which is used to convert SRT->ASS. sd_srt.c is also used
as general converter for text->ASS (to prevent interpretation of text as
ASS tags).

Text subtitles can be preloaded, in which case they are read fully as soon
as the subtitle is selected, and then effectively stored in an ASS_Track.
It's used for external text subtitles, and required to make codepage
detection as well as timing postprocessing work.

core/timeline/:
A timeline is the abstraction used by mplayer.c to combine several files
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ SOURCES-$(DVDREAD) += stream/stream_dvd.c \
SOURCES-$(FTP) += stream/stream_ftp.c
SOURCES-$(HAVE_SYS_MMAN_H) += audio/filter/af_export.c osdep/mmap_anon.c
SOURCES-$(LADSPA) += audio/filter/af_ladspa.c
SOURCES-$(LIBASS) += sub/ass_mp.c sub/sd_ass.c
SOURCES-$(LIBASS) += sub/ass_mp.c sub/sd_ass.c \
demux/demux_libass.c

SOURCES-$(LIBBLURAY) += stream/stream_bluray.c
SOURCES-$(LIBBS2B) += audio/filter/af_bs2b.c
Expand Down Expand Up @@ -169,6 +170,7 @@ SOURCES = talloc.c \
core/av_log.c \
core/av_opts.c \
core/bstr.c \
core/charset_conv.c \
core/codecs.c \
core/command.c \
core/cpudetect.c \
Expand Down Expand Up @@ -207,7 +209,7 @@ SOURCES = talloc.c \
demux/demux_mf.c \
demux/demux_mkv.c \
demux/demux_mpg.c \
demux/demux_sub.c \
demux/demux_subreader.c \
demux/demux_ts.c \
demux/mp3_hdr.c \
demux/parse_es.c \
Expand All @@ -234,13 +236,13 @@ SOURCES = talloc.c \
sub/img_convert.c \
sub/sd_lavc.c \
sub/sd_lavc_conv.c \
sub/sd_lavf_srt.c \
sub/sd_microdvd.c \
sub/sd_movtext.c \
sub/sd_spu.c \
sub/sd_srt.c \
sub/spudec.c \
sub/sub.c \
sub/subreader.c \
video/csputils.c \
video/fmt-conversion.c \
video/image_writer.c \
Expand Down
21 changes: 21 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ Installation directories:
Optional features:
--disable-encoding disable encoding functionality [enable]
--disable-libguess disable libguess [autodetect]
--enable-termcap use termcap database for key codes [autodetect]
--enable-termios use termios database for key codes [autodetect]
--disable-iconv disable iconv for encoding conversion [autodetect]
Expand Down Expand Up @@ -465,6 +466,7 @@ networking=yes
_winsock2_h=auto
_smb=auto
_libquvi=auto
_libguess=auto
_joystick=no
_lirc=auto
_lircc=auto
Expand Down Expand Up @@ -666,6 +668,8 @@ for ac_option do
--disable-smb) _smb=no ;;
--enable-libquvi) _libquvi=yes ;;
--disable-libquvi) _libquvi=no ;;
--enable-libguess) _libguess=yes ;;
--disable-libguess) _libguess=no ;;
--enable-joystick) _joystick=yes ;;
--disable-joystick) _joystick=no ;;
--enable-libav) ffmpeg=yes ;;
Expand Down Expand Up @@ -1687,6 +1691,21 @@ else
fi


echocheck "libguess support"
if test "$_libguess" = auto ; then
_libguess=no
if pkg_config_add 'libguess >= 1.0' ; then
_libguess=yes
fi
fi
if test "$_libguess" = yes; then
def_libguess="#define CONFIG_LIBGUESS 1"
else
def_libguess="#undef CONFIG_LIBGUESS"
fi
echores "$_libguess"


echocheck "Samba support (libsmbclient)"
if test "$_smb" = yes; then
libs_mplayer="$libs_mplayer -lsmbclient"
Expand Down Expand Up @@ -3171,6 +3190,7 @@ VF_LAVFI = $vf_lavfi
AF_LAVFI = $af_lavfi
LIBSMBCLIENT = $_smb
LIBQUVI = $_libquvi
LIBGUESS = $_libguess
LIBTHEORA = $_theora
LIRC = $_lirc
MACOSX_BUNDLE = $_macosx_bundle
Expand Down Expand Up @@ -3369,6 +3389,7 @@ $def_inet_pton
$def_networking
$def_smb
$def_libquvi
$def_libguess
$def_socklen_t
$def_vstream
Expand Down
Loading

0 comments on commit 403a266

Please sign in to comment.