Skip to content

Commit

Permalink
Update Stream docs
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Mar 9, 2024
1 parent d6a66c5 commit ba35f55
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 37 deletions.
6 changes: 4 additions & 2 deletions av/audio/stream.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cdef class AudioStream(Stream):
"""
Encode an :class:`.AudioFrame` and return a list of :class:`.Packet`.
:return: :class:`list` of :class:`.Packet`.
:rtype: list[Packet]
.. seealso:: This is mostly a passthrough to :meth:`.CodecContext.encode`.
"""
Expand All @@ -31,7 +31,9 @@ cdef class AudioStream(Stream):
cpdef decode(self, Packet packet=None):
"""
Decode a :class:`.Packet` and return a list of :class:`.AudioFrame`.
:return: :class:`list` of :class:`.AudioFrame`
:rtype: list[AudioFrame]
.. seealso:: This is a passthrough to :meth:`.CodecContext.decode`.
"""

Expand Down
1 change: 0 additions & 1 deletion av/container/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ def open(
Honored only when ``file`` is a file-like object. Defaults to 32768 (32k).
:param timeout: How many seconds to wait for data before giving up, as a float, or a
:ref:`(open timeout, read timeout) <timeouts>` tuple.
:type timeout: float or tuple
:param callable io_open: Custom I/O callable for opening files/streams.
This option is intended for formats that need to open additional
file-like objects to ``file`` using custom I/O.
Expand Down
4 changes: 1 addition & 3 deletions av/video/frame.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,7 @@ cdef class VideoFrame(Frame):
.. note:: For formats which expect an array of ``uint16``, the samples
must be in the system's native byte order.
.. note:: for ``pal8``, an ``(image, palette)`` pair must be passed.
`palette` must have shape (256, 4) and is given in ARGB format
(PyAV will swap bytes if needed).
.. note:: for ``pal8``, an ``(image, palette)`` pair must be passed. `palette` must have shape (256, 4) and is given in ARGB format (PyAV will swap bytes if needed).
"""
if format == "pal8":
array, palette = array
Expand Down
6 changes: 4 additions & 2 deletions av/video/stream.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cdef class VideoStream(Stream):
"""
Encode an :class:`.VideoFrame` and return a list of :class:`.Packet`.
:return: :class:`list` of :class:`.Packet`.
:rtype: list[Packet]
.. seealso:: This is mostly a passthrough to :meth:`.CodecContext.encode`.
"""
Expand All @@ -35,7 +35,9 @@ cdef class VideoStream(Stream):
cpdef decode(self, Packet packet=None):
"""
Decode a :class:`.Packet` and return a list of :class:`.VideoFrame`.
:return: :class:`list` of :class:`.Frame` subclasses.
:rtype: list[VideoFrame]
.. seealso:: This is a passthrough to :meth:`.CodecContext.decode`.
"""

Expand Down
29 changes: 0 additions & 29 deletions docs/api/stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ Basics
.. autoattribute:: Stream.index


Transcoding
~~~~~~~~~~~

.. automethod:: Stream.encode

.. automethod:: Stream.decode


Timing
~~~~~~

Expand All @@ -87,27 +79,6 @@ Timing
.. autoattribute:: Stream.frames


.. _frame_rates:

Frame Rates
...........


These attributes are different ways of calculating frame rates.

Since containers don't need to explicitly identify a frame rate, nor
even have a static frame rate, these attributes are not guaranteed to be accurate.
You must experiment with them with your media to see which ones work for you for your purposes.

Whenever possible, we advise that you use raw timing instead of frame rates.

.. autoattribute:: Stream.average_rate

.. autoattribute:: Stream.base_rate

.. autoattribute:: Stream.guessed_rate


Others
~~~~~~

Expand Down

0 comments on commit ba35f55

Please sign in to comment.