Almost complete remake of the script. Changed to questionary and fixed the dovi_tool bug.
All bins have been removed. README has been spellchecked. \ Fix formatting of FFmpeg dependency link Fixed README
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
.vscode
|
||||||
|
/temp
|
||||||
|
/bin/*.*
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|||||||
+694
-524
File diff suppressed because it is too large
Load Diff
@@ -1,76 +1,83 @@
|
|||||||
# DV-HDR-merge
|
# DV-HDR-merge
|
||||||
A script to batch combine HDR media with Dolby Vison media for a hybrid file that uses Dolby Vision but with fallback to HDR.
|
|
||||||
The script has a bulit in frame compare tool that makes syncing the different files very easy.
|
A script to batch combine HDR media with Dolby Vision media for a hybrid file that uses Dolby Vision but with fallback to HDR.
|
||||||
|
The script has a built in frame compare tool that makes syncing the different files very easy.
|
||||||
The script matches the files by comparing frame count because Dolby Vision RPU-files are based on frames, not on time.
|
The script matches the files by comparing frame count because Dolby Vision RPU-files are based on frames, not on time.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
**[FFmpeg](https://github.com/FFmpeg/FFmpeg)** needs to be installed to path<br>
|
|
||||||
**[requirements.txt](https://github.com/Swedish-Wiking/DV_HDR_Merge/blob/main/requirements.txt)** needs to be installed with pip
|
The following dependencies must either be installed to PATH or added to a folder called `bin` in the main directory:
|
||||||
### Accompanying dependencies:
|
|
||||||
**[quietvoid/dovi_tool](https://github.com/quietvoid/dovi_tool)** Thanks for making this possible!<br>
|
**[FFmpeg](https://github.com/FFmpeg/FFmpeg)**\
|
||||||
**[mkvmerge](https://mkvtoolnix.download/doc/mkvmerge.html)**<br>
|
**[quietvoid/dovi_tool](https://github.com/quietvoid/dovi_tool)**\
|
||||||
**[mkvextract](https://mkvtoolnix.download/doc/mkvextract.html)**<br>
|
**[mkvmerge](https://mkvtoolnix.download/doc/mkvmerge.html)**\
|
||||||
|
**[mkvextract](https://mkvtoolnix.download/doc/mkvextract.html)**
|
||||||
|
|
||||||
|
Python requirements that needs to be installed:
|
||||||
|
**[requirements.txt](https://github.com/Swedish-Wiking/DV_HDR_Merge/blob/main/requirements.txt)**
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```properties
|
```properties
|
||||||
DV_HDR_Merge.py [Input files/folders]
|
DV_HDR_Merge.py [Input files/folders]
|
||||||
```
|
```
|
||||||
|
|
||||||
Optional commands: `--help`, `-logL`, `-maxdif`
|
Optional commands: `--help`, `-logL`, `-maxdif`
|
||||||
|
|
||||||
```console
|
```bash
|
||||||
DV_HDR_Merge.py -logL debug -maxdif 100 HDR_movie.mkv DV_movie.mp4 HDR_movie2.mkv DV_movie2.mkv ./DV_movie_folder ./HDR_movie_folder
|
DV_HDR_Merge.py -logL debug -maxdif 100 HDR_movie.mkv DV_movie.mp4 HDR_movie2.mkv DV_movie2.mkv ./DV_movie_folder ./HDR_movie_folder
|
||||||
```
|
```
|
||||||
**Valid input formats**: <br>
|
|
||||||
HDR media: `*.mkv`<br>
|
|
||||||
Dolby Vision media: `*.mkv`, `*.mp4`<br>
|
|
||||||
|
|
||||||
*Can be customized to use `*.mp4` as HDR input as well but Matroska is the superior container.*<br>
|
**Valid input formats**:\
|
||||||
|
HDR media: `*.mkv`\
|
||||||
|
Dolby Vision media: `*.mkv`, `*.mp4`\
|
||||||
|
|
||||||
|
*Can be customized to use `*.mp4` as HDR input as well but Matroska is the superior container.*
|
||||||
|
|
||||||
**Output format**: `*.mkv`
|
**Output format**: `*.mkv`
|
||||||
|
|
||||||
### Explanations
|
### Explanations
|
||||||
|
|
||||||
**Shift frames**:<br>
|
**Shift frames**:\
|
||||||
A negative amount means that frames will be removed in the beginning and a positive means that the first frame will be duplicated to add enough frame.
|
A negative amount means that frames will be removed in the beginning and a positive means that the first frame will be duplicated to add enough frame.
|
||||||
Any excess frame on the end will be cut off
|
Any excess frame on the end will be cut off
|
||||||
|
|
||||||
**General**:<br>
|
**General**:\
|
||||||
If frame dimensions do not match the script will automagically correct for it.
|
If frame dimensions do not match the script will automagically correct for it.
|
||||||
|
|
||||||
### Example of code running
|
### Example of code running
|
||||||

|
|
||||||
|

|
||||||
|
|
||||||
## Frame Compare Tool
|
## Frame Compare Tool
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
1. Opens the active image in your default photo application for easier inspection
|
1. Opens the active image in your default photo application for easier inspection
|
||||||
2. Switches between a 50/50 blend of the two compared images or a greyscale difference
|
2. Switches between a 50/50 blend of the two compared images or a grey-scale difference
|
||||||
3. Set the frame to refrence in the HDR media file, press `Enter` to apply. (Total amount of frames in media is shown in label)
|
3. Set the frame to reference in the HDR media file, press `Enter` to apply. (Total amount of frames in media is shown in label)
|
||||||
4. Set how may frames to shift Dolby Vision layer with, press `Enter` to apply.
|
4. Set how may frames to shift Dolby Vision layer with, press `Enter` to apply.
|
||||||
5. Closes window and sends inputed frame-shift to be used when combining the two media.<br>
|
5. Closes window and sends inputted frame-shift to be used when combining the two media.\
|
||||||
(Closing the window will do the same as the `Done` button)
|
(Closing the window will do the same as the `Done` button)
|
||||||
|
|
||||||
Always compare multiple refrence frames in case of missing or extra frames in some of the materials used.
|
Always compare multiple reference frames in case of missing or extra frames in some of the materials used.
|
||||||
|
|
||||||
### Example images
|
### Example images
|
||||||
|
|
||||||
Both senarios are using frame 30000 as the HDR refrence frame.
|
Both scenarios are using frame 30000 as the HDR reference frame.
|
||||||
|
|
||||||
#### Unsynced images
|
#### Unsynced images
|
||||||
<p float="left">
|
|
||||||
<img src="/EXAMPLES/UNSYNCED.PNG" width="49%" height="auto">
|
Blended 50/50 | Difference
|
||||||
<img src="/EXAMPLES/UNSYNCED_DIF.PNG" width="49%" height="auto">
|
:----------------------------------------:|:----------------------------------------------:
|
||||||
</p>
|
 | 
|
||||||
<i>No frame shift have been added and the result is blurry edges and sometimes even different scenes. The difference images shows a lot of anomalies when pixels don't cancel each other out.</i>
|
|
||||||
|
No frame shift have been added and the result is blurry edges and sometimes even different scenes. The difference images shows a lot of anomalies when pixels don't cancel each other out.
|
||||||
|
|
||||||
#### Synced images
|
#### Synced images
|
||||||
<p float="left">
|
|
||||||
<img src="/EXAMPLES/SYNCED.PNG" width="49%" height="auto">
|
|
||||||
<img src="/EXAMPLES/SYNCED_DIF.PNG" width="49%" height="auto">
|
|
||||||
</p>
|
|
||||||
<i>When Dolby Vison layer is shifted with -3 frames no blurry edges can be seen on the blend iamge and on the difference image no anomalies can be found. (Sometimes you can get a faded silhouette as in this case because the luminance levels could not be correctly matched when trying to tonemap the thumbnails taken from the media)</i>
|
|
||||||
|
|
||||||
## Known bugs...
|
Blended 50/50 | Difference
|
||||||
|
:--------------------------------------:|:----------------------------------------------:
|
||||||
|
 | 
|
||||||
|
|
||||||
- When extracting, modifying and injecting the RPU file no live progress is shown because of a problem catching output from *dovi_tool*
|
When Dolby Vision layer is shifted with -3 frames in this cae, no blurry edges can be seen on the blend image and on the difference image no anomalies can be found. (Sometimes you can get a faded silhouette as in this case because the luminance levels could not be correctly matched when trying to tonemap the thumbnails taken from the media)
|
||||||
|
|||||||
Binary file not shown.
+5
-4
@@ -1,4 +1,5 @@
|
|||||||
alive_progress==3.1.4
|
Pillow==11.3.0
|
||||||
inquirer==3.1.3
|
pymediainfo==7.0.1
|
||||||
Pillow==10.1.0
|
questionary==2.1.1
|
||||||
pymediainfo==6.1.0
|
rich==14.1.0
|
||||||
|
pywinpty==3.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user