Skip to content

Commit

Permalink
Update service-copies.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bturkus committed Nov 8, 2024
1 parent ca5b7a5 commit 6890559
Showing 1 changed file with 64 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,64 @@ Our approach to generating MP4 service copies from ISO disc images of DVDs has e
1. TOC
{:toc}

## Current Approach
# Current Approach

We utilize our [ISO Transcoder MakeMKV Script](https://github.com/NYPL/ami-preservation/blob/main/ami_scripts/iso_transcoder_makemkv.py), which leverages MakeMKV to create intermediate MKV files for each video title set found within the ISO disc image of a DVD. This step provides a high-fidelity representation of each video title set, preserving essential structural information from the DVD.

Our script’s default behavior is to produce one MP4 per video title set, but DVDs vary widely in how they are authored. To address these variations, our script includes a `-f --force` flag, which concatenates the separate MKVs into a single MP4 file before transcoding. This option is intended only for cases where the title sets on an ISO appear to have been unintentionally fragmented.
The script’s default behavior is to produce one MP4 per video title set. However, DVDs vary widely in how they are authored. To address these variations, the script includes a `-f --force` flag, which concatenates the separate MKVs into a single MP4 file before transcoding. This option is intended only for cases where the title sets on an ISO appear to have been unintentionally fragmented.

## MediaInfo Extraction and Classification

In addition to transcoding, the ISO Transcoder MakeMKV Script now includes a **MediaInfo extraction and classification step**, which analyzes the resulting MP4s and classifies them based on the [Typical DVD MP4 Specifications](https://nypl.github.io/ami-preservation/pages/preservationLab/opticalMedia/dvdProcessing/service-copies.html#typical-dvd-mp4-specifications).

The classification output provides a summary of how the MP4s conform to the expected categories and flags any files that do not match these specifications (outliers). Below is an example of the classification output:

```
Classification Summary:
- PAL DVD Half-D1 Resolution Widescreen: 1 MP4(s)
- PAL DVD Half-D1 Resolution: 4 MP4(s)
- NTSC DVD SD (D1 Resolution): 3 MP4(s)
- PAL DVD Widescreen: 4 MP4(s)
- NTSC DVD SD (4SIF Resolution): 1 MP4(s)
- PAL DVD SD (D1 Resolution): 1 MP4(s)
Outliers:
- /path/to/outlier1.mp4
- /path/to/outlier2.mp4
- /path/to/outlier3.mp4
```

Outliers should be carefully reviewed. These files may indicate discrepancies in the demuxing process or other structural issues with the original ISO. To investigate, mount the ISO and open the `VIDEO_TS` directory to check the technical specifications of the corresponding VOB files. If the specs of the VOBs do not match the outlier MP4s, consider reprocessing the ISO using the alternate approach detailed below.

---

## Alternative Approach for Challenging Cases

While the MakeMKV-based script is our preferred method due to its superior error handling, encryption handling, and retention of subtitles and chapters, there are cases where MakeMKV cannot process an ISO. For these scenarios, we use an alternative script: [ISO Transcoder Cat/MKVMerge](https://github.com/NYPL/ami-preservation/blob/main/ami_scripts/iso_transcoder_cat_mkvmerge.py).
While the MakeMKV-based script is our preferred method due to its superior error handling, encryption handling, and retention of subtitles and chapters, there are scenarios where it may not be suitable:
1. **ISOs that fail processing with MakeMKV**: If MakeMKV cannot process an ISO, the alternate approach should be used.
2. **Outliers identified in the classification step**: In rare cases, MakeMKV’s demuxing may introduce discrepancies, resulting in MP4s that do not match the specifications of the original VOBs. For such cases, the alternate script provides a reliable fallback.

For these scenarios, we use the [ISO Transcoder Cat/MKVMerge Script](https://github.com/NYPL/ami-preservation/blob/main/ami_scripts/iso_transcoder_cat_mkvmerge.py). This script offers two processing options:
1. **`cat` Approach**: Concatenates the VOBs directly and quickly from the ISO before transcoding to MP4 with FFmpeg.
2. **`mkvmerge` Approach**: If `cat` fails, automatically uses MKVMerge to combine the VOBs into a single MKV file, which is then transcoded to MP4 with FFmpeg.

These methods are particularly useful for ISOs where MakeMKV encounters issues, such as structural anomalies, unsupported formats, or discrepancies in the resulting MP4s.

---

### Workflow Note for Outliers

This script provides two options for processing:
1. **`cat` Approach**: Concatenates the VOBs directly and quickly from the ISO, before transcoding to MP4 with FFmpeg.
2. **`mkvmerge` Approach**: If cat fails, automatically uses MKVMerge to combine the VOBs into a single MKV file, which is then transcoded to MP4 with FFmpeg.
When outliers are identified during the classification step:
1. **Mount the ISO and inspect the `VIDEO_TS` directory**:
- Use MediaInfo or similar tools to extract the technical metadata of the VOB files.
- Compare the specs of the VOBs to the flagged MP4 outliers.

2. **Reprocess with the alternate approach**:
- If the specs of the VOBs differ from the outlier MP4s, reprocess the ISO using the Cat/MKVMerge Script.
- This alternative method often resolves issues by bypassing MakeMKV and working directly with the VOBs.

By incorporating this additional layer of verification and reprocessing, we ensure that service copies accurately reflect the original content and conform to expected specifications.

These methods are particularly useful for ISOs where MakeMKV encounters issues, such as structural anomalies or unsupported formats.

## DVD Structure

Expand Down Expand Up @@ -106,6 +149,20 @@ Our experience has led us to identify broad categories of typical DVD specificat
- **Pixel Aspect Ratio**: 1.092
- **Frame Rate**: 25.000

### PAL DVD (Half D1 Resolution)
- **Video Width**: 352
- **Video Height**: 576
- **Display Aspect Ratio**: 1.333
- **Pixel Aspect Ratio**: 2.182
- **Frame Rate**: 25.000

### PAL DVD (Half D1 Resolution Widescreen)
- **Video Width**: 352
- **Video Height**: 576
- **Display Aspect Ratio**: 1.778
- **Pixel Aspect Ratio**: 2.909
- **Frame Rate**: 25.000

---

This foundational approach gives us the flexibility to adapt to the variety of DVD authoring styles, while standardizing our output to maintain playback quality and accessibility. As we continue to refine this workflow, we will adjust these categories and processes as necessary.

0 comments on commit 6890559

Please sign in to comment.