gopro-merger 0.1.0__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,279 @@
1
+ Metadata-Version: 2.4
2
+ Name: gopro-merger
3
+ Version: 0.1.0
4
+ Summary: A Python tool that automatically groups, combines, and compresses GoPro video chapters using FFmpeg.
5
+ Author: Nida Anis
6
+ Project-URL: Homepage, https://github.com/N21A/gopro-merger
7
+ Project-URL: Issues, https://github.com/N21A/gopro-merger/issues
8
+ Keywords: gopro,ffmpeg,video,hevc,video-compression
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+
12
+ # gopro-merger
13
+
14
+ A Python tool that automatically groups, combines, and compresses GoPro video chapters using FFmpeg.
15
+
16
+ ## Features
17
+
18
+ - Detects newer GoPro chapter names such as `GX010021.MP4`, `GX020021.MP4`, etc.
19
+ - Supports older `GOPR1234.MP4` / `GP011234.MP4` naming.
20
+ - Merges each recording into one continuous MP4.
21
+ - Compresses video to HEVC/H.265.
22
+ - Uses NVIDIA NVENC when available, with automatic CPU fallback via `libx265`.
23
+ - Copies audio and GoPro telemetry/data streams where supported.
24
+ - Removes `.LRV` and `.THM` sidecar files after successful processing.
25
+ - Keeps the original MP4 files by default.
26
+ - Can optionally delete original MP4 files after successful processing and explicit confirmation.
27
+ - Opens a graphical folder picker when run without a folder argument and Tkinter is available.
28
+ - Works on Windows, macOS, and Linux.
29
+
30
+ ## Dependencies
31
+
32
+ ### Required
33
+
34
+ - Python 3.9 or newer.
35
+ - FFmpeg installed and available in your system `PATH`.
36
+
37
+ The script only uses modules from the Python standard library, so no `pip` packages are required.
38
+
39
+ ### Optional
40
+
41
+ - Tkinter, for the graphical folder picker.
42
+ - Tkinter is normally included with Python on Windows and macOS.
43
+ - Some Linux distributions package it separately.
44
+ - If Tkinter is unavailable, provide the source folder as a command-line argument instead.
45
+ - An NVIDIA GPU, compatible driver, and an FFmpeg build containing `hevc_nvenc` for hardware-accelerated encoding.
46
+ - If NVENC is unavailable or fails in automatic mode, the script falls back to CPU encoding with `libx265`.
47
+
48
+ ## Installation
49
+
50
+ ### Windows
51
+
52
+ #### 1. Install Python
53
+
54
+ Install Python 3.9 or newer from the Microsoft Store or the official Python installer.
55
+
56
+ Confirm that Python is available:
57
+
58
+ ```powershell
59
+ python --version
60
+ ```
61
+
62
+ On some systems, use:
63
+
64
+ ```powershell
65
+ py --version
66
+ ```
67
+
68
+ #### 2. Install FFmpeg
69
+
70
+ Using `winget`:
71
+
72
+ ```powershell
73
+ winget install Gyan.FFmpeg
74
+ ```
75
+
76
+ Alternatively, using Chocolatey:
77
+
78
+ ```powershell
79
+ choco install ffmpeg
80
+ ```
81
+
82
+ Confirm that FFmpeg is available:
83
+
84
+ ```powershell
85
+ ffmpeg -version
86
+ ```
87
+
88
+ ### macOS
89
+
90
+ Install Python and FFmpeg using Homebrew:
91
+
92
+ ```bash
93
+ brew install python ffmpeg
94
+ ```
95
+
96
+ Confirm both are available:
97
+
98
+ ```bash
99
+ python3 --version
100
+ ffmpeg -version
101
+ ```
102
+
103
+ ### Linux
104
+
105
+ Package names vary by distribution.
106
+
107
+ #### Ubuntu or Debian
108
+
109
+ ```bash
110
+ sudo apt update
111
+ sudo apt install python3 ffmpeg
112
+ ```
113
+
114
+ Install Tkinter as well if you want the graphical folder picker:
115
+
116
+ ```bash
117
+ sudo apt install python3-tk
118
+ ```
119
+
120
+ #### Fedora
121
+
122
+ ```bash
123
+ sudo dnf install python3 ffmpeg
124
+ ```
125
+
126
+ Install Tkinter as well if required:
127
+
128
+ ```bash
129
+ sudo dnf install python3-tkinter
130
+ ```
131
+
132
+ #### Arch Linux
133
+
134
+ ```bash
135
+ sudo pacman -S python ffmpeg tk
136
+ ```
137
+
138
+ Confirm Python and FFmpeg are available:
139
+
140
+ ```bash
141
+ python3 --version
142
+ ffmpeg -version
143
+ ```
144
+
145
+ ## Usage
146
+
147
+ ### Windows
148
+
149
+ Open the graphical folder picker:
150
+
151
+ ```powershell
152
+ python gopro_merger.py
153
+ ```
154
+
155
+ Process a specific folder:
156
+
157
+ ```powershell
158
+ python gopro_merger.py "D:\GoPro\D2S1"
159
+ ```
160
+
161
+ If `python` is not recognised, use the Python launcher:
162
+
163
+ ```powershell
164
+ py gopro_merger.py "D:\GoPro\D2S1"
165
+ ```
166
+
167
+ ### macOS and Linux
168
+
169
+ Open the graphical folder picker, if Tkinter is available:
170
+
171
+ ```bash
172
+ python3 gopro_merger.py
173
+ ```
174
+
175
+ Process a specific folder:
176
+
177
+ ```bash
178
+ python3 gopro_merger.py "/path/to/GoPro/D2S1"
179
+ ```
180
+
181
+ For example:
182
+
183
+ ```bash
184
+ python3 gopro_merger.py "$HOME/Videos/GoPro/D2S1"
185
+ ```
186
+
187
+ Outputs are written to a `processed` directory inside the selected source directory.
188
+
189
+ ## Options
190
+
191
+ The examples below use `python`. On macOS and Linux, use `python3` instead where required.
192
+
193
+ ### Choose the compression quality
194
+
195
+ ```bash
196
+ python gopro_merger.py "/path/to/GoPro/D2S1" --quality 26
197
+ ```
198
+
199
+ Lower values give better quality and larger files. The default is `26`.
200
+
201
+ ### Force NVIDIA encoding
202
+
203
+ ```bash
204
+ python gopro_merger.py "/path/to/GoPro/D2S1" --encoder nvenc
205
+ ```
206
+
207
+ This requires:
208
+
209
+ - an NVIDIA GPU that supports HEVC encoding;
210
+ - a compatible NVIDIA driver;
211
+ - an FFmpeg build containing the `hevc_nvenc` encoder.
212
+
213
+ Check whether your FFmpeg build provides it on Windows:
214
+
215
+ ```powershell
216
+ ffmpeg -hide_banner -encoders | findstr hevc_nvenc
217
+ ```
218
+
219
+ On macOS and Linux:
220
+
221
+ ```bash
222
+ ffmpeg -hide_banner -encoders | grep hevc_nvenc
223
+ ```
224
+
225
+ ### Force CPU encoding
226
+
227
+ ```bash
228
+ python gopro_merger.py "/path/to/GoPro/D2S1" --encoder cpu
229
+ ```
230
+
231
+ ### Keep `.LRV` and `.THM` sidecar files
232
+
233
+ ```bash
234
+ python gopro_merger.py "/path/to/GoPro/D2S1" --keep-sidecars
235
+ ```
236
+
237
+ ### Combine every MP4 in the folder into one output
238
+
239
+ ```bash
240
+ python gopro_merger.py "/path/to/GoPro/D2S1" --combine-all
241
+ ```
242
+
243
+ Use this only when the files belong together and use compatible stream formats.
244
+
245
+ ### Overwrite an existing output
246
+
247
+ ```bash
248
+ python gopro_merger.py "/path/to/GoPro/D2S1" --overwrite
249
+ ```
250
+
251
+ ### Delete original MP4 files after successful processing
252
+
253
+ ```bash
254
+ python gopro_merger.py "/path/to/GoPro/D2S1" --delete-originals
255
+ ```
256
+
257
+ The script lists every original file eligible for deletion, shows their combined size, and requires you to type `DELETE` before anything is removed.
258
+
259
+ ## Safety
260
+
261
+ Original MP4 files are kept unless `--delete-originals` is supplied.
262
+
263
+ When `--delete-originals` is used:
264
+
265
+ - deletion only happens after FFmpeg completes successfully and creates a non-empty output;
266
+ - only source files encoded successfully during the current run are eligible;
267
+ - files belonging to failed recordings are kept;
268
+ - files belonging to outputs skipped because they already existed are kept;
269
+ - you must type `DELETE` exactly when prompted;
270
+ - deleted files are permanently removed rather than moved to the Recycle Bin or Trash.
271
+
272
+ Check each merged output before confirming deletion of important source footage.
273
+
274
+ ## Notes
275
+
276
+ - HEVC/H.265 offers smaller files than many H.264 workflows, but encoding is lossy.
277
+ - CPU encoding with `libx265` is normally slower than NVIDIA NVENC.
278
+ - Playback support for HEVC varies by operating system, application, and installed codecs.
279
+ - GoPro telemetry preservation depends on the streams present in the source files and support in the installed FFmpeg build.
@@ -0,0 +1,268 @@
1
+ # gopro-merger
2
+
3
+ A Python tool that automatically groups, combines, and compresses GoPro video chapters using FFmpeg.
4
+
5
+ ## Features
6
+
7
+ - Detects newer GoPro chapter names such as `GX010021.MP4`, `GX020021.MP4`, etc.
8
+ - Supports older `GOPR1234.MP4` / `GP011234.MP4` naming.
9
+ - Merges each recording into one continuous MP4.
10
+ - Compresses video to HEVC/H.265.
11
+ - Uses NVIDIA NVENC when available, with automatic CPU fallback via `libx265`.
12
+ - Copies audio and GoPro telemetry/data streams where supported.
13
+ - Removes `.LRV` and `.THM` sidecar files after successful processing.
14
+ - Keeps the original MP4 files by default.
15
+ - Can optionally delete original MP4 files after successful processing and explicit confirmation.
16
+ - Opens a graphical folder picker when run without a folder argument and Tkinter is available.
17
+ - Works on Windows, macOS, and Linux.
18
+
19
+ ## Dependencies
20
+
21
+ ### Required
22
+
23
+ - Python 3.9 or newer.
24
+ - FFmpeg installed and available in your system `PATH`.
25
+
26
+ The script only uses modules from the Python standard library, so no `pip` packages are required.
27
+
28
+ ### Optional
29
+
30
+ - Tkinter, for the graphical folder picker.
31
+ - Tkinter is normally included with Python on Windows and macOS.
32
+ - Some Linux distributions package it separately.
33
+ - If Tkinter is unavailable, provide the source folder as a command-line argument instead.
34
+ - An NVIDIA GPU, compatible driver, and an FFmpeg build containing `hevc_nvenc` for hardware-accelerated encoding.
35
+ - If NVENC is unavailable or fails in automatic mode, the script falls back to CPU encoding with `libx265`.
36
+
37
+ ## Installation
38
+
39
+ ### Windows
40
+
41
+ #### 1. Install Python
42
+
43
+ Install Python 3.9 or newer from the Microsoft Store or the official Python installer.
44
+
45
+ Confirm that Python is available:
46
+
47
+ ```powershell
48
+ python --version
49
+ ```
50
+
51
+ On some systems, use:
52
+
53
+ ```powershell
54
+ py --version
55
+ ```
56
+
57
+ #### 2. Install FFmpeg
58
+
59
+ Using `winget`:
60
+
61
+ ```powershell
62
+ winget install Gyan.FFmpeg
63
+ ```
64
+
65
+ Alternatively, using Chocolatey:
66
+
67
+ ```powershell
68
+ choco install ffmpeg
69
+ ```
70
+
71
+ Confirm that FFmpeg is available:
72
+
73
+ ```powershell
74
+ ffmpeg -version
75
+ ```
76
+
77
+ ### macOS
78
+
79
+ Install Python and FFmpeg using Homebrew:
80
+
81
+ ```bash
82
+ brew install python ffmpeg
83
+ ```
84
+
85
+ Confirm both are available:
86
+
87
+ ```bash
88
+ python3 --version
89
+ ffmpeg -version
90
+ ```
91
+
92
+ ### Linux
93
+
94
+ Package names vary by distribution.
95
+
96
+ #### Ubuntu or Debian
97
+
98
+ ```bash
99
+ sudo apt update
100
+ sudo apt install python3 ffmpeg
101
+ ```
102
+
103
+ Install Tkinter as well if you want the graphical folder picker:
104
+
105
+ ```bash
106
+ sudo apt install python3-tk
107
+ ```
108
+
109
+ #### Fedora
110
+
111
+ ```bash
112
+ sudo dnf install python3 ffmpeg
113
+ ```
114
+
115
+ Install Tkinter as well if required:
116
+
117
+ ```bash
118
+ sudo dnf install python3-tkinter
119
+ ```
120
+
121
+ #### Arch Linux
122
+
123
+ ```bash
124
+ sudo pacman -S python ffmpeg tk
125
+ ```
126
+
127
+ Confirm Python and FFmpeg are available:
128
+
129
+ ```bash
130
+ python3 --version
131
+ ffmpeg -version
132
+ ```
133
+
134
+ ## Usage
135
+
136
+ ### Windows
137
+
138
+ Open the graphical folder picker:
139
+
140
+ ```powershell
141
+ python gopro_merger.py
142
+ ```
143
+
144
+ Process a specific folder:
145
+
146
+ ```powershell
147
+ python gopro_merger.py "D:\GoPro\D2S1"
148
+ ```
149
+
150
+ If `python` is not recognised, use the Python launcher:
151
+
152
+ ```powershell
153
+ py gopro_merger.py "D:\GoPro\D2S1"
154
+ ```
155
+
156
+ ### macOS and Linux
157
+
158
+ Open the graphical folder picker, if Tkinter is available:
159
+
160
+ ```bash
161
+ python3 gopro_merger.py
162
+ ```
163
+
164
+ Process a specific folder:
165
+
166
+ ```bash
167
+ python3 gopro_merger.py "/path/to/GoPro/D2S1"
168
+ ```
169
+
170
+ For example:
171
+
172
+ ```bash
173
+ python3 gopro_merger.py "$HOME/Videos/GoPro/D2S1"
174
+ ```
175
+
176
+ Outputs are written to a `processed` directory inside the selected source directory.
177
+
178
+ ## Options
179
+
180
+ The examples below use `python`. On macOS and Linux, use `python3` instead where required.
181
+
182
+ ### Choose the compression quality
183
+
184
+ ```bash
185
+ python gopro_merger.py "/path/to/GoPro/D2S1" --quality 26
186
+ ```
187
+
188
+ Lower values give better quality and larger files. The default is `26`.
189
+
190
+ ### Force NVIDIA encoding
191
+
192
+ ```bash
193
+ python gopro_merger.py "/path/to/GoPro/D2S1" --encoder nvenc
194
+ ```
195
+
196
+ This requires:
197
+
198
+ - an NVIDIA GPU that supports HEVC encoding;
199
+ - a compatible NVIDIA driver;
200
+ - an FFmpeg build containing the `hevc_nvenc` encoder.
201
+
202
+ Check whether your FFmpeg build provides it on Windows:
203
+
204
+ ```powershell
205
+ ffmpeg -hide_banner -encoders | findstr hevc_nvenc
206
+ ```
207
+
208
+ On macOS and Linux:
209
+
210
+ ```bash
211
+ ffmpeg -hide_banner -encoders | grep hevc_nvenc
212
+ ```
213
+
214
+ ### Force CPU encoding
215
+
216
+ ```bash
217
+ python gopro_merger.py "/path/to/GoPro/D2S1" --encoder cpu
218
+ ```
219
+
220
+ ### Keep `.LRV` and `.THM` sidecar files
221
+
222
+ ```bash
223
+ python gopro_merger.py "/path/to/GoPro/D2S1" --keep-sidecars
224
+ ```
225
+
226
+ ### Combine every MP4 in the folder into one output
227
+
228
+ ```bash
229
+ python gopro_merger.py "/path/to/GoPro/D2S1" --combine-all
230
+ ```
231
+
232
+ Use this only when the files belong together and use compatible stream formats.
233
+
234
+ ### Overwrite an existing output
235
+
236
+ ```bash
237
+ python gopro_merger.py "/path/to/GoPro/D2S1" --overwrite
238
+ ```
239
+
240
+ ### Delete original MP4 files after successful processing
241
+
242
+ ```bash
243
+ python gopro_merger.py "/path/to/GoPro/D2S1" --delete-originals
244
+ ```
245
+
246
+ The script lists every original file eligible for deletion, shows their combined size, and requires you to type `DELETE` before anything is removed.
247
+
248
+ ## Safety
249
+
250
+ Original MP4 files are kept unless `--delete-originals` is supplied.
251
+
252
+ When `--delete-originals` is used:
253
+
254
+ - deletion only happens after FFmpeg completes successfully and creates a non-empty output;
255
+ - only source files encoded successfully during the current run are eligible;
256
+ - files belonging to failed recordings are kept;
257
+ - files belonging to outputs skipped because they already existed are kept;
258
+ - you must type `DELETE` exactly when prompted;
259
+ - deleted files are permanently removed rather than moved to the Recycle Bin or Trash.
260
+
261
+ Check each merged output before confirming deletion of important source footage.
262
+
263
+ ## Notes
264
+
265
+ - HEVC/H.265 offers smaller files than many H.264 workflows, but encoding is lossy.
266
+ - CPU encoding with `libx265` is normally slower than NVIDIA NVENC.
267
+ - Playback support for HEVC varies by operating system, application, and installed codecs.
268
+ - GoPro telemetry preservation depends on the streams present in the source files and support in the installed FFmpeg build.