Skip to content

Commit

Permalink
Remove classic Linux analog TV support, and DVB runtime controls
Browse files Browse the repository at this point in the history
Linux analog TV support (via tv://) was excessively complex, and
whenever I attempted to use it (cameras or loopback devices), it didn't
work well, or would have required some major work to update it. It's
very much stuck in the analog past (my favorite are the frequency tables
in frequencies.c for analog TV channels which don't exist anymore).

Especially cameras and such work fine with libavdevice and better than
tv://, for example:

  mpv av://v4l2:/dev/video0

(adding --profile=low-latency --untimed even makes it mostly realtime)

Adding a new input layer that targets such "modern" uses would be
acceptable, if anyone is interested in it. The old TV code is just too
focused on actual analog TV.

DVB is rather obscure, but has an active maintainer, so don't remove it.
However, the demux/stream ctrl layer must go, so remove controls for
channel switching. Most of these could be reimplemented by using the
normal method for option runtime changes.
  • Loading branch information
wm4 committed Sep 13, 2019
1 parent 162e0f5 commit b30e855
Show file tree
Hide file tree
Showing 27 changed files with 13 additions and 6,236 deletions.
2 changes: 2 additions & 0 deletions DOCS/interface-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Interface changes
with the move to libplacebo as the back-end for vulkan rendering.
- Remove "disc-titles", "disc-title", "disc-title-list", and "angle"
properties. dvd:// does not support title ranges anymore.
- Remove all "tv-..." options and properties, along with the classic Linux
analog TV support.
--- mpv 0.29.0 ---
- drop --opensles-sample-rate, as --audio-samplerate should be used if desired
- drop deprecated --videotoolbox-format, --ff-aid, --ff-vid, --ff-sid,
Expand Down
15 changes: 1 addition & 14 deletions DOCS/man/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,7 @@ Input Commands that are Possibly Subject to Change
``--glsl-shader=file.glsl``.


Undocumented commands: ``tv-last-channel`` (TV/DVB only),
``ao-reload`` (experimental/internal).
Undocumented commands: ``ao-reload`` (experimental/internal).

Hooks
~~~~~
Expand Down Expand Up @@ -1815,25 +1814,13 @@ Property list
``program`` (W)
Switch TS program (write-only).

``dvb-channel`` (W)
Pair of integers: card,channel of current DVB stream.
Can be switched to switch to another channel on the same card.

``dvb-channel-name`` (RW)
Name of current DVB program.
On write, a channel-switch to the named channel on the same
card is performed. Can also be used for channel switching.

``sub-text``
Return the current subtitle text. Formatting is stripped. If a subtitle
is selected, but no text is currently visible, or the subtitle is not
text-based (i.e. DVD/BD subtitles), an empty string is returned.

This property is experimental and might be removed in the future.

``tv-brightness``, ``tv-contrast``, ``tv-saturation``, ``tv-hue`` (RW)
TV stuff.

``playlist-pos`` (RW)
Current position on playlist. The first entry is on position 0. Writing
to the property will restart playback at the written entry.
Expand Down
185 changes: 0 additions & 185 deletions DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3657,191 +3657,6 @@ Terminal
``--msg-time``
Prepend timing information to each console message.


TV
--

``--tv-...``
These options tune various properties of the TV capture module. For
watching TV with mpv, use ``tv://`` or ``tv://<channel_number>`` or
even ``tv://<channel_name>`` (see option ``tv-channels`` for ``channel_name``
below) as a media URL. You can also use ``tv:///<input_id>`` to start
watching a video from a composite or S-Video input (see option ``input`` for
details).

``--tv-device=<value>``
Specify TV device (default: ``/dev/video0``).

``--tv-channel=<value>``
Set tuner to <value> channel.

``--no-tv-audio``
no sound

``--tv-automute=<0-255> (v4l and v4l2 only)``
If signal strength reported by device is less than this value, audio
and video will be muted. In most cases automute=100 will be enough.
Default is 0 (automute disabled).

``--tv-driver=<value>``
See ``--tv=driver=help`` for a list of compiled-in TV input drivers.
available: dummy, v4l2 (default: autodetect)

``--tv-input=<value>``
Specify input (default: 0 (TV), see console output for available
inputs).

``--tv-freq=<value>``
Specify the frequency to set the tuner to (e.g. 511.250). Not
compatible with the channels parameter.

``--tv-outfmt=<value>``
Specify the output format of the tuner with a preset value supported
by the V4L driver (YV12, UYVY, YUY2, I420) or an arbitrary format given
as hex value.

``--tv-width=<value>``
output window width

``--tv-height=<value>``
output window height

``--tv-fps=<value>``
framerate at which to capture video (frames per second)

``--tv-buffersize=<value>``
maximum size of the capture buffer in megabytes (default: dynamical)

``--tv-norm=<value>``
See the console output for a list of all available norms.

See also: ``--tv-normid``.

``--tv-normid=<value> (v4l2 only)``
Sets the TV norm to the given numeric ID. The TV norm depends on the
capture card. See the console output for a list of available TV norms.

``--tv-chanlist=<value>``
available: argentina, australia, china-bcast, europe-east,
europe-west, france, ireland, italy, japan-bcast, japan-cable,
newzealand, russia, southafrica, us-bcast, us-cable, us-cable-hrc

``--tv-channels=<chan>-<name>[=<norm>],<chan>-<name>[=<norm>],...``
Set names for channels.

.. note::

If <chan> is an integer greater than 1000, it will be treated as
frequency (in kHz) rather than channel name from frequency table.
Use _ for spaces in names (or play with quoting ;-) ). The channel
names will then be written using OSD, and the input commands
``tv_step_channel``, ``tv_set_channel`` and ``tv_last_channel``
will be usable for a remote control. Not compatible with
the ``frequency`` parameter.

.. note::

The channel number will then be the position in the 'channels'
list, beginning with 1.

.. admonition:: Examples

``tv://1``, ``tv://TV1``, ``tv_set_channel 1``,
``tv_set_channel TV1``

``--tv-[brightness|contrast|hue|saturation]=<-100-100>``
Set the image equalizer on the card.

``--tv-audiorate=<value>``
Set input audio sample rate.

``--tv-forceaudio``
Capture audio even if there are no audio sources reported by v4l.

``--tv-alsa``
Capture from ALSA.

``--tv-amode=<0-3>``
Choose an audio mode:

:0: mono
:1: stereo
:2: language 1
:3: language 2

``--tv-forcechan=<1-2>``
By default, the count of recorded audio channels is determined
automatically by querying the audio mode from the TV card. This option
allows forcing stereo/mono recording regardless of the amode option
and the values returned by v4l. This can be used for troubleshooting
when the TV card is unable to report the current audio mode.

``--tv-adevice=<value>``
Set an audio device. <value> should be ``/dev/xxx`` for OSS and a
hardware ID for ALSA. You must replace any ':' by a '.' in the
hardware ID for ALSA.

``--tv-audioid=<value>``
Choose an audio output of the capture card, if it has more than one.

``--tv-[volume|bass|treble|balance]=<0-100>``
These options set parameters of the mixer on the video capture card.
They will have no effect, if your card does not have one. For v4l2 50
maps to the default value of the control, as reported by the driver.

``--tv-gain=<0-100>``
Set gain control for video devices (usually webcams) to the desired
value and switch off automatic control. A value of 0 enables automatic
control. If this option is omitted, gain control will not be modified.

``--tv-immediatemode=<bool>``
A value of 0 means capture and buffer audio and video together. A
value of 1 (default) means to do video capture only and let the audio
go through a loopback cable from the TV card to the sound card.

``--tv-mjpeg``
Use hardware MJPEG compression (if the card supports it). When using
this option, you do not need to specify the width and height of the
output window, because mpv will determine it automatically from
the decimation value (see below).

``--tv-decimation=<1|2|4>``
choose the size of the picture that will be compressed by hardware
MJPEG compression:

:1: full size

- 704x576 PAL
- 704x480 NTSC

:2: medium size

- 352x288 PAL
- 352x240 NTSC

:4: small size

- 176x144 PAL
- 176x120 NTSC

``--tv-quality=<0-100>``
Choose the quality of the JPEG compression (< 60 recommended for full
size).

``--tv-scan-autostart``
Begin channel scanning immediately after startup (default: disabled).

``--tv-scan-period=<0.1-2.0>``
Specify delay in seconds before switching to next channel (default:
0.5). Lower values will cause faster scanning, but can detect inactive
TV channels as active.

``--tv-scan-threshold=<1-100>``
Threshold value for the signal strength (in percent), as reported by
the device (default: 50). A signal strength higher than this value will
indicate that the currently scanning channel is active.


Cache
-----

Expand Down
4 changes: 0 additions & 4 deletions demux/demux.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ extern const struct demuxer_desc demuxer_desc_edl;
extern const struct demuxer_desc demuxer_desc_cue;
extern const demuxer_desc_t demuxer_desc_rawaudio;
extern const demuxer_desc_t demuxer_desc_rawvideo;
extern const demuxer_desc_t demuxer_desc_tv;
extern const demuxer_desc_t demuxer_desc_mf;
extern const demuxer_desc_t demuxer_desc_matroska;
extern const demuxer_desc_t demuxer_desc_lavf;
Expand All @@ -71,9 +70,6 @@ const demuxer_desc_t *const demuxer_list[] = {
&demuxer_desc_cue,
&demuxer_desc_rawaudio,
&demuxer_desc_rawvideo,
#if HAVE_TV
&demuxer_desc_tv,
#endif
&demuxer_desc_matroska,
#if HAVE_LIBARCHIVE
&demuxer_desc_libarchive,
Expand Down
1 change: 0 additions & 1 deletion demux/demux.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ typedef struct demuxer {
bool fully_read;
bool is_network; // opened directly from a network stream
bool access_references; // allow opening other files/URLs
bool extended_ctrls; // supports some of BD/DVD/DVB/TV controls

// Bitmask of DEMUX_EVENT_*
int events;
Expand Down
Loading

0 comments on commit b30e855

Please sign in to comment.