Commit Graph

235 Commits

Author SHA1 Message Date
wm4 59aed93208 ad_lavc: expose an option to enable threading 2013-12-04 23:12:51 +01:00
wm4 14d92a4685 manpage: mention that vda can work with vo_opengl
Also, with the addition of VDA, all hardware decoding backends work with
vo_opengl now.
2013-12-02 19:24:18 +01:00
Vivek Jain 6fb020f5de options: add option to disable using right Alt key as Alt Gr
mpv was hardcoded to always consider the right Alt key as Alt Gr, but there
are parituclar combinations of platforms and keyboard layouts where it's more
convenient to treat the right Alt as a keyboard modifier just like the left
one.

Fixes #388
2013-12-02 09:03:31 +01:00
wm4 b5b1692593 video: disable PTS sorting fallback by default
It appears PTS sorting was useful only for avi files (and VfW-muxed
mkv). Maybe it was historically also important for decoders with broken
or non-existent PTS reordering (win32 codecs?). But now that we handle
demuxers which outputs DTS only correctly, it just seems dead weight.

Disable it by default. The --pts-association-mode option is now forced
to always use the decoder's PTS value. You can still enable the old
default (auto) or force sorting. But we will probably remove this option
entirely at some point.

Make demux_mkv export timestamps at DTS when it's in VfW mode. This is
needed to get correct timestamps with the new default mode. demux_lavf
already does that.
2013-11-25 23:14:54 +01:00
wm4 8743d3fbfa demux_lavf: disable genpts by default, remove the builtin genpts hack
This was needed to determine PTS from DTS, but the previous commits
make it unnecessary.

The builtin genpts hack was used for DVD, because libavformat's genpts
essentially went amok on DVD timestamp resets. See commit 65d87091 for
details.
2013-11-25 23:13:46 +01:00
wm4 b5ed614839 options: implement --pphelp differently
Make it work via --vf=pp:help instead.
2013-11-23 21:34:24 +01:00
wm4 25855059af video: remove vf_pp auto-insertion
This drops the --pp option, which was probably broken for a while. The
option automatically inserted the "pp" filter. The value passed to it
was ignored (which is probably broken, it always selected maximal
quality).

Inserting this filter can be done simply with --vf=pp, so this is not
needed anymore.
2013-11-23 21:30:56 +01:00
wm4 f197198ca3 player: add --merge-files option 2013-11-19 22:39:14 +01:00
wm4 469e488308 manpage: fix typo in --video-align-y description 2013-11-19 22:20:09 +01:00
wm4 2289a479b1 manpage: mark DTS-HD passthough as broken 2013-11-15 21:13:03 +01:00
Rudolf Polzer 633fde4ae5 sd_lavc, sd_spu: make dvdsub stretching conditional on --stretch-dvd-subs.
We found that the stretching - although it usually improves the looks of
the fonts - is incorrect.

On DVD, subtitles can cover the full area of the picture, and they have
the same pixel aspect as the movie itself.

Too bad many commercially released DVDs use bitmap fonts made with the
wrong pixel aspect (i.e. assuming 1:1) - --stretch-dvd-subs will make
these more pretty then.
2013-11-07 12:56:07 +01:00
wm4 6d2c5fc99a vd_lavc: remove explicit crystalhd support
This removes "--hwdec=crystalhd".

I doubt anyone even tried to use this. But even if someone wants to
use it, the decoders can still be explicitly invoked with e.g.:

    --vd=lavc:h264_crystalhd

The only advantage our special code provided was fallback to
software decoding. (But I'm not sure how the ffmpeg crystalhd
pseudo-decoder actually behaves.)

Removing this will allow some simplifications as soon as we don't need
vdpau_old.c anymore.
2013-11-06 00:47:53 +01:00
wm4 db6a4eec0a vo_opengl: support for vdpau hardware decoding
This uses vdpau OpenGL interop to convert a vdpau surface to a texture.

Note that this is a bit weak and primitive. Deinterlacing (or any other
form of vdpau postprocessing) is not supported. vo_opengl chroma scaling
and chroma sample position are not supported. Internally, the vdpau
video surfaces are converted to a RGBA surface first, because using the
video surfaces directly is too complicated. (These surfaces are always
split into separate fields, and the vo_opengl core expects progressive
frames or frames with weaved fields.)
2013-11-05 22:28:15 +01:00
wm4 890d8ea194 manpage: fix incorrect default for --osc 2013-11-05 22:05:23 +01:00
wm4 2d58fb3b8e vo_opengl: add support for VA-API OpenGL interop
VA-API's OpenGL/GLX interop is pretty bad and perhaps slow (renders a
X11 pixmap into a FBO, and has to go over X11, probably involves one or
more copies), and this code serves more as an example, rather than for
serious use. On the other hand, this might be work much better than
vo_vaapi, even if slightly slower.
2013-11-04 00:11:43 +01:00
wm4 24897eb94c video: check profiles with hardware decoding
We had some code for checking profiles earlier, which was removed in
commits 2508f38 and adfb71b. These commits mentioned that (working) hw
decoding was sometimes prevented due to profile checking, but I can't
find the samples anymore that showed this behavior. Also, I changed my
opinion, and I think checking the profiles is something that should be
done for better fallback to software decoding behavior.

The checks roughly follow VLC's vdpau profile checks, although we do
not check codec levels. (VLC's profile checks aren't necessarily
completely correct, but they're a welcome help anyway.)

Add a --vd-lavc-check-hw-profile option, which skips the profile check.
2013-11-01 17:33:33 +01:00
wm4 dbb4b00a12 manpage: clarify --heartbeat-interval operation 2013-10-25 20:33:46 +02:00
Alessandro Ghedini de3a979f69 spelling fixes 2013-10-16 12:36:34 +02:00
ChrisK2 935ca52d81 docs: Add osc.rst to mpv.rst
Also moved OPTIONS headline into options.rst
2013-10-15 22:42:00 +02:00
Philip Sequeira 7ce464bef9 options: --loop=N means playback N times, not N+1 times
The argument or this change is that --loop should set how often the
file is played, not the number of additional repeats.

Based on pull request 277, with additions to the manpage and removal
of "--loop=0".

Signed-off-by: wm4 <wm4@nowhere>
2013-10-12 18:57:02 +02:00
wm4 f01744ac4e core: add --force-window
This commit adds the --force-window option, which will cause mpv always
to create a window when started. This can be useful when pretending that
mpv is a GUI application (which it isn't, but users pretend anyway), and
playing audio files would run mpv in the background without giving a
window to control it.

This doesn't actually create the window immediately: it only does so
only after initializing playback and when it is clear that there won't
be any actual video. This could be a problem when starting slow or
completely stuck network streams (mpv would remain frozen in the
background), or if video initialization somehow is stuck forever in
an in-between state (like when the decoder doesn't output a video
frame, but doesn't return an error either). Well, we can pretend only
so much that mpv is a GUI application.
2013-10-02 01:39:28 +02:00
wm4 b7f01957ec network: add options to control TLS verification 2013-09-27 18:09:30 +02:00
ChrisK2 0a0d7f43a5 Add the on-screen-controller
Signed-off-by: wm4 <wm4@nowhere>
2013-09-26 01:29:15 +02:00
wm4 6048f87e3c Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).

This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.

One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 01:28:58 +02:00
wm4 72fbd846db options: allow selecting the libass shaper
I'm using the word "languages" instead of "scripts" in the manpage, but
I think that's easier to understand with a smaller amount of
descriptions.
2013-09-25 21:42:29 +02:00
wm4 1e4f08c50c options: make --ass-hinting a choice, instead of using magic numbers
options.c still doesn't use the constants defined by the libass headers,
but it's still better than exposing those to the user directly.
2013-09-25 21:40:35 +02:00
wm4 641e94cd27 vaapi: allow GPU read-back with --hwdec=vaapi-copy
This code is actually quite inefficient: it reuses the (slow, simple)
screenshot code. It uses an inefficient method to read the image
(vaGetImage() instead of vaDeriveImage()), allocates new memory for
each frame that is read, and it tries all image formats again each
time.

Also, in my tests it always picked NV12 as image format, which is not
ideal if you actually want to filter the video, and vo_xv can't handle
this format without conversion either.

However, a user confirmed that it worked for him, so everything is fine.
2013-09-25 13:53:42 +02:00
wm4 b0f7a26f1a network: fix rtsp playback
By default, libavformat uses UDP for rtsp playback. This doesn't work
very well. Apparently the reason is that the buffer sizes libavformat
chooses for UDP are way too small, and switching to TCP gets rid of this
issue entirely (thanks go to Reimar Döffinger for figuring this out).

In theory, you can set buffer sizes as libavformat options, but that
doesn't seem to help.

Add an option to select the rtsp transport, and make TCP the default.

Also remove an outdated comment from stream.c.
2013-09-22 02:40:29 +02:00
wm4 3e5b632559 Merge branch 'volume_restore' 2013-09-20 13:48:36 +02:00
wm4 b8e42ae13c mixer: restore volume with playback resume
Note that this is intentionally never done if the AO or softvolume is
different, or if the current volume control method is thought to control
system wide volume (such as ALSA) or otherwise user controllable (such
as PulseAudio). The intention is to keep things robust and to avoid
messing with the user's audio settings as far as possible, while still
providing the ability to resume volume if it makes sense.
2013-09-20 13:23:25 +02:00
Stefano Pigozzi 00d8e85373 Revert "osxbundle: fonts.conf: only look for fonts in ~/.mpv/fonts"
Commit broke text subtitles without embedded fonts. Will look for a better
solution later. Revert it for now, since I'm starting to get bug reports.

This reverts commit 4a9f618d9f.
2013-09-19 21:39:16 +02:00
Stefano Pigozzi 4a9f618d9f osxbundle: fonts.conf: only look for fonts in ~/.mpv/fonts
This is to avoid the 30s hang while mpv caches fonts. In practice all the
fonts an average user is going to use are embedded in mkv files so there is
no reason to build fontconfig's cache on all of OS X system directories.

I might add something similar for terminal usage, but I am highly undecided.
2013-09-18 22:18:33 +02:00
wm4 9aa206a90e screenshot: change %w format to be more like %t
Instead of containing a format string within %w{...}, simply allow %w
to specify one item of a time format string. This is simpler, more like
other format specifiers (%t),  and probably easier to use too.
2013-09-15 19:07:35 +02:00
wm4 aa43405020 screenshot: make it possible to format playback time in various ways 2013-09-15 02:51:19 +02:00
wm4 a87298e501 mplayer: don't run heartbeat command while paused
This is commonly used to disable the screensaver with broken/non-
standard X screensavers. During pause, the screensaver should not be
disabled, so not calling this command while paused seems sensible.

See github issue #236.
2013-09-15 02:13:54 +02:00
wm4 6cec60a454 core: add --deinterlace option, restore it with resume functionality
The --deinterlace option does on playback start what the "deinterlace"
property normally does at runtime. You could do this before by using the
--vf option or by messing with the vo_vdpau default options, but this
new option is supposed to be a "foolproof" way.

The main motivation for adding this is so that the deinterlace property
can be restored when using the video resume functionality
(quit_watch_later command).

Implementation-wise, this is a bit messy. The video chain is rebuilt in
mpcodecs_reconfig_vo(), where we don't have access to MPContext, so the
usual mechanism for enabling deinterlacing can't be used. Further,
mpcodecs_reconfig_vo() is called by the video decoder, which doesn't
have access to MPContext either. Moving this call to mplayer.c isn't
currently possible either (see below). So we just do this before frames
are filtered, which potentially means setting the deinterlacing every
frame. Fortunately, setting deinterlacing is stable and idempotent, so
this is hopefully not a problem. We also add a counter that is
incremented on each reconfig to reduce the amount of additional work per
frame to nearly zero.

The reason we can't move mpcodecs_reconfig_vo() to mplayer.c is because
of hardware decoding: we need to check whether the video chain works
before we decide that we can use hardware decoding. Changing it so that
this can be decided in advance without building a filter chain sounds
like a good idea and should be done, but we aren't there yet.
2013-09-13 21:32:28 +02:00
wm4 6a850b0264 quvi: restore playback position when switching formats
This simply issues a seek after reloading.
2013-09-10 16:50:19 +02:00
wm4 12770d5407 manpage: various improvements
Took a superficial look at the manpage, and fixed whatever I spotted.
2013-09-10 15:12:25 +02:00
Martin Herkt c9873ea06c Manpage: Fix formatting (mostly for PDF output) 2013-09-08 12:02:30 +02:00
wm4 cecbd8864e mplayer: add --cursor-autohide-fs-only option
This option makes the cursor always visible in windowed mode.
Apparently, this is what (some?) Windows and OSX users expect. It's
disabled by default for now.

Restructure the cursor hide logic a bit for this purpose.
2013-09-08 03:03:58 +02:00
wm4 68e331851a options: remove --(no-)mouseinput option
I have no idea why it exists, as it's redundant to --(no-)mouse-movements.
2013-09-08 03:03:58 +02:00
wm4 ae64f29930 options: fix --volume option range, add some explanations to manpage
The --volume option accepted values up to 10000, but internally, the
value is always clipped to 0-100 range. What makes this even worse is
that --softvol-max suggests that it extends the range of --volume, which
is not the case. (And passing a volume larger than 100 to --volume
didn't even print a warning.)
2013-09-07 08:54:12 +02:00
wm4 62ab8441a6 mplayer: make --save-position-on-quit save only on quit
When enabling --save-position-on-quit, playback position stored not only
on quit, but in any case playback of a file was stopped. This includes
going to the next file with playlist navigation commands.

After some discussion on IRC, it turned out that nobody thought this was
good behavior. Disable it, and really make it save only on quit.

Maybe the option is useless now, as the user could remap the CLOSE_WIN
key binding. On the other hand, CLOSE_WIN sounds and _is_ a bit obscure.
2013-09-04 18:12:11 +02:00
wm4 4d62b90f88 video: add unscaled mode with --video-unscaled 2013-09-01 03:46:28 +02:00
wm4 8be9c49fcd core: add a playlist demuxer
Modeled after the old playlist_parser.c, but actually new code, and it
works a bit differently.

Demuxers (and sometimes streams) are the component that should be used
to open files and to determine the file format. This was already done
for subtitles, but playlists still use a separate code path.
2013-08-26 10:09:45 +02:00
Stefano Pigozzi a9cb2dc1b8 video: add vda decode support (with hwaccel) and direct rendering
Decoding H264 using Video Decode Acceleration used the custom 'vda_h264_dec'
decoder in FFmpeg.

The Good: This new implementation has some advantages over the previous one:

 - It works with Libav: vda_h264_dec never got into Libav since they prefer
   client applications to use the hwaccel API.

 - It is way more efficient: in my tests this implementation yields a
   reduction of CPU usage of roughly ~50% compared to using `vda_h264_dec` and
   ~65-75% compared to h264 software decoding. This is mainly because
   `vo_corevideo` was adapted to perform direct rendering of the
   `CVPixelBufferRefs` created by the Video Decode Acceleration API Framework.

The Bad:
  - `vo_corevideo` is required to use VDA decoding acceleration.
  - only works with versions of ffmpeg/libav new enough (needs reference
    refcounting). That is FFmpeg 2.0+ and Libav's git master currently.

The Ugly: VDA was hardcoded to use UYVY (2vuy) for the uploaded video texture.
One one end this makes the code simple since Apple's OpenGL implementation
actually supports this out of the box. It would be nice to support other
output image formats and choose the best format depending on the input, or at
least making it configurable. My tests indicate that CPU usage actually
increases with a 420p IMGFMT output which is not what I would have expected.

NOTE: There is a small memory leak with old versions of FFmpeg and with Libav
since the CVPixelBufferRef is not automatically released when the AVFrame is
deallocated. This can cause leaks inside libavcodec for decoded frames that
are discarded before mpv wraps them inside a refcounted mp_image (this only
happens on seeks).
For frames that enter mpv's refcounting facilities, this is not a problem
since we rewrap the CVPixelBufferRef in our mp_image that properly forwards
CVPixelBufferRetain/CvPixelBufferRelease calls to the underying
CVPixelBufferRef.

So, for FFmpeg use something more recent than `b3d63995` for Libav the patch
was posted to the dev ML in July and in review since, apparently, the proposed
fix is rather hacky.
2013-08-22 12:13:30 +02:00
wm4 74e3a29606 options: replace --edition=-1 with --edition=auto
Originally, the objective of this commit was changing --edition to be
1-based, but this was cancelled. I'm still leaving the change to
demux_mkv.c though, which is now only of cosmetic nature.
2013-08-21 18:41:59 +02:00
wm4 c8a7140c73 mplayer: start track IDs from 1 rather than 0
Completely pointless, but makes ChrisK happy for some reason.

Track ID 0 is now rejected by the option parser itself.
2013-08-21 18:32:42 +02:00
wm4 216e8320b0 video: make it possible to scale/pan the video by arbitrary amounts
Add --video-align-x/y, --video-pan-x/y, --video-scale options and
properties. See the additions to the manpage for description and
semantics.

These transformations are intentionally done on top of panscan. Unlike
the (now removed) --panscanrange option, this doesn't affect the default
panscan behavior. (Although panscan itself becomes kind of useless if
the new options are used.)
2013-08-19 13:03:08 +02:00
wm4 67704e2977 options: remove --panscanrange option
This option allowed you to extend the range of the panscan controls, so
that you could essentially use it to scale the video. This will be
replaced by a separate option to set the zoom factor directly.
2013-08-19 12:55:53 +02:00