README.md 5.76 KB
Newer Older
Niccolò Pretto's avatar
Niccolò Pretto committed
1
2
# Packager

3
## Description
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
4
5
6
7
8
Implements the Technical Specification of [MPAI CAE-ARP](https://mpai.community/standards/mpai-cae/about-mpai-cae/#Figure2) *Packager* AIM, providing:
* Access Copy Files:
  1. Restored Audio Files;
  2. Editing List;
  3. Set of Irregularity Images in a .zip file;
9
  4. Irregularity File.
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
10
11
* Preservation Master Files:
  1. Preservation Audio File;
12
  2. Preservation Audio-Visual File where the audio has been replaced with the Audio of the Preservation Audio File
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
13
14
     fully synchronised with the video;
  3. Set of Irregularity Images in a .zip file;
15
  4. Irregularity File.
Niccolò Pretto's avatar
Niccolò Pretto committed
16
17

## Getting started
18
The *Packager* is written in Python 3.10 which is therefore required to run the program.
Niccolò Pretto's avatar
Niccolò Pretto committed
19

20
## Installation
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
21
[PyYaml](https://pyyaml.org) is required for reading the configuration file. You can install it with:
Niccolò Pretto's avatar
Niccolò Pretto committed
22
```
23
24
pip install pyyaml
```
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
25
[MoviePy](https://zulko.github.io/moviepy/) is required for replacing the audio of the Preservation Audio-Visual File. You can install it with:
26
27
```
pip install moviepy
Niccolò Pretto's avatar
Niccolò Pretto committed
28
29
```

30
31
32
33
34
You can also use `requirements.txt` file to install all needed dependencies at once:
```
pip install -r requirements.txt
```

Niccolò Pretto's avatar
Niccolò Pretto committed
35
## Usage
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
36
Once the libraries are installed, you should customise the configuration file `config.yaml`.
37
There are two required parameters:
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
38
39
1. `WORKING_PATH` that specifies the working path where all input files are stored and where all output files will be saved;
2. `PRESERVATION_FILES_NAME` that specifies the name of the preservation files to be considered.
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
40

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
41
42
43
44
To execute the script without issues, the inner structure of the `WORKING_PATH` directory shall be like:
```
.
├── AccessCopyFiles
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
45
│   └── ...
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
46
├── PreservationAudioFile
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
47
48
49
│   ├── File1.wav
│   ├── File2.wav
│   └── ...
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
50
├── PreservationAudioVisualFile
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
51
52
│   ├── File1.mp4
│   ├── File2.mp4
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
53
│   └── ...
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
54
├── PreservationMasterFiles
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
55
│   └── ...
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
56
└── temp
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    ├── File1
    │   ├── AudioAnalyser_IrregullarityFileOutput1.json
    │   ├── AudioAnalyser_IrregullarityFileOutput2.json
    │   ├── AudioBlocks
    │   │   ├── AudioBlock1.jpg
    │   │   ├── AudioBlock2.jpg
    │   │   └── ...
    │   ├── EditingList.json
    │   ├── IrregularityImages
    │   │   ├── IrregularityImage1.jpg
    │   │   ├── IrregularityImage2.jpg
    │   │   └── ...
    │   ├── RestoredAudioFiles
    │   │   ├── RestoredAudioFile1.wav
    │   │   ├── RestoredAudioFile2.wav
    │   │   └── ...
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput1.json
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput2.json
    │   ├── VideoAnalyser_IrregularityFileOutput1.json
    │   └── VideoAnalyser_IrregularityFileOutput2.json
    ├── File2
    │   ├── AudioAnalyser_IrregullarityFileOutput1.json
    │   ├── AudioAnalyser_IrregullarityFileOutput2.json
    │   ├── AudioBlocks
    │   │   ├── AudioBlock1.jpg
    │   │   ├── AudioBlock2.jpg
    │   │   └── ...
    │   ├── EditingList.json
    │   ├── IrregularityImages
    │   │   ├── IrregularityImage1.jpg
    │   │   ├── IrregularityImage2.jpg
    │   │   └── ...
    │   ├── RestoredAudioFiles
    │   │   ├── RestoredAudioFile1.wav
    │   │   ├── RestoredAudioFile2.wav
    │   │   └── ...
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput1.json
    │   ├── TapeIrregularityClassifier_IrregularityFileOutput2.json
    │   ├── VideoAnalyser_IrregularityFileOutput1.json
    │   └── VideoAnalyser_IrregularityFileOutput2.json
    └── ...
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
98
99
100
101
102
103
104
105
106
107
108
109
```
`PreservationAudioFile` and `PreservationAudioVisualFile` directories contain the input of ARP Workflow, while `AccessCopyFiles` and `PreservationMasterFiles` directories contain its output. `temp` directory is used to store all files exchanged between the AIMs within the Workflow.

Please note that:
* Corresponding input files shall present the same name;
* The name of Irregularity Files given above is ***mandatory***;
* The name of files within `AudioBlocks`, `IrregularityImages` and `RestoredAudioFiles` directories is not relevant to the *Packager*;
* The *Packager* will create directories named as the input files (e.g.: with input files `File1.wav` and `File1.mov`, output files will be contained in `AccessCopyFiles/File1/` and `PreservationMasterFiles/File1/`).

With this structure, `PRESERVATION_FILES_NAME` parameter could be equal to `File1` or `File2`.

You can now launch the *Packager* from the command line with:
110
```
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
111
python3 packager.py
112
```
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
113
Useful log information will be displayed during execution, requiring occasional interaction.
Niccolò Pretto's avatar
Niccolò Pretto committed
114

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
115
116
117
118
119
120
121
122
123
124
To enable integration in more complex workflows, it is also possible to launch the *Packager* with command line arguments:
```
python3 packager.py [-h] -w WORKING_PATH -f FILES_NAME
```
If you use the `-h` flag:
```
python3 packager.py -h
```
all instructions will be displayed.

Niccolò Pretto's avatar
Niccolò Pretto committed
125
## Support
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
126
127
128
If you require additional information or have any problem, you can contact us at:
* Nadir Dalla Pozza (nadir.dallapozza@unipd.it);
* Niccolò Pretto (niccolo.pretto@unipd.it).
Niccolò Pretto's avatar
Niccolò Pretto committed
129
130

## Authors and acknowledgment
131
This project was developed by:
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
132
133
134
* Nadir Dalla Pozza (University of Padova);
* Niccolò Pretto (University of Padova);
* Sergio Canazza (University of Padova).
135

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
136
137
138
This project takes advantage of the following libraries:
* [MoviePy](https://zulko.github.io/moviepy/);
* [PyYaml](https://pyyaml.org).
139

Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
140
Developed with Python IDE [PyCharm Community](https://www.jetbrains.com/pycharm/).
Niccolò Pretto's avatar
Niccolò Pretto committed
141
142

## License
Nadir Dalla Pozza's avatar
Nadir Dalla Pozza committed
143
This project is licensed with [GNU GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.html).