video_reader-rs 0.4.1__tar.gz

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.
@@ -0,0 +1,10 @@
1
+ # Set update schedule for GitHub Actions
2
+
3
+ version: 2
4
+ updates:
5
+
6
+ - package-ecosystem: "github-actions"
7
+ directory: "/"
8
+ schedule:
9
+ # Check for updates to GitHub Actions every week
10
+ interval: "weekly"
@@ -0,0 +1,241 @@
1
+ name: Build
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags:
7
+ - '*'
8
+ pull_request:
9
+ branches: [main]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ linux:
16
+ runs-on: ${{ matrix.platform.runner }}
17
+ strategy:
18
+ matrix:
19
+ platform:
20
+ - runner: ubuntu-22.04
21
+ target: x86_64
22
+ # - runner: ubuntu-latest
23
+ # target: x86
24
+ - runner: ubuntu-22.04
25
+ target: aarch64
26
+ # - runner: ubuntu-latest
27
+ # target: armv7
28
+ # - runner: ubuntu-latest
29
+ # target: s390x
30
+ # - runner: ubuntu-latest
31
+ # target: ppc64le
32
+ env:
33
+ FFMPEG_DIR: ${{ github.workspace }}/ffmpeg
34
+ steps:
35
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
36
+ with:
37
+ persist-credentials: false
38
+ - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
39
+ with:
40
+ python-version: '3.11'
41
+
42
+ - name: Set download url
43
+ id: download_url
44
+ run: |
45
+ DOWNLOAD_URL=$(
46
+ if [[ "${{ matrix.platform.target }}" == "x86_64" ]]; then
47
+ echo "https://www.dropbox.com/scl/fi/x76nti8wr8qqoyyxvifa8/ffmpeg-4.4-linux-clang-default.tar.xz?rlkey=${{ secrets.DROPBOX_TOKEN }}&dl=1";
48
+ elif [[ "${{ matrix.platform.target }}" == "aarch64" ]]; then
49
+ echo "https://www.dropbox.com/scl/fi/au67c14cgtu10873wtgyq/ffmpeg-n4.4.6-linuxarm64-gpl-shared-4.4.tar.xz?rlkey=${{ secrets.DROPBOX_TOKEN_AARCH64 }}&dl=1"
50
+ fi
51
+ )
52
+ echo "ffmpeg_url=$DOWNLOAD_URL" >> $GITHUB_OUTPUT
53
+
54
+ - name: Build wheels
55
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
56
+ with:
57
+ target: ${{ matrix.platform.target }}
58
+ before-script-linux: |
59
+ bash .github/workflows/pre_build_${{ matrix.platform.target }}.sh &&
60
+ curl -L "${{ steps.download_url.outputs.ffmpeg_url }}" -o ffmpeg.tar.xz && mkdir -p ${{ env.FFMPEG_DIR }} &&
61
+ tar -xf ffmpeg.tar.xz -C ${{ env.FFMPEG_DIR }} --strip-components=1 &&
62
+ export FFMPEG_DIR=${{ env.FFMPEG_DIR }}
63
+ args: --release --features ffmpeg_5 --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t 3.14 3.14t pypy3.11'
64
+ manylinux: 2_28
65
+ - name: Upload wheels
66
+ uses: actions/upload-artifact@v6.0.0
67
+ with:
68
+ name: wheels-linux-${{ matrix.platform.target }}
69
+ path: dist
70
+
71
+ # musllinux:
72
+ # runs-on: ${{ matrix.platform.runner }}
73
+ # env:
74
+ # FFMPEG_DOWNLOAD_URL: "https://www.dropbox.com/scl/fi/x76nti8wr8qqoyyxvifa8/ffmpeg-4.4-linux-clang-default.tar.xz?rlkey=${{ secrets.DROPBOX_TOKEN }}&dl=1"
75
+ # FFMPEG_DIR: ${{ github.workspace }}/ffmpeg
76
+ # strategy:
77
+ # matrix:
78
+ # platform:
79
+ # - runner: ubuntu-latest
80
+ # target: x86_64
81
+ # - runner: ubuntu-latest
82
+ # target: x86
83
+ # - runner: ubuntu-latest
84
+ # target: aarch64
85
+ # - runner: ubuntu-latest
86
+ # target: armv7
87
+ # steps:
88
+ # - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
89
+ # - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
90
+ # with:
91
+ # python-version: '3.11'
92
+ # - name: Build wheels
93
+ # uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
94
+ # with:
95
+ # target: ${{ matrix.platform.target }}
96
+ # before-script-linux: |
97
+ # yum install -y clang libXv-devel xz alsa-lib-devel &&
98
+ # python3 -m ensurepip && pip install "maturin>=1.3,<2.0" patchelf &&
99
+ # curl -L ${{ env.FFMPEG_DOWNLOAD_URL }} -o ffmpeg.tar.xz && mkdir -p ${{ env.FFMPEG_DIR }} &&
100
+ # tar -xf ffmpeg.tar.xz -C ${{ env.FFMPEG_DIR }} --strip-components=1 &&
101
+ # export FFMPEG_DIR=${{ env.FFMPEG_DIR }}
102
+ # args: --release --out dist --find-interpreter
103
+ # manylinux: 2_28
104
+ # - name: Upload wheels
105
+ # uses: actions/upload-artifact@v6.0.0
106
+ # with:
107
+ # name: wheels-musllinux-${{ matrix.platform.target }}
108
+ # path: dist
109
+
110
+ windows:
111
+ runs-on: ${{ matrix.platform.runner }}
112
+ strategy:
113
+ matrix:
114
+ platform:
115
+ - runner: windows-latest
116
+ target: x64
117
+ # - runner: windows-latest
118
+ # target: x86
119
+
120
+ env:
121
+ FFMPEG_DOWNLOAD_URL: "https://github.com/GyanD/codexffmpeg/releases/download/VER/ffmpeg-VER-full_build-shared.7z"
122
+ FFMPEG_INSTALL_PATH: "C:/ffmpeg"
123
+ FFMPEG_VERSION: "7.0"
124
+
125
+ steps:
126
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
127
+ with:
128
+ persist-credentials: false
129
+ - name: Set libclang path
130
+ run: |
131
+ $VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
132
+ Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin"
133
+
134
+ - name: Install FFmpeg ${{ env.FFMPEG_VERSION }}
135
+ run: |
136
+ $tempFile = New-TemporaryFile
137
+ $uri = ($env:FFMPEG_DOWNLOAD_URL).Replace('VER', $env:FFMPEG_VERSION)
138
+ Invoke-WebRequest "$uri" -OutFile "$tempFile" -TimeoutSec 10
139
+ 7z x -y -o"$env:FFMPEG_INSTALL_PATH" "$tempFile"
140
+ $ffmpegDir = (Get-ChildItem -Directory "$env:FFMPEG_INSTALL_PATH").FullName
141
+ Add-Content $env:GITHUB_ENV "FFMPEG_DIR=$ffmpegDir"
142
+ Add-Content $env:GITHUB_PATH "$ffmpegDir/bin"
143
+
144
+ - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
145
+ with:
146
+ python-version: '3.11'
147
+ architecture: ${{ matrix.platform.target }}
148
+
149
+ - name: Install build dependencies
150
+ run: pip install delvewheel
151
+
152
+ - name: Build wheel
153
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
154
+ with:
155
+ target: ${{ matrix.platform.target }}
156
+ args: --release --out dist --find-interpreter
157
+
158
+ - name: Repair wheel with delvewheel
159
+ shell: bash
160
+ run: |
161
+ delvewheel repair dist/*.whl
162
+
163
+ - name: Upload wheels
164
+ uses: actions/upload-artifact@v6.0.0
165
+ with:
166
+ name: wheels-windows-${{ matrix.platform.target }}
167
+ path: wheelhouse/
168
+
169
+ macos:
170
+ runs-on: ${{ matrix.platform.runner }}
171
+ strategy:
172
+ matrix:
173
+ platform:
174
+ - runner: macos-15-intel
175
+ target: x86_64
176
+ - runner: macos-14
177
+ target: aarch64
178
+ steps:
179
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
180
+ with:
181
+ persist-credentials: false
182
+ - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
183
+ with:
184
+ python-version: '3.11'
185
+ - name: Install dependencies
186
+ run: |
187
+ brew install ffmpeg &&
188
+ pip install delocate
189
+ - name: Build wheels
190
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
191
+ with:
192
+ target: ${{ matrix.platform.target }}
193
+ args: --release --out dist --find-interpreter
194
+
195
+ - name: Repair wheel with delocate
196
+ shell: bash
197
+ run: |
198
+ delocate-wheel dist/*.whl
199
+
200
+ - name: Upload wheels
201
+ uses: actions/upload-artifact@v6.0.0
202
+ with:
203
+ name: wheels-macos-${{ matrix.platform.target }}
204
+ path: dist
205
+
206
+ sdist:
207
+ runs-on: ubuntu-22.04
208
+ steps:
209
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
210
+ with:
211
+ persist-credentials: false
212
+ - name: Build sdist
213
+ uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
214
+ with:
215
+ command: sdist
216
+ args: --out dist
217
+ - name: Upload sdist
218
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
219
+ with:
220
+ name: wheels-sdist
221
+ path: dist
222
+
223
+ release:
224
+ name: Release
225
+ runs-on: ubuntu-latest
226
+ if: "startsWith(github.ref, 'refs/tags/')"
227
+ needs: [linux, windows, macos, sdist]
228
+ permissions:
229
+ id-token: write
230
+ steps:
231
+ - name: Download artifacts
232
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
233
+ with:
234
+ path: dist
235
+ merge-multiple: true
236
+ - name: Install uv
237
+ uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
238
+ - name: Publish to PyPI
239
+ env:
240
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
241
+ run: uv publish
@@ -0,0 +1,64 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lints:
11
+ name: Lints
12
+ runs-on: ubuntu-latest
13
+ container: jrottenberg/ffmpeg:5.1-ubuntu
14
+ permissions:
15
+ contents: read
16
+
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20
+ with:
21
+ persist-credentials: false
22
+
23
+ - name: Install dependencies
24
+ run: |
25
+ DEBIAN_FRONTEND=noninteractive apt-get update
26
+ DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ca-certificates clang curl pkg-config
27
+
28
+ - name: Setup Rust
29
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
30
+ with:
31
+ toolchain: stable
32
+ components: rustfmt, clippy
33
+
34
+ - name: Rustfmt
35
+ run: cargo fmt --all -- --check
36
+
37
+ - name: Clippy
38
+ run: cargo clippy --all --features ffmpeg_5 -- -D warnings
39
+ tests:
40
+ name: Tests
41
+ runs-on: ubuntu-latest
42
+ container: jrottenberg/ffmpeg:5.1-ubuntu
43
+ permissions:
44
+ contents: read
45
+
46
+ steps:
47
+ - name: Checkout
48
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
49
+ with:
50
+ persist-credentials: false
51
+
52
+ - name: Install dependencies
53
+ run: |
54
+ DEBIAN_FRONTEND=noninteractive apt-get update
55
+ DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ca-certificates clang curl pkg-config
56
+
57
+ - name: Setup Rust
58
+ uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
59
+ with:
60
+ toolchain: stable
61
+ components: rustc, cargo
62
+
63
+ - name: tests
64
+ run: cargo test --features ffmpeg_5
@@ -0,0 +1,28 @@
1
+ #!/bin/bash
2
+
3
+ dpkg --add-architecture arm64
4
+
5
+ # add arm64 source
6
+ cat <<'EOF'>> /etc/apt/sources.list.d/arm64.list
7
+ deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted
8
+ deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
9
+ deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
10
+ EOF
11
+
12
+ # specifcy amd64 source in the main source.list
13
+ sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list
14
+ sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
15
+
16
+ # update and install deps
17
+ apt update
18
+ apt install -y binutils-aarch64-linux-gnu clang gcc-aarch64-linux-gnu \
19
+ gcc-aarch64-linux-gnu libasound2-dev libcrypt-dev libnsl-dev libxv-dev \
20
+ multistrap pkg-config python3-pip rpcsvc-proto xz-utils
21
+
22
+ pip install "maturin>=1.3,<2.0" patchelf
23
+
24
+ # # download ffmpeg archive and extract it
25
+ # curl -L "$FFMPEG_DOWNLOAD_URL" -o ffmpeg.tar.xz
26
+ # mkdir -p $FFMPEG_DIR
27
+ # tar -xf ffmpeg.tar.xz -C $FFMPEG_DIR --strip-components=1
28
+ # export FFMPEG_DIR=$FFMPEG_DIR
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ yum install -y clang libXv-devel xz alsa-lib-devel
3
+ python3 -m ensurepip && pip install "maturin>=1.3,<2.0" patchelf
@@ -0,0 +1,81 @@
1
+ /target
2
+ target/
3
+ debug/
4
+ # backup files generated by rustfmt
5
+ **/*.rs.bk
6
+
7
+ # Byte-compiled / optimized / DLL files
8
+ __pycache__/
9
+ .pytest_cache/
10
+ *.py[cod]
11
+
12
+ # C extensions
13
+ *.so
14
+
15
+ # Distribution / packaging
16
+ .Python
17
+ .venv/
18
+ env/
19
+ bin/
20
+ build/
21
+ develop-eggs/
22
+ dist/
23
+ eggs/
24
+ lib/
25
+ lib64/
26
+ parts/
27
+ sdist/
28
+ var/
29
+ include/
30
+ man/
31
+ venv/
32
+ *.egg-info/
33
+ .installed.cfg
34
+ *.egg
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+ pip-selfcheck.json
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .coverage
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+
49
+ # Translations
50
+ *.mo
51
+
52
+ # Mr Developer
53
+ .mr.developer.cfg
54
+ .project
55
+ .pydevproject
56
+
57
+ # Rope
58
+ .ropeproject
59
+
60
+ # Django stuff:
61
+ *.log
62
+ *.pot
63
+
64
+ .DS_Store
65
+
66
+ # Sphinx documentation
67
+ docs/_build/
68
+
69
+ # PyCharm
70
+ .idea/
71
+
72
+ # VSCode
73
+ .vscode/
74
+
75
+ # Pyenv
76
+ .python-version
77
+
78
+ .mypy_cache/
79
+ tags
80
+
81
+ test_videos/