File: libtorio.stream_writer.rst

package info (click to toggle)
pytorch-audio 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,696 kB
  • sloc: python: 61,274; cpp: 10,031; sh: 128; ansic: 70; makefile: 34
file content (80 lines) | stat: -rw-r--r-- 1,930 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.. warning::
   TorchAudio's C++ API is prototype feature.
   API/ABI backward compatibility is not guaranteed.


.. note::
   The top-level namespace has been changed from ``torchaudio`` to ``torio``.
   ``StreamWriter`` has been renamed to ``StreamingMediaEncoder``.


torio::io::StreamingMediaEncoder
================================

``StreamingMediaEncoder`` is the implementation used by Python equivalent and provides similar interface.
When working with custom I/O, such as in-memory data, ``StreamingMediaEncoderCustomIO`` class can be used.

Both classes have the same methods defined, so their usages are the same.

Constructors
------------

StreamingMediaEncoder
^^^^^^^^^^^^^^^^^^^^^

.. doxygenclass:: torio::io::StreamingMediaEncoder

.. doxygenfunction:: torio::io::StreamingMediaEncoder::StreamingMediaEncoder(const std::string &dst, const std::optional<std::string> &format = {})

StreamingMediaEncoderCustomIO
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. doxygenclass:: torio::io::StreamingMediaEncoderCustomIO

.. doxygenfunction:: torio::io::StreamingMediaEncoderCustomIO::StreamingMediaEncoderCustomIO

Config methods
--------------

add_audio_stream
^^^^^^^^^^^^^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::add_audio_stream

add_video_stream
^^^^^^^^^^^^^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::add_video_stream

set_metadata
^^^^^^^^^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::set_metadata

Write methods
-------------

open
^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::open

close
^^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::close

write_audio_chunk
^^^^^^^^^^^^^^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::write_audio_chunk

write_video_chunk
^^^^^^^^^^^^^^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::write_video_chunk

flush
^^^^^

.. doxygenfunction:: torio::io::StreamingMediaEncoder::flush