PyNvVideoCodec 2.2.1__cp314-cp314-win_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. PyNvVideoCodec/PyNvVideoCodec_121.cp314-win_arm64.pyd +0 -0
  2. PyNvVideoCodec/PyNvVideoCodec_130.cp314-win_arm64.pyd +0 -0
  3. PyNvVideoCodec/VersionCheck.cp314-win_arm64.pyd +0 -0
  4. PyNvVideoCodec/__init__.py +251 -0
  5. PyNvVideoCodec/avformat-62.dll +0 -0
  6. PyNvVideoCodec/avutil-60.dll +0 -0
  7. PyNvVideoCodec/decoders/SimpleDecoder.py +273 -0
  8. PyNvVideoCodec/decoders/ThreadedDecoder.py +129 -0
  9. PyNvVideoCodec/decoders/__init__.py +22 -0
  10. PyNvVideoCodec/transcoder/Transcoder.py +55 -0
  11. PyNvVideoCodec/transcoder/__init__.py +22 -0
  12. benchmarks/cached_decoder_benchmark.py +813 -0
  13. benchmarks/frame_sampling_benchmark.py +765 -0
  14. benchmarks/requirements.txt +52 -0
  15. benchmarks/segmented_transcode_benchmark.py +1546 -0
  16. benchmarks/setup_pycuda_win_arm64.bat +531 -0
  17. pynvvideocodec-2.2.1.data/data/external/ffmpeg/readme.txt +39 -0
  18. pynvvideocodec-2.2.1.data/data/external/ffmpeg/src/ffmpeg-8.1.2.tar.xz +0 -0
  19. pynvvideocodec-2.2.1.dist-info/METADATA +97 -0
  20. pynvvideocodec-2.2.1.dist-info/RECORD +63 -0
  21. pynvvideocodec-2.2.1.dist-info/WHEEL +5 -0
  22. pynvvideocodec-2.2.1.dist-info/licenses/LICENSE.txt +22 -0
  23. pynvvideocodec-2.2.1.dist-info/licenses/NOTICES.txt +167 -0
  24. pynvvideocodec-2.2.1.dist-info/top_level.txt +3 -0
  25. samples/advanced/decode.py +173 -0
  26. samples/advanced/decode_from_memory_buffer.py +204 -0
  27. samples/advanced/decode_perf.py +299 -0
  28. samples/advanced/decode_reconfigure.py +184 -0
  29. samples/advanced/decode_sei_msg.py +193 -0
  30. samples/advanced/decode_with_cuda_control.py +214 -0
  31. samples/advanced/decode_with_low_latency.py +183 -0
  32. samples/advanced/encode_config.json +12 -0
  33. samples/advanced/encode_config_lowlatency.json +13 -0
  34. samples/advanced/encode_perf.py +338 -0
  35. samples/advanced/encode_reconfigure.py +211 -0
  36. samples/advanced/encode_sei_msg.py +188 -0
  37. samples/advanced/simple_decode_from_memory.py +151 -0
  38. samples/advanced/simple_decode_stats.py +179 -0
  39. samples/advanced/transcode.py +288 -0
  40. samples/basic/create_video_segments.py +187 -0
  41. samples/basic/encode.py +574 -0
  42. samples/basic/segments.txt +3 -0
  43. samples/basic/simple_decode_sampling.py +182 -0
  44. samples/basic/transcode_config.json +6 -0
  45. samples/jupyter/ReconfigureDecoder.png +0 -0
  46. samples/jupyter/SimpleDecoderAPIs.png +0 -0
  47. samples/jupyter/ThreadedDecoder.png +0 -0
  48. samples/jupyter/coco_classes.pickle +0 -0
  49. samples/jupyter/face_protect_tutorial.ipynb +881 -0
  50. samples/jupyter/object_detection_tutorial.ipynb +781 -0
  51. samples/jupyter/simple_decode_tutorial.ipynb +674 -0
  52. samples/requirements.txt +84 -0
  53. samples/setup_pycuda_win_arm64.bat +531 -0
  54. samples/utils/Utils.py +405 -0
  55. samples/utils/__init__.py +36 -0
  56. samples/utils/decode_parser.py +642 -0
  57. samples/utils/decode_stats_writer.py +177 -0
  58. samples/utils/encode_parallel_utils.py +174 -0
  59. samples/utils/encode_parser.py +379 -0
  60. samples/utils/frame_utils.py +89 -0
  61. samples/utils/sei_message_parser.py +223 -0
  62. samples/utils/sei_parser.py +223 -0
  63. samples/utils/transcode_parser.py +218 -0
@@ -0,0 +1,63 @@
1
+ PyNvVideoCodec/PyNvVideoCodec_121.cp314-win_arm64.pyd,sha256=kmHnTQrHMgJVIeVxuM44hQlMnz7HGO1e3PmJKRd5yVI,1570304
2
+ PyNvVideoCodec/PyNvVideoCodec_130.cp314-win_arm64.pyd,sha256=Y6vkDtmJExJFO2cBsjVeN7KRe8hD6CMAMJrh0Hba5jM,1575936
3
+ PyNvVideoCodec/VersionCheck.cp314-win_arm64.pyd,sha256=iQRPIY3a4pBwvw4NDdcyplfgXG1MUzxfNoVU7rsVXQ0,140800
4
+ PyNvVideoCodec/__init__.py,sha256=id6Kqu3Mg3kL_IB7aplk_nD3mkvzHtdq2umTHEVC2Yg,10523
5
+ PyNvVideoCodec/avformat-62.dll,sha256=GMn2UAqurlBBH0XYEKfAXiYYAGzEJwwc703WiwxWjj4,4007936
6
+ PyNvVideoCodec/avutil-60.dll,sha256=lD33ywf7bKiTdgfIgJ1nFZM0JvS4n6qgQ4pJC8Za2Pw,821248
7
+ PyNvVideoCodec/decoders/SimpleDecoder.py,sha256=17Lm0QXXfFjHBMJp9zthV9v9dOifAguQb9RgPJamk1o,13003
8
+ PyNvVideoCodec/decoders/ThreadedDecoder.py,sha256=KeQj3IDL03Yc3-MnoO2EsFIfzXTNRfRo7h3U46tLoi0,6805
9
+ PyNvVideoCodec/decoders/__init__.py,sha256=opQYWVM7fVcCedCrl6J_3eWGbKN4q55ffvnJKgwq6co,1259
10
+ PyNvVideoCodec/transcoder/Transcoder.py,sha256=0Pc81-paVtxZwArHb2FJ9luhD2WYgLoiL_cQw515pFA,2443
11
+ PyNvVideoCodec/transcoder/__init__.py,sha256=2nkwMgry3-aPl_MNzdh6wCDR9bGJWzUzN9mHgbqX6Uk,1261
12
+ benchmarks/cached_decoder_benchmark.py,sha256=Bu3O7G_fGudgxs5ZLrjYYdpQlppaoHBOi-d_kEEXNLA,33544
13
+ benchmarks/frame_sampling_benchmark.py,sha256=PdkUKeG1uwMkkhULnQChQA_V3U2jNRtuXEt7cdr14Ek,33583
14
+ benchmarks/requirements.txt,sha256=jlnVPYFJKzOo9GtHvy1SmwLf-V6E1TMWaVvI_GW9crg,2443
15
+ benchmarks/segmented_transcode_benchmark.py,sha256=zZVviIwIsCwJgutiqMq6Ik1AF-QS8V7cz2bVPvHyjag,68582
16
+ benchmarks/setup_pycuda_win_arm64.bat,sha256=SUMucfvlMWtS264irb9h4-XNjx0fWPcOVDpCw4y60iQ,18786
17
+ pynvvideocodec-2.2.1.data/data/external/ffmpeg/readme.txt,sha256=EUUsG8ITVm9o9-SiOYI5DQ1fw_SrPjH13YQWyg2F_F0,2513
18
+ pynvvideocodec-2.2.1.data/data/external/ffmpeg/src/ffmpeg-8.1.2.tar.xz,sha256=RkvrXnvwwxHmi0WuLwTpzCr4iFGrtAgiMXQqdNl7Ukw,11710924
19
+ pynvvideocodec-2.2.1.dist-info/licenses/LICENSE.txt,sha256=2zbykdcROaQUD-lZ0yCXhia2szvXi5rnNgA-JV1hP4o,1174
20
+ pynvvideocodec-2.2.1.dist-info/licenses/NOTICES.txt,sha256=YO5BKdOKsY_HJTtamtqg6o7RoHOzl87HY2zsCUdICdk,7886
21
+ samples/requirements.txt,sha256=Pqgfageq8r_8cBAYOmcbwIgKs5aKB_z1fgkY5NqrtO0,3645
22
+ samples/setup_pycuda_win_arm64.bat,sha256=SUMucfvlMWtS264irb9h4-XNjx0fWPcOVDpCw4y60iQ,18786
23
+ samples/advanced/decode.py,sha256=diX6orPXRWT4jz0tgIhGHzvMgcB8cKm1Pdo8PsX96I8,7720
24
+ samples/advanced/decode_from_memory_buffer.py,sha256=cmQBQ63L3wQpYQagrF4XSIpiPyL_hsr8ZZdbIRANM7g,7811
25
+ samples/advanced/decode_perf.py,sha256=KkNbQ8DziAWWZEpWDWcoUGxOJZsJTeUxdNbCeId9ZdI,12267
26
+ samples/advanced/decode_reconfigure.py,sha256=dmy7k_Aq8Ke9Ok0Uwu-RYeuHVywrK9MbGgVzxaRT8HY,8309
27
+ samples/advanced/decode_sei_msg.py,sha256=xWR-_yRCb4LbQvKAfkD18YBldUrkZo8gloq4Yz9Rllc,8257
28
+ samples/advanced/decode_with_cuda_control.py,sha256=G9PQcjUl4wRLt4lB0F-vf3b9Ic1oh0sG4iVNTS77Zoo,9258
29
+ samples/advanced/decode_with_low_latency.py,sha256=mqMRQI29yLzRJ8CBL38Xc9enSG3hBAhSCiByCuZ7y1g,8292
30
+ samples/advanced/encode_config.json,sha256=GU2-GNZnw4L839yisJp5TeZawEVQ0vjvpL2_0A9BrGY,199
31
+ samples/advanced/encode_config_lowlatency.json,sha256=-EFHJtDnS0zw7bovb3tY4E_ww4EnD2KRgwgvQpIYCvY,233
32
+ samples/advanced/encode_perf.py,sha256=SxgYxVOR7eJVHhlK8qBYJv2Pu9-7I-BwCVT0vdrujXQ,13288
33
+ samples/advanced/encode_reconfigure.py,sha256=T0A-FjwHJPURYG91u5Q0QyFhjYZD54nYQTEsErRsX3E,8739
34
+ samples/advanced/encode_sei_msg.py,sha256=7NnBGjXcgK3QF3CHZcKiXfivFHpiOK-O3wGwJ1b1cw0,8056
35
+ samples/advanced/simple_decode_from_memory.py,sha256=LdJdFtzrO_q0fEjUR_ACwIkzj24DV5yFucQCUi80hW4,6913
36
+ samples/advanced/simple_decode_stats.py,sha256=wt3HADZGAbWuAmmezFMCgljqRQiaA6XsVDy9sZL_Cu4,7171
37
+ samples/advanced/transcode.py,sha256=0dyOHiNVSh_sBvIZz4jTw411SZBznOednN93ViM0HSk,11548
38
+ samples/basic/create_video_segments.py,sha256=COthhME8KfHGJhL_rGpdKkjS-HzjvRHxtrOn5L8z5bs,7631
39
+ samples/basic/encode.py,sha256=tN1eyhzpzwk-UF2YqLv0Irq3f2T-syi535fLwYKPGlc,22785
40
+ samples/basic/segments.txt,sha256=URKw_1BeqiMV2vYaPc213Z1YnUbnyYPzCONRJ5qAXmU,17
41
+ samples/basic/simple_decode_sampling.py,sha256=oj7Ve9jNWTJQYN-U3ZelP6KvSknz4INE0Yw9SUNvBmI,6990
42
+ samples/basic/transcode_config.json,sha256=mSnYYW5KOVlMC6pmG3guLtAqBn1PQzcLXPy2Gl7vObU,102
43
+ samples/jupyter/ReconfigureDecoder.png,sha256=DsEFxg0RBPucx_Ky_HaZ5iE21TJ-aTQlOMAOenIHDco,114179
44
+ samples/jupyter/SimpleDecoderAPIs.png,sha256=uJM1EAI1xg6Om0PCP6joLo1W4i0A0Xp9YUqTuEgq2ic,54815
45
+ samples/jupyter/ThreadedDecoder.png,sha256=Ts4MpymKaKjNJlSQdlzeO_uBxce5_aZe14_VlZKqSvU,98415
46
+ samples/jupyter/coco_classes.pickle,sha256=kkzIHUQ4Xz8CDISRbPmClEqM86WeV9i16SCs-vYM-jg,838
47
+ samples/jupyter/face_protect_tutorial.ipynb,sha256=iZ73kk9Fitiz2jIMfryrH39-8DeiEpDw-vhvM-WjGdc,37447
48
+ samples/jupyter/object_detection_tutorial.ipynb,sha256=e_kYnbguhGZOhbvN6da5dsIbFIIRKN5Y_faQ-ott-4k,392290
49
+ samples/jupyter/simple_decode_tutorial.ipynb,sha256=NQlbOWgo8EbB340jERHvrp2bkDeMY-xvc_ZT0fvLxcQ,5286941
50
+ samples/utils/Utils.py,sha256=yeMrz4BSg_P4Xzt9jx7m7cRzMnNKqp9GGhRXPRtgo0A,17773
51
+ samples/utils/__init__.py,sha256=w8rVqKtCUkDPxAyGvUn33Pij74bSkbGIthq13OsKVZs,1915
52
+ samples/utils/decode_parser.py,sha256=QDZmbYvaBfn7oozvQHnAC93F1Qy8jTtpkdDgmgv5cmI,25347
53
+ samples/utils/decode_stats_writer.py,sha256=HZe2J6MBgbeg_rjZHFf_Y3naEU4Qc7S7Gz_hkHikal0,7996
54
+ samples/utils/encode_parallel_utils.py,sha256=Y4rHnZAEkdE_MilRRfGqNZENB5qP9ePJQsOQs7JIwyc,6590
55
+ samples/utils/encode_parser.py,sha256=LPvfo9GaqGyoFV91BovSsSlME3PXT9hWJYYkhaubkM0,13076
56
+ samples/utils/frame_utils.py,sha256=a_-JC7NuBLvANTjMY50NBKOj1YXtdB4L_JVInKp2rmI,3478
57
+ samples/utils/sei_message_parser.py,sha256=Z5mZxat-PFKClrNcDHKfwmJYZoNLOok2qZnDCD5FJ0M,10079
58
+ samples/utils/sei_parser.py,sha256=Z5mZxat-PFKClrNcDHKfwmJYZoNLOok2qZnDCD5FJ0M,10079
59
+ samples/utils/transcode_parser.py,sha256=vmOqcYDRuEROWe8eC_z59nNRDUvOEGuBiRa0bxa24Hw,8410
60
+ pynvvideocodec-2.2.1.dist-info/METADATA,sha256=dZDhtG1j3jqG_iDGrdok-k5xEiMJUY6GOZ442OVtdcw,7393
61
+ pynvvideocodec-2.2.1.dist-info/WHEEL,sha256=fkyl4vyYuWLLIMFl4O-VCp5wj5uPuRDj1taCfThTvxw,96
62
+ pynvvideocodec-2.2.1.dist-info/top_level.txt,sha256=L7cP7N5LjGw80fJ7i2c9HYNZk7U3G80zVXDKNaffjLg,34
63
+ pynvvideocodec-2.2.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: skbuild 0.18.1
3
+ Root-Is-Purelib: false
4
+ Tag: cp314-cp314-win_arm64
5
+
@@ -0,0 +1,22 @@
1
+ SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ SPDX-License-Identifier: MIT
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a
5
+ copy of this software and associated documentation files (the "Software"),
6
+ to deal in the Software without restriction, including without limitation
7
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
+ and/or sell copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
+ DEALINGS IN THE SOFTWARE.
21
+
22
+
@@ -0,0 +1,167 @@
1
+ This SDK includes portions of FFMPEG, under the following license:
2
+
3
+ GNU LESSER GENERAL PUBLIC LICENSE
4
+ Version 3, 29 June 2007
5
+
6
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
7
+ Everyone is permitted to copy and distribute verbatim copies
8
+ of this license document, but changing it is not allowed.
9
+
10
+
11
+ This version of the GNU Lesser General Public License incorporates
12
+ the terms and conditions of version 3 of the GNU General Public
13
+ License, supplemented by the additional permissions listed below.
14
+
15
+ 0. Additional Definitions.
16
+
17
+ As used herein, "this License" refers to version 3 of the GNU Lesser
18
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
19
+ General Public License.
20
+
21
+ "The Library" refers to a covered work governed by this License,
22
+ other than an Application or a Combined Work as defined below.
23
+
24
+ An "Application" is any work that makes use of an interface provided
25
+ by the Library, but which is not otherwise based on the Library.
26
+ Defining a subclass of a class defined by the Library is deemed a mode
27
+ of using an interface provided by the Library.
28
+
29
+ A "Combined Work" is a work produced by combining or linking an
30
+ Application with the Library. The particular version of the Library
31
+ with which the Combined Work was made is also called the "Linked
32
+ Version".
33
+
34
+ The "Minimal Corresponding Source" for a Combined Work means the
35
+ Corresponding Source for the Combined Work, excluding any source code
36
+ for portions of the Combined Work that, considered in isolation, are
37
+ based on the Application, and not on the Linked Version.
38
+
39
+ The "Corresponding Application Code" for a Combined Work means the
40
+ object code and/or source code for the Application, including any data
41
+ and utility programs needed for reproducing the Combined Work from the
42
+ Application, but excluding the System Libraries of the Combined Work.
43
+
44
+ 1. Exception to Section 3 of the GNU GPL.
45
+
46
+ You may convey a covered work under sections 3 and 4 of this License
47
+ without being bound by section 3 of the GNU GPL.
48
+
49
+ 2. Conveying Modified Versions.
50
+
51
+ If you modify a copy of the Library, and, in your modifications, a
52
+ facility refers to a function or data to be supplied by an Application
53
+ that uses the facility (other than as an argument passed when the
54
+ facility is invoked), then you may convey a copy of the modified
55
+ version:
56
+
57
+ a) under this License, provided that you make a good faith effort to
58
+ ensure that, in the event an Application does not supply the
59
+ function or data, the facility still operates, and performs
60
+ whatever part of its purpose remains meaningful, or
61
+
62
+ b) under the GNU GPL, with none of the additional permissions of
63
+ this License applicable to that copy.
64
+
65
+ 3. Object Code Incorporating Material from Library Header Files.
66
+
67
+ The object code form of an Application may incorporate material from
68
+ a header file that is part of the Library. You may convey such object
69
+ code under terms of your choice, provided that, if the incorporated
70
+ material is not limited to numerical parameters, data structure
71
+ layouts and accessors, or small macros, inline functions and templates
72
+ (ten or fewer lines in length), you do both of the following:
73
+
74
+ a) Give prominent notice with each copy of the object code that the
75
+ Library is used in it and that the Library and its use are
76
+ covered by this License.
77
+
78
+ b) Accompany the object code with a copy of the GNU GPL and this license
79
+ document.
80
+
81
+ 4. Combined Works.
82
+
83
+ You may convey a Combined Work under terms of your choice that,
84
+ taken together, effectively do not restrict modification of the
85
+ portions of the Library contained in the Combined Work and reverse
86
+ engineering for debugging such modifications, if you also do each of
87
+ the following:
88
+
89
+ a) Give prominent notice with each copy of the Combined Work that
90
+ the Library is used in it and that the Library and its use are
91
+ covered by this License.
92
+
93
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
94
+ document.
95
+
96
+ c) For a Combined Work that displays copyright notices during
97
+ execution, include the copyright notice for the Library among
98
+ these notices, as well as a reference directing the user to the
99
+ copies of the GNU GPL and this license document.
100
+
101
+ d) Do one of the following:
102
+
103
+ 0) Convey the Minimal Corresponding Source under the terms of this
104
+ License, and the Corresponding Application Code in a form
105
+ suitable for, and under terms that permit, the user to
106
+ recombine or relink the Application with a modified version of
107
+ the Linked Version to produce a modified Combined Work, in the
108
+ manner specified by section 6 of the GNU GPL for conveying
109
+ Corresponding Source.
110
+
111
+ 1) Use a suitable shared library mechanism for linking with the
112
+ Library. A suitable mechanism is one that (a) uses at run time
113
+ a copy of the Library already present on the user's computer
114
+ system, and (b) will operate properly with a modified version
115
+ of the Library that is interface-compatible with the Linked
116
+ Version.
117
+
118
+ e) Provide Installation Information, but only if you would otherwise
119
+ be required to provide such information under section 6 of the
120
+ GNU GPL, and only to the extent that such information is
121
+ necessary to install and execute a modified version of the
122
+ Combined Work produced by recombining or relinking the
123
+ Application with a modified version of the Linked Version. (If
124
+ you use option 4d0, the Installation Information must accompany
125
+ the Minimal Corresponding Source and Corresponding Application
126
+ Code. If you use option 4d1, you must provide the Installation
127
+ Information in the manner specified by section 6 of the GNU GPL
128
+ for conveying Corresponding Source.)
129
+
130
+ 5. Combined Libraries.
131
+
132
+ You may place library facilities that are a work based on the
133
+ Library side by side in a single library together with other library
134
+ facilities that are not Applications and are not covered by this
135
+ License, and convey such a combined library under terms of your
136
+ choice, if you do both of the following:
137
+
138
+ a) Accompany the combined library with a copy of the same work based
139
+ on the Library, uncombined with any other library facilities,
140
+ conveyed under the terms of this License.
141
+
142
+ b) Give prominent notice with the combined library that part of it
143
+ is a work based on the Library, and explaining where to find the
144
+ accompanying uncombined form of the same work.
145
+
146
+ 6. Revised Versions of the GNU Lesser General Public License.
147
+
148
+ The Free Software Foundation may publish revised and/or new versions
149
+ of the GNU Lesser General Public License from time to time. Such new
150
+ versions will be similar in spirit to the present version, but may
151
+ differ in detail to address new problems or concerns.
152
+
153
+ Each version is given a distinguishing version number. If the
154
+ Library as you received it specifies that a certain numbered version
155
+ of the GNU Lesser General Public License "or any later version"
156
+ applies to it, you have the option of following the terms and
157
+ conditions either of that published version or of any later version
158
+ published by the Free Software Foundation. If the Library as you
159
+ received it does not specify a version number of the GNU Lesser
160
+ General Public License, you may choose any version of the GNU Lesser
161
+ General Public License ever published by the Free Software Foundation.
162
+
163
+ If the Library as you received it specifies that a proxy can decide
164
+ whether future versions of the GNU Lesser General Public License shall
165
+ apply, that proxy's public statement of acceptance of any version is
166
+ permanent authorization for you to choose that version for the
167
+ Library.
@@ -0,0 +1,3 @@
1
+ PyNvVideoCodec
2
+ benchmarks
3
+ samples
@@ -0,0 +1,173 @@
1
+ # This copyright notice applies to this file only
2
+ #
3
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: MIT
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+
24
+ '''
25
+ This sample demonstrates basic video decoding using the native decoder in PyNvVideoCodec.
26
+
27
+ It shows how to:
28
+ 1. Create and use a demuxer to extract packets from a video file
29
+ 2. Set up a basic decoder for hardware-accelerated decoding
30
+ 3. Process packets and decode frames
31
+ 4. Write raw decoded frames to a file
32
+
33
+ Key Learning Outcomes:
34
+ 1. Basic demuxer usage for extracting video packets
35
+ 2. Setting up hardware decoder with default configuration
36
+ 3. Understanding the decode pipeline: Video File -> Demuxer -> Packets -> Decoder -> Raw Frames
37
+ 4. Working with both device and host memory for frame data
38
+ 5. Managing frame count and early termination
39
+
40
+
41
+ Usage: python decode.py -i <input_video_file> -o <output_file> -d <use_device_memory>
42
+ Example: python decode.py -i input.mp4 -o output.yuv -d 1
43
+
44
+ Arguments:
45
+ -i: Input video file
46
+ -o: Output raw video file (default: <input_name>.yuv)
47
+ -d: Use device memory (1) or host memory (0) (default: 1)
48
+ -g: GPU ID to use (default: 0)
49
+ -f: Number of frames to decode (optional, default: all frames)
50
+ '''
51
+
52
+ import sys
53
+ from pathlib import Path
54
+ import PyNvVideoCodec as nvc
55
+ from os.path import join, dirname, abspath, splitext
56
+ # Add the parent directory to Python path in a way that works from any working directory
57
+ current_dir = dirname(abspath(__file__))
58
+ parent_dir = dirname(current_dir)
59
+ if parent_dir not in sys.path:
60
+ sys.path.append(parent_dir)
61
+
62
+ # Import utilities for decoding
63
+ from utils.decode_parser import parse_decode_args
64
+ from utils.Utils import get_frame_data
65
+
66
+
67
+
68
+ def decode(gpu_id, enc_file_path, dec_file_path, use_device_memory, frame_count=None):
69
+ """
70
+ Function to decode media file and write raw frames into an output file.
71
+
72
+ This function demonstrates basic hardware-accelerated video decoding. Here's how it works:
73
+ 1. Creates a demuxer that reads the video file and extracts encoded frame packets
74
+ 2. Sets up a GPU decoder with default configuration
75
+ 3. The demuxer automatically extracts frame packets as you iterate over it
76
+ 4. Each packet is sent to the GPU decoder for hardware-accelerated decoding
77
+ 5. The decoder outputs raw YUV frames that can be processed or saved
78
+
79
+ Parameters:
80
+ gpu_id (int): Ordinal of GPU to use
81
+ enc_file_path (str): Path to file to be decoded
82
+ dec_file_path (str): Path to output file into which raw frames are stored
83
+ use_device_memory (int): If set to 1, output decoded frame is CUDeviceptr wrapped in CUDA Array Interface
84
+ frame_count (int, optional): Maximum number of frames to decode. If None, 0, or negative, decode all frames.
85
+
86
+ Example:
87
+ >>> decode(0, "path/to/input/media/file","path/to/output/yuv", 1)
88
+ Function to decode media file and write raw frames into an output file.
89
+ """
90
+ # Normalize frame count
91
+ decode_all = frame_count is None or frame_count <= 0
92
+ if decode_all:
93
+ print("Decoding all available frames")
94
+ frame_count = None
95
+
96
+ try:
97
+ nv_dmx = nvc.CreateDemuxer(filename=enc_file_path)
98
+
99
+ caps = nvc.GetDecoderCaps(
100
+ gpuid=gpu_id,
101
+ codec=nv_dmx.GetNvCodecId(),
102
+ chromaformat=nv_dmx.ChromaFormat(),
103
+ bitdepth=nv_dmx.BitDepth()
104
+ )
105
+ if "num_decoder_engines" in caps:
106
+ print("Number of NVDECs:", caps["num_decoder_engines"])
107
+
108
+ nv_dec = nvc.CreateDecoder(gpuid=gpu_id,
109
+ codec=nv_dmx.GetNvCodecId(),
110
+ usedevicememory=use_device_memory)
111
+
112
+ # printing out FPS and pixel format of the stream for convenience
113
+ print("FPS =", nv_dmx.FrameRate())
114
+ # open the file to be decoded in write mode
115
+ with open(dec_file_path, "wb") as decFile:
116
+ # demuxer can be iterated, fetch the packet from demuxer
117
+ frames_decoded = 0
118
+ for packet in nv_dmx:
119
+ # Decode returns a list of packets, range of this list is from [0, size of (decode picture buffer)]
120
+ # size of (decode picture buffer) depends on GPU, fur Turing series its 8
121
+ for decoded_frame in nv_dec.Decode(packet):
122
+ frame_data = get_frame_data(decoded_frame, use_device_memory)
123
+ decFile.write(bytearray(frame_data))
124
+
125
+ frames_decoded += 1
126
+ if frame_count is not None and frames_decoded >= frame_count:
127
+ print(f"Successfully decoded requested {frame_count} frames to {dec_file_path}")
128
+ return
129
+
130
+ # If we get here, we've decoded all available frames
131
+ if frame_count is not None and frames_decoded < frame_count:
132
+ print(f"Warning: Video ended before reaching requested frame count. Requested: {frame_count}, Decoded: {frames_decoded}")
133
+ print(f"Decoded frames written to {dec_file_path}")
134
+ else:
135
+ print(f"Successfully decoded all {frames_decoded} frames to {dec_file_path}")
136
+
137
+ except nvc.PyNvVCExceptionUnsupported as e:
138
+ print(f"Operation or configuration not supported: {e}")
139
+ raise
140
+ except cuda.Error as e:
141
+ print(f"CUDA error (context/stream/memory): {e}")
142
+ raise
143
+ except Exception as e:
144
+ print(f"An unexpected error occurred: {e}")
145
+ raise
146
+ finally:
147
+ # Cleanup resources in reverse order of creation
148
+ if nv_dec is not None:
149
+ del nv_dec
150
+ if nv_dmx is not None:
151
+ del nv_dmx
152
+
153
+ if __name__ == "__main__":
154
+ args = parse_decode_args(
155
+ "Basic video demuxing and decoding example. "
156
+ "Shows how to extract packets from a video file and decode them using the NVIDIA decoder."
157
+ )
158
+ print("=" * 60)
159
+ print("Configuration:")
160
+ print(f"Input: {args.encoded_file_path}")
161
+ print(f"Output: {args.raw_file_path}")
162
+ print(f"GPU ID: {args.gpu_id}")
163
+ print(f"Use Device Memory: {args.use_device_memory}")
164
+ print(f"Frame Count: {args.frame_count if args.frame_count else 'All frames'}")
165
+ print("=" * 60)
166
+
167
+ decode(
168
+ gpu_id=args.gpu_id,
169
+ enc_file_path=args.encoded_file_path,
170
+ dec_file_path=args.raw_file_path,
171
+ use_device_memory=args.use_device_memory,
172
+ frame_count=args.frame_count
173
+ )
@@ -0,0 +1,204 @@
1
+ # This copyright notice applies to this file only
2
+ #
3
+ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: MIT
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a
7
+ # copy of this software and associated documentation files (the "Software"),
8
+ # to deal in the Software without restriction, including without limitation
9
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ # and/or sell copies of the Software, and to permit persons to whom the
11
+ # Software is furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
+ # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ # DEALINGS IN THE SOFTWARE.
23
+
24
+
25
+ '''
26
+ This sample demonstrates buffer-based video decoding using memory chunks.
27
+
28
+ This approach is useful when video data comes from memory buffers
29
+ rather than direct file access (e.g., network streams, memory-mapped files). This saves file I/O overhead.
30
+
31
+ It shows how to:
32
+ 1. Create a custom data feeder for memory-based video input
33
+ 2. Set up a demuxer that reads from memory buffers
34
+ 3. Process video data without direct file I/O
35
+ 4. Handle streaming data in chunks
36
+
37
+ Key Learning Outcomes:
38
+ 1. Using callback-based demuxer for custom data sources
39
+ 2. Managing video data buffers and chunk sizes efficiently
40
+ 3. Implementing proper buffer position tracking and EOF handling
41
+ 4. Working with both device and host memory for decoded frames
42
+
43
+
44
+ Usage: python decode_from_memory_buffer.py -i <input_file> -o <output_file>
45
+ Example: python decode_from_memory_buffer.py -i input.mp4 -o output.yuv
46
+
47
+ Arguments:
48
+ -i: Input video file
49
+ -o: Output raw video file (default: <input_name>.yuv)
50
+ -d: Use device memory (1) or host memory (0) (default: 1)
51
+ -g: GPU ID to use (default: 0)
52
+ -f: Number of frames to decode (optional)
53
+
54
+ '''
55
+
56
+
57
+ from pathlib import Path
58
+ import pycuda.driver as cuda
59
+ import PyNvVideoCodec as nvc
60
+ import pycuda.autoinit as context
61
+ import sys
62
+ from os.path import join, dirname, abspath
63
+
64
+ # Add the parent directory to Python path in a way that works from any working directory
65
+ current_dir = dirname(abspath(__file__))
66
+ parent_dir = dirname(current_dir)
67
+ if parent_dir not in sys.path:
68
+ sys.path.append(parent_dir)
69
+
70
+ # Import utilities for decoding
71
+ from utils.decode_parser import parse_decode_args
72
+ from utils.Utils import get_frame_data
73
+
74
+
75
+
76
+ class VideoStreamFeeder:
77
+ """
78
+ Class to handle feeding video data in chunks to the demuxer.
79
+
80
+ This class reads a video file into memory and provides a method to feed
81
+ chunks of data to the demuxer buffer.
82
+ """
83
+ def __init__(self, file_path):
84
+ """
85
+ Initialize the VideoStreamFeeder with a video file.
86
+
87
+ Args:
88
+ file_path (str): Path to the video file to be read
89
+ """
90
+ with open(file_path, 'rb') as f:
91
+ self.video_buffer = bytearray(f.read())
92
+ self.current_pos = 0
93
+ self.bytes_remaining = len(self.video_buffer)
94
+ self.chunk_size = 0
95
+
96
+ def feed_chunk(self, demuxer_buffer):
97
+ """
98
+ Feed next chunk of video data to demuxer buffer.
99
+
100
+ Args:
101
+ demuxer_buffer: Pre-allocated buffer provided by demuxer
102
+
103
+ Returns:
104
+ int: Number of bytes copied to buffer, 0 if no more data
105
+ """
106
+ buffer_capacity = len(demuxer_buffer)
107
+
108
+ if self.bytes_remaining < buffer_capacity:
109
+ self.chunk_size = self.bytes_remaining
110
+ else:
111
+ self.chunk_size = buffer_capacity
112
+
113
+ if self.chunk_size == 0:
114
+ return 0
115
+
116
+ demuxer_buffer[:] = self.video_buffer[self.current_pos:self.current_pos + self.chunk_size]
117
+
118
+ self.current_pos += self.chunk_size
119
+ self.bytes_remaining -= self.chunk_size
120
+ return self.chunk_size
121
+
122
+
123
+ def decode_from_byte_array(input_file, yuv_file, use_device_memory, gpu_id, frame_count=None):
124
+ """
125
+ Implement buffer-based pipeline that reads the input file in chunks.
126
+
127
+ This function demonstrates how to decode video by processing data directly
128
+ from memory buffers instead of reading from disk.
129
+
130
+ Parameters:
131
+ input_file (str): Path to the input video file to be decoded
132
+ yuv_file (str): Path where the buffer-based pipeline output will be saved
133
+ use_device_memory (int): If set to 1, output decoded frame is CUDeviceptr wrapped in CUDA Array Interface
134
+ gpu_id (int): GPU device ID to use
135
+ frame_count (int, optional): Maximum number of frames to decode. If None, 0, or negative, decode all frames.
136
+
137
+ Returns:
138
+ None: Decoded frames are written to a raw file.
139
+ """
140
+ try:
141
+ print("Starting buffer-based decoding...")
142
+ data_feeder = VideoStreamFeeder(input_file)
143
+ buffer_demuxer = nvc.CreateDemuxer(data_feeder.feed_chunk)
144
+
145
+ buffer_decoder = nvc.CreateDecoder(
146
+ gpuid=gpu_id,
147
+ codec=buffer_demuxer.GetNvCodecId(),
148
+ cudacontext=0,
149
+ cudastream=0,
150
+ usedevicememory=use_device_memory
151
+ )
152
+
153
+ # Normalize frame count
154
+ decode_all = frame_count is None or frame_count <= 0
155
+ if decode_all:
156
+ print("Decoding all available frames")
157
+ frame_count = None
158
+
159
+ frames_decoded = 0
160
+
161
+ with open(yuv_file, 'wb') as decFile:
162
+ for packet in buffer_demuxer:
163
+ for decoded_frame in buffer_decoder.Decode(packet):
164
+
165
+ frame_data = get_frame_data(decoded_frame, use_device_memory)
166
+ decFile.write(bytearray(frame_data))
167
+
168
+ frames_decoded += 1
169
+ if frame_count is not None and frames_decoded >= frame_count:
170
+ print(f"Successfully decoded requested {frame_count} frames to {yuv_file}")
171
+ return
172
+
173
+ # If we get here, we've decoded all available frames
174
+ if frame_count is not None and frames_decoded < frame_count:
175
+ print(f"Warning: Video ended before reaching requested frame count. Requested: {frame_count}, Decoded: {frames_decoded}")
176
+ print(f"Decoded frames written to {yuv_file}")
177
+ else:
178
+ print(f"Successfully decoded all {frames_decoded} frames to {yuv_file}")
179
+ except Exception as e:
180
+ print(f"An unexpected error occurred: {e}")
181
+
182
+
183
+ if __name__ == "__main__":
184
+
185
+ args = parse_decode_args(
186
+ "Demonstrates video demuxing by processing video data directly from memory buffers."
187
+ )
188
+
189
+ print("=" * 60)
190
+ print("Configuration:")
191
+ print(f"Input: {args.encoded_file_path}")
192
+ print(f"Output: {args.raw_file_path}")
193
+ print(f"GPU ID: {args.gpu_id}")
194
+ print(f"Use Device Memory: {args.use_device_memory}")
195
+ print(f"Frame Count: {args.frame_count if args.frame_count else 'All frames'}")
196
+ print("=" * 60)
197
+
198
+ decode_from_byte_array(
199
+ input_file=args.encoded_file_path,
200
+ yuv_file=args.raw_file_path,
201
+ use_device_memory=args.use_device_memory,
202
+ gpu_id=args.gpu_id,
203
+ frame_count=args.frame_count
204
+ )