1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-19 22:36:55 +00:00
mpv/DOCS/man
wm4 a3823ce0e0 player: add optional separate video decoding thread
See manpage additions. This has been a topic in MPlayer/mplayer2/mpv
since forever. But since libavcodec multi-threaded decoding was added,
I've always considered this pointless. libavcodec requires you to
"preload" it with packets, and then you can pretty much avoid blocking
on it, if decoding is fast enough.

But in some cases, a decoupled decoder thread _might_ help. Users have
for example come up with cases where decoding video in a separate
process and piping it as raw video to mpv helped. (Or my memory is
false, and it was about vapoursynth filtering, who knows.) So let's just
see whether this helps with anything.

Note that this would have been _much_ easier if libavcodec had an
asynchronous (or rather, non-blocking) API. It could probably have
easily gained that with a small change to its multi-threading code and a
small extension to its API, but I guess not.

Unfortunately, this uglifies f_decoder_wrapper quite a lot. Part of this
is due to annoying corner cases like legacy frame dropping and hardware
decoder state. These could probably be prettified later on.

There is also a change in playloop.c: this is because there is a need to
coordinate playback resets between demuxer thread, decoder thread, and
playback logic. I think this SEEK_BLOCK idea worked out reasonably well.

There are still a number of problems. For example, if the demuxer cache
is full, the decoder thread will simply block hard until the output
queue is full, which interferes with seeking. Could also be improved
later. Hardware decoding will probably die in a fire, because it will
run out of surfaces quickly. We could reduce the queue to size 1...
maybe later. We could update the queue options at runtime easily, but
currently I'm not going to bother.

I could only have put the lavc wrapper itself on a separate thread. But
there is some annoying interaction with EDL and backward playback shit,
and also you would have had to loop demuxer packets through the
playloop, so this sounded less annoying.

The food my mother made for us today was delicious.

Because audio uses the same code, also for audio (even if completely
pointless).

Fixes: #6926
2020-02-29 21:52:00 +01:00
..
af.rst audio: remove unreferenced af_lavrresample 2019-09-19 20:37:05 +02:00
ao.rst ao_pulse: add --pulse-allow-suspended 2019-09-21 12:54:36 +02:00
changes.rst manpage: directly link interface-changes.rst in changelog section 2020-02-21 14:34:02 +01:00
console.rst console: use hidpi scale reporting 2019-12-20 13:00:39 +01:00
encode.rst manpage: explain deprecated usage of multiple items with *-add 2020-01-07 18:13:12 +01:00
input.rst manpage: fix typo on sub-end 2020-02-12 19:13:05 +01:00
ipc.rst ipc: allow sending commands with named arguments 2020-02-24 00:31:46 +01:00
javascript.rst DOCS: js: minor update for require 2020-02-07 19:24:00 +02:00
libmpv.rst manpage: define stricter rules for C plugin return values 2017-01-14 17:41:04 +01:00
lua.rst manpage: improve command_native_async description 2020-02-16 23:03:14 +01:00
mpv.rst manpage: fix some path description details 2020-02-21 12:13:54 +01:00
options.rst player: add optional separate video decoding thread 2020-02-29 21:52:00 +01:00
osc.rst osc: use default hr-seek when dragging progress bar to seek 2020-02-28 17:17:42 +01:00
stats.rst manpage: document stats page 3 2019-10-31 11:06:22 +01:00
vf.rst vf_format: add w, h parameters 2020-02-09 18:23:22 +01:00
vo.rst sws_utils, zimg: destroy vo_x11 and vo_drm performance 2019-10-31 16:51:12 +01:00