This guide is a work in progress.
To equip users with the knowledge and experience to become an advanced remuxer with the necessary skills to pass the BLURANiUM User Release Program.
A BLURANiUM approved remux aims to (i) provide the best possible home viewing and listening experience and (ii) serve as the ultimate source for an encode.
All software used must be up to date.
AviSynth+ — Frameserver which runs AviSynth+ scripts.
https://github.com/AviSynth/AviSynthPlus/releases)
AVSPmod — Text editor which also allows previewing AviSynth+ scripts.
https://www.videohelp.com/software/AvsP)
ffms2 — Frame-accurate video reader for AviSynth+.
Choose the preceeding three OR the following four.
VapourSynth — Frameserver which runs VapourSynth scripts.
https://www.vapoursynth.com/doc/installation.html
VSEdit — Text editor which also allows previewing VapourSynth scripts.
https://bitbucket.org/mystery_keeper/vapoursynth-editor/downloads/
btpfunc — Collection of useful VapourSynth functions.
https://github.com/Kevlar604/btpfunc
L-SMASH — Frame-accurate video reader for VapourSynth.
https://github.com/HolyWu/L-SMASH-Works/releases/
2 Decrypt
Skip to step 3 (Demux) if you don’t need to rip a physical disc.
Otherwise, first follow the Full Disc Ripping Guide.
Subject to the exceptions below, you should use Eac3to to demux the disc. To date, it is still the best demuxer in terms of error detection and correction capabilities which is essential if a disc has mastering or manufacturing errors.
Exception: Since eac3to is unable to process PTS timing correctly on HEVC video, you must use DGDemux or MakeMKV for UHDBDs that employ seamless branching.
Prepare eac3to:
how to add directory to system path
).BDs consist of playlists (.MPLS files) which consist of media (.M2TS files). Scanning the BD with BDInfo shows the available playlists.
To demux a BD, specify the playlist you wish to demux, and if applicable, the individual tracks. The -demux
flag will extract all the tracks in the specified playlist. Extracting specific tracks from the playlist can also be done as shown below. See here for more commands.
Method 1 (using eac3to):
cd /d <projectFolderPath>
cd /d "D:\workshop\"
eac3to <BDMVFolderPath>
eac3to "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR"
eac3to <BDMVFolderPath> <playlistNumber>) -demux -log="eac3to.txt"
eac3to "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR" 1) -demux -log=eac3to.txt
eac3to <BDMVFolderPath> <playlistNumber>) <trackNumber>:outputFilename.* -log="eac3to.txt"
eac3to "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR" 1) 1:chapters.txt 2:video.* 3:audio.* 4:subtitles.* -log="eac3to.txt"
Method 2 (using DGDemux):
cd /d <projectFolderPath>
cd /d "D:\workshop\"
dgdemux -d <BDMVFolderPath>
dgdemux -d "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR"
dgdemux -i <MPLSFilePath> -o <OutputFilePath>
dgdemux -i "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR\BDMV\PLAYLIST\00001.mpls" -o "00001"
-o
flag.dgdemux -i <MPLSFilePath> -o <OutputFilePath> -demux <PID>,<PID>,<PID>,...
dgdemux -i "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR\BDMV\PLAYLIST\00001.mpls" -o "tenet" -demux 1011,1100,Chapters
PID
aka playlist ID is the hex value of the playlist shown using dgdemux -i <MPLSFilePath>
.Chapters
is a valid PID.Method 3 (useful when eac3to/DGDemux does not find all the playlists):
bdinfo <BDMVFolderPath> -i
bdinfo "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR" -i
cd /d <projectFolderPath>
cd /d "D:\workshop\"
eac3to <MPLSFilePath> 1) -demux -log="eac3to.txt"
eac3to "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR\BDMV\PLAYLIST\00001.mpls" 1) -demux -log="eac3to.txt"
dgdemux -i <MPLSFilePath> -o <OutputFilePath>
dgdemux -i "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR\BDMV\PLAYLIST\00001.mpls" -o "00001"
-o
flag.Process Name is vlc.exe
and including Path contains mpls
.play
for example, vlc reads the playlist .MPLS file, which Process Manager filters.eac3to <playlistPath> -demux -log="eac3to.txt"
-demux
flag, use either .thd+ac3
or .*
to ensure BD-compliance.-keepDialnorm
in the eac3to command line when demuxing lossy tracks (excluding DTS-HD HRA).
Subtitle track 7 contains 959 normal and 170 forced captions.
eac3to <M2TSFilePath> -demux -log="eac3to.txt"
eac3to "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR\BDMV\STREAM\00001.m2ts" -demux -log="eac3to.txt"
MakeMKV should be used to demux DVDs, and it will often reveal hidden text-based subtitles.
Audio and subtitles can be extracted from DVD remuxes using MKVExtract:
cd /d <projectFolderPath>
cd /d "D:\workshop\"
mkvmerge <MKVFilePath> --identify
mkvmerge "D:\title_01.mkv" --identify
mkvextract <MKVFilePath> tracks <TrackID>:<OutputFileName>
mkvextract "D:\title_01.mkv" tracks 2:subs
subs.idx
and subs.sub
.WARNING: the eac3to log will include your Windows username depending on the directory in which it is located.
me
).me
.C:\Workshop\
.Notes regarding MakeMKV:
Use BDInfo to gather detailed information of all tracks:
Scan Bitrates
.Alternatively, use the CLI:
bdinfo <BDMVFolderPath> -i
bdinfo "D:\discs\Tenet 2020 1080p Blu-ray AVC DTS-HD MA 5.1-ESiR" -i
Some discs may require DVDFab’s version of BDInfo.
It is important to identify the best source when studios of different regions have released the same film, resulting in different languages, bitrates, codecs and perceptual qualities.
Repeat step 2 (Decrypt) through step 5 (Compare) for all sources you can obtain.
Perceptual quality is of highest importance. The codec and bitrate can influence this. To compare two sources:
Cut and combine sources (not recommended unless you know what you are doing) (click to expand)
If one video source is not consistently better throughout the film, it is possible to losslessly cut and combine the best zones of each source for an ultimate hybrid track:
MKVToolNix → Multiplexer → Output → Splitting
.Audio track quality attributes ranked from highest priority to lowest:
If multiple mixes with different channel counts exist:
Commentary tracks:
If a track is available in different languages:
More audio exceptions (click to expand)
If a production was originally mastered in stereo, do not assume that the secondary 2.0 option on a source represents this mix, since it could just be a downmix of the remastered upmix. To verify this is not the case
sox "inputAudio.ac3" -n remix 1 spectrogram -x 10000 -y 1025 -z 120 -o "outputSpectrogram-full.png"
sox "inputAudio.ac3" -n remix 1 spectrogram -x 10000 -y 1025 -z 120 -S 5:00 -d 0:02 -o "outputSpectrogram-zoom.png"
Remember: first listen to the tracks, and only then attempt to back up your claim with evidence reflecting what you heard. To build a strong “case”, your submission should include the following:
Audition → Window Menu → Enable Amplitude Screenshots → Scan → Take Screenshot
Audition → Window Menu → Enable Frequency Analysis → Scan → Take Screenshot
Audition → View Menu → Enable Waveform Editor → Take Screenshot
eac3to audioInput.dtsma audioOutput.wavs
Audition → Window Menu → Enable Editor → Shift+D (To Enable Spectral Frequency Display) → Take Screenshot
Not recommended unless you know what you’re doing (click to expand)
If one audio audio source is not consistently better throughout the film, it is possible to losslessly cut and combine the best zones of each source for an ultimate hybrid track:
MKVToolNix → Multiplexer → Output → Splitting
to split the file based on timestamps.right-click → Append files
to append other tracks.Subtitles must be collected as follows:
To determine the language of unfamiliar subtitles:
Using the sites below is encouraged in order to gain general, historical, and technical insight into the title your are preparing:
# These 2 lines aren't required if you copy the plugins to your plugins folder (C:\Program Files (x86)\AviSynth+\plugins+\)
import("C:/PATH/TO/ffms2-2.23.1-msvc/FFMS2.avsi")
LoadPlugin("C:/PATH/TO/ffms2-2.23.1-msvc/x64/ffms2.dll")
a=ffvideosource("C:/PATH/TO/sourceA.mkv")
a=a.Subtitle("A", y=54)
a=a.FFInfo(framenum=true,frametype=true,cfrtime=true,vfrtime=false,version=false,cropping=false,colorrange=false,colorspace=false,sar=false)
b=ffvideosource("C:/PATH/TO/sourceB.mkv")
b=b.Subtitle("B", y=54)
b=b.FFInfo(framenum=true,frametype=true,cfrtime=true,vfrtime=false,version=false,cropping=false,colorrange=false,colorspace=false,sar=false)
interleave(a, b)
# These 2 lines aren't required if you copy the plugins to your plugins folder (C:\Program Files (x86)\AviSynth+\plugins+)
import("C:/PATH/TO/ffms2-2.23.1-msvc/FFMS2.avsi")
LoadPlugin("C:/PATH/TO/ffms2-2.23.1-msvc/x64/ffms2.dll")
FFVideoSource("C:/PATH/TO/source.mkv")
FFInfo(framenum=true,frametype=true,cfrtime=true,vfrtime=false,version=false,cropping=false,colorrange=false,colorspace=false,sar=false)
# This following line isn't required if you copy btpfunc.py to your plugins folder:
# - `C:\Program Files\Python39\Lib\site-packages` (Windows),
# - `/usr/local/lib/python3.9/dist-packages` (Ubuntu),
# - `/usr/lib/python3.9/site-packages` (Fedora & Arch)
# Note: the Python folder is different depending on the version you have installed
LoadPlugin(path='C:/PATH/TO/btpfunc.py')
import vapoursynth as vs
import btpfunc as btp
core = vs.get_core()
path1=r'C:/PATH/TO/sourceA.mkv'
clip1=core.ffms2.Source(path1) # You can also use src=core.lsmas.LWLibavSource(path1)
clip1=btp.FFInfo(clip1, text='A', frame_num=True, frame_type=True, frame_time=True,color='0000FFFF') # Prints frame type (I/P/B) and absolute time.
path2=r'C:/PATH/TO/sourceB.mkv'
clip2=core.ffms2.Source(path2) # You can also use src=core.lsmas.LWLibavSource(path2)
clip2=btp.FFInfo(clip2, text='B', frame_num=True, frame_type=True, frame_time=True,color='0000FFFF') # Prints frame type (I/P/B) and absolute time.
comp=core.std.Interleave([clip1,clip2])
comp.set_output()
# This following line isn't required if you copy btpfunc.py to your plugins folder:
# - `C:\Program Files\Python39\Lib\site-packages` (Windows),
# - `/usr/local/lib/python3.9/dist-packages` (Ubuntu),
# - `/usr/lib/python3.9/site-packages` (Fedora & Arch)
# Note: the Python folder is different depending on the version you have installed
LoadPlugin(path='C:/PATH/TO/btpfunc.py')
import vapoursynth as vs
import btpfunc as btp
core = vs.get_core()
path=r'C:/PATH/TO/source.mkv'
clip=core.ffms2.Source(path) # You can also use src=core.lsmas.LWLibavSource(path)
clip=btp.FFInfo(clip, text='source', frame_num=True, frame_type=True, frame_time=True,color='0000FFFF') # Prints frame type (I/P/B) and absolute time.
clip.set_output()
Certain formats require lossless encoding for better compatibility and compression.
All 24-bit audio (regardless of channels) must be demuxed as .PCM/.WAVS/.FLAC using eac3to to check if it is padded with zeroes or not.
E.g. eac3to 1) 3:audio.wavs
If it is padded, eac3to will say so and do a 2nd pass to remove it.
Example eac3to log with zero padding (click to expand)
eac3to v3.34
command line: eac3to.exe padded/BDMV/ 1) 3:eng.flac
------------------------------------------------------------------------------
M2TS, 1 video track, 2 audio tracks, 2 subtitle tracks, 1:41:06, 24p /1.001
1: Chapters, 12 chapters
2: h264/AVC, 1080p24 /1.001 (16:9)
3: DTS Master Audio, English, 5.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 1509kbps, 48kHz)
4: DTS Master Audio, English, 2.0 channels, 24 bits, 48kHz
(core: DTS, 2.0 channels, 1509kbps, 48kHz)
5: Subtitle (PGS), English
6: Subtitle (PGS), Spanish
[a03] Extracting audio track number 3...
[a03] Decoding with libDcaDec DTS Decoder...
[a03] Encoding FLAC with libFlac...
[a03] Creating file "eng.flac"...
[a03] The original audio track has a constant bit depth of 16 bits.
[a03] Superfluous zero bytes detected, will be stripped in 2nd pass.
[a03] Starting 2nd pass...
[a03] Decoding FLAC...
[a03] Reducing depth from 24 to 16 bits...
[a03] Encoding FLAC with libFlac...
[a03] Creating file "eng.flac"...
[a03] The processed audio track has a constant bit depth of 16 bits.
Video track 2 contains 145439 frames.
eac3to processing took 5 minutes, 51 seconds.
Done.
Example eac3to log without zero padding (click to expand)
eac3to v3.34
command line: eac3to.exe Not/padded/BDMV 1) 4:eng.flac
------------------------------------------------------------------------------
M2TS, 1 video track, 2 audio tracks, 1 subtitle track, 1:41:23, 24p
1: Chapters, 12 chapters
2: h264/AVC, 1080p24 (16:9)
3: DTS Master Audio, Italian, 5.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 1509kbps, 48kHz)
4: DTS Master Audio, English, 5.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 1509kbps, 48kHz)
5: Subtitle (PGS), Italian
[v02] The video framerate is correct, but rather unusual. <warning>
[a04] Extracting audio track number 4...
[a04] Decoding with libDcaDec DTS Decoder...
[a04] Encoding FLAC with libFlac...
[a04] Creating file "eng.flac"...
[a04] The original audio track has a constant bit depth of 24 bits.
Video track 2 contains 145991 frames.
eac3to processing took 4 minutes, 40 seconds.
Done.
Example eac3to log with partial zero padding (click to expand)
eac3to v3.34
command line: eac3to.exe partially/padded/BDMV 2) 4:eng.wavs
------------------------------------------------------------------------------
M2TS, 1 video track, 2 audio tracks, 1 subtitle track, 1:24:33, 50i
1: Chapters, 8 chapters
2: h264/AVC, 1080i50 (16:9)
3: RAW/PCM, English, 2.0 channels, 24 bits, 48kHz
4: DTS Master Audio, English, 5.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 768kbps, 48kHz)
5: Subtitle (PGS), English
[a04] Extracting audio track number 4...
[a04] Decoding with libDcaDec DTS Decoder...
[a04] Writing WAVs...
[a04] Creating file "eng.L.wav"...
[a04] Creating file "eng.R.wav"...
[a04] Creating file "eng.C.wav"...
[a04] Creating file "eng.SL.wav"...
[a04] Creating file "eng.SR.wav"...
[a04] Creating file "eng.LFE.wav"...
[a04] Original audio track: max 24 bits, average 16 bits, most common 16 bits.
Video track 2 contains 126824 frames.
eac3to processing took 3 minutes, 10 seconds.
Done.
If eac3to does not know the correct endianness, you can specify the format with the -little
/-big
flag.
If the best audio track has 2 channels or less and is encoded with a lossless codec (e.g. DTS-HD MA 2.0 or LPCM):
eac3to audio.wavs audio.flac
If the best audio track has more than 2 channels and is encoded with a lossless uncompressed codec (e.g. LPCM):
Note: do not convert lossless commentaries to lossy.
Note: do not transcode lossy audio tracks.
If a 2.0 track is dual mono (i.e. both channels are identical), do the following:
Check the disc cover for e.g. DTS 2.0 Mono
.
Generate a spectrogram mixing channel 1 and 2 with channel 2 inverted:
sox dualmono.flac -n remix 1,2v-1 spectrogram -x 10000 -y 1025 -z 120 -o mono.png -c "Dual.Mono"
If it is 2.0 mono, then only one channel should be included in the remux:
C:\eac3to.exe "F:\Das.fliegende.Klassenzimmer.1954.GERMAN.COMPLETE.BLURAY-iFPD" 1) 3:audio_mono.flac -mono -log=eac3to.txt
Sometimes, a dual mono track will include short stereo sequences mixed by the distributor: In such cases, your new track should be based on the average of both channels:
sox dual.mono.flac mono.flac remix 1v0.5,2v0.5
Include the spectrogram and command in your description.
If the format is .VTT or another simple text-based format:
Use SubtitleEdit to convert low resolution VobSub image subtitles to text (only do this with languages in which you are literate). If the best available English subtitles/translation is from a DVD (VOBSub), you should OCR them to provide a more attractive option.
File → Import → Import Vobsub subtitle for OCR...
File → Import → Subtitle from VOB/IFO (DVD)
and select the title’s main .IFO.Start Ripping
to rip all the subtitles.Save As
.OK
to proceed to OCR.Tesseract 3.02
on Windows, or Tesseract 4
on Linux.
Tesseract 5.0
is newer and may produce more OCR errors. The best engine will depend on subtitle type and font....
next to Language
to download the language pack....
next to Dictionary
to download the spell-checking dictionary.Image Palette
tab with custom colours and transparency.
Start OCR
. You will be prompted to verify errors or words not recognized.-
’s in dialogue lines,.
) replacing commas (,
),|
) replacing letter I
’s,Replace
tool, but correct as much as possible first.OK
to complete the OCR which will return you to the main window.Tools → Fix common errors
. Select any extra issues you feel might be present beyond the defaults.Next >
, order the errors by function, and check if the errors are correctly identified.Apply selected fixes
.UTF-8 without BOM
is selected.Save
and save as SubRip (.SRT) format.[Door creaks]
, you can remove such elements to have a set of non-SDH subtitles:
Tools → Remove text for hearing-impaired...
.SDR Subtitles must be tonemapped for HDR video or else they will be too bright:
subtitle_tonemap "C:\path\to\subtitles.sup" --output tonemapped
HDR subtitles must be tonemapped for SDR video or else they will be too dark. Simply changing the brightness does not work as the blacks will no longer be black.
Powershell:
mkdir mapped
$files = @(Get-ChildItem *.png)
foreach ($f in $files) {
$file=$f.name
magick.exe $file -fuzz 15% -fill 'rgb(204,204,204)' -opaque 'rgb(152,152,152)' -fuzz 15% -fill 'rgb(195,195,195)' -opaque 'rgb(109,109,109)' mapped/$file
}
Bash:
mkdir mapped
for file in *.png; do
magick $file -fuzz 15% -fill 'rgb(204,204,204)' -opaque 'rgb(152,152,152)' -fuzz 15% -fill 'rgb(195,195,195)' -opaque 'rgb(109,109,109)' mapped/$file
done
Collect chapters using the eac3to command from step 3 (Demux).
Use the disc menu in VLC to manually navigate to each chapter and verify that the timestamps correspond to the eac3to-extracted chapters.txt file. They are often a few frames off.
If the chapters are not from the same source as your video track, confirm that they are synced to the correct scene changes.
Add a chapter for the End Credits
, Mid-Credits Scene
, and/or Post-Credits Scene
if applicable and if they do not already exist.
Chapters from web sources should be verified to have sensible names and intervals.
Amazon example of ridiculous “chapter sentences” (click to expand)
00:00:00.000 : en:Studio logos
00:00:23.000 : en:Swagger & Fenn & Opening Credits
00:02:59.000 : en:Swagger and Fenn Engage the Enemy
00:06:01.000 : en:Air Support Arrives
00:08:15.000 : en:Thirty-Six Months Later
00:10:24.000 : en:Swagger Gets Visitors
00:12:37.000 : en:Colonel Johnson Asks Swagger to Plan Assassination
00:16:05.000 : en:Swagger Recreates the Shot
00:18:55.000 : en:Swagger Scouts Possible Assassination Locations
00:20:58.000 : en:Swagger Reports to the Colonel
00:23:14.000 : en:Swagger and the Team Prepare
00:27:21.000 : en:The Shooter Takes the Shot
00:31:10.000 : en:Swagger Gives Himself First-Aid and Evades Authorities
00:34:38.000 : en:The FBI Searches for Swagger
00:37:06.000 : en:The Media Blames Nick Memphis for Swagger's Escape
00:39:02.000 : en:Swagger Buys Supplies
00:41:08.000 : en:Memphis Mans the Phones and Swagger Recovers
00:44:25.000 : en:Swagger Asks Donny's Wife for Help, Kentucky
00:48:54.000 : en:Memphis Explains the Discrepencies
00:51:27.000 : en:Sarah Sews Up Swagger
00:53:43.000 : en:Memphis Continues His Investigation
00:55:49.000 : en:Swagger Wakes & Memphis Researches
00:57:52.000 : en:Sarah Checks Her Work
00:59:39.000 : en:Sarah Gives Swagger a Rifle
01:02:27.000 : en:Sarah Meets With Memphis
01:05:09.000 : en:Memphis Digs Deeper
01:08:01.000 : en:The Conspirators Interrogate Memphis
01:11:44.000 : en:The Conspirators Discuss Swagger
01:13:06.000 : en:Swagger & Memphis Seek Wisdom
01:18:00.000 : en:Tracking the shooter
01:20:02.000 : en:Payne Attacks Sarah
01:21:24.000 : en:Swagger & Memphis Prepare for the Attack
01:23:16.000 : en:Memphis and Swagger Infiltrate the Ranch
01:26:38.000 : en:Swagger Interrogates Sandor
01:33:50.000 : en:Swagger Has a Flashback
01:36:00.000 : en:The FBI Investigates the ranch
01:37:23.000 : en:Memphis and Swagger Make Some Calls
01:39:56.000 : en:Memphis and Swagger Meet With the Conspirators
01:43:31.000 : en:Swagger Takes the Shot
01:44:29.000 : en:Calling in the FBI
01:47:26.000 : en:Swagger Surrenders
01:50:08.000 : en:Swagger Makes a Point
01:54:42.000 : en:The Attourney General Gives Swagger a Suggestion
01:55:31.000 : en:Johnson and Meacham Celebrate
01:57:27.000 : en:Swagger Deals With the Conspirators
02:01:04.000 : en:End Credits
Example of user-corrected chapters (click to expand)
00:00:00.000 : en:Shooter (2007)
00:02:58.637 : en:Engaging the Enemy
00:08:14.494 : en:Thirty-Six Months Later
00:12:36.756 : en:Planning an Assassination
00:27:20.097 : en:Taking the Shot
00:31:07.866 : en:On the Run
00:48:53.889 : en:Discrepencies
00:53:43.220 : en:The Investigation Continues
01:05:09.155 : en:Digging Deeper
01:13:10.678 : en:Seeking Wisdom
01:21:23.337 : en:The Preparation
01:33:49.624 : en:Flashback
01:39:56.116 : en:Meeting the Conspirators
01:47:25.022 : en:Surrendering
01:55:30.924 : en:Celebration
02:00:29.222 : en:End Credits
Note: studios have been found to store chapters with incorrect timestamps, and have the Java menu quietly correct them upon playback.
If eac3to did not find chapters or they are not named:
Named chapters should be capitalized according to the APA Style Guide. Refer to https://capitalizemytitle.com/ for further assistance.
For foreign chapters, use the MKVToolNix chapter editor to include both the original chapter names and the English-translated chapter names with the correct flags set for each.
If you are editing a chapter.txt
file directly, make sure that you are using UTF-8. If you use ANSI, your chapters might break after international characters such as é
.
Different sources will often need to be timed so that they are in sync. Chapters often need to be re-synced to scene change I-frames (see below) since less competent studios do not do this.
Method 1: compare video (recommended):
Open both video tracks in AviSynth+/VapourSynth.
Find the difference in frame count between the same frame on both tracks.
Convert the offset to seconds by dividing the frame difference (i.e. the number of frames by which the two sources are misaligned), and the frame rate of the video source you will use.
Note: 23.976 fps is actually 24000/1001.
E.g. Divide an offset of 120 frames by (24000 frames / 1001 seconds) to get 5.005 seconds.
120 / (24000/1001) = 5.005
Convert the offset to seconds using the rational framerate.
Apply delay to audio in MKVToolNix.
Method 2: compare audio
On negative delays, MKVToolNix cuts out the unnecessary audio which maintains compatibility. However, on positive delays, MKVToolNix applies the delay in a flag which some devices are incompatible with. For positive delays:
eac3to input.eac3 output.eac3 +178ms
If the negative delay cuts off non-silent audio, you would need to prepend black video to the video track:
Do the following:
Macros → Import Bookmarks From File
(AVSPMod) or Script → Preview → Load Chapters
(VSEdit), and import the corrected eac3to-extracted chapters.txt or the corrected MKVExtract-extracted chapter XML as done in step 7.2 (Chapters: check for accuracy).F2
and shift+F2
(AVSPMod) or Ctrl+left
and Ctrl+right
(VSEdit) to jump to the next/previous chapter and verify it is on the correct scene and on the scene-change frame.If the chapter on the scene-change frame is not an I-frame.
next
/previous
frame buttons.Ctrl+B
on the selected frame (AVSPMod) or by pressing [Un]bookmark current frame
(VSEdit).Sync retail subtitles (.PGS, VobSub):
OK
to bypass the OCR.Synchronization
tab.File → Plugins
) Replace VobSub IDX timestamps
.Synchronization → Replace IDX timestamps
).Sync retail subtitles (.SRT):
Synchronization
tab.Adjust all times
and enter the delay if necessary.Create/edit custom subtitles (.SRT):
BDs distributed by Kino Lorber are known for a silent intro of their logo that is exactly 11011 milliseconds long but in which time no empty audio or subtitle track is played. This means that the audio and subtitle tracks will be out-of-sync by 11011 milliseconds with the video and chapters.
MKVToolNix Chapter Editor → Right-Click → Additional Modifications → Shift
.MKV Tags allow for useful metadata to be specified.
Create an .XML file with UTF-8 text encoding for the mkv tags for later. Note the comments inside <!-- -->
.
Click each of the following to expand:
For a Movie:
<?xml version="1.0" encoding="UTF-8"?>
<tags>
<tag> <!-- Movie Template -->
<targets>
<targettypevalue>50</targettypevalue> <!-- 50 is used for MOVIE/EPISODE/CONCERT -->
</targets>
<simple>
<name>IMDB</name>
<string>tt#####</string> <!-- Replace # with imdb id for that movie e.g. tt4154756 -->
</simple>
<simple>
<name>TMDB</name>
<string>movie/#####</string> <!-- Replace # with tmdb id for that movie e.g. movie/299536 -->
</simple>
</tag>
</tags>
For a TV Show (simple version):
<?xml version="1.0" encoding="UTF-8"?>
<tags>
<tag> <!-- TV Show Template (simple) -->
<targets>
<targettypevalue>70</targettypevalue> <!-- 70 is used for COLLECTION -->
</targets>
<simple>
<name>IMDB</name>
<string>tt####</string> <!-- Replace # with IMDB id for that tv series e.g. tt0944947 -->
</simple>
<simple>
<name>TMDB</name>
<string>tv/####</string> <!-- Replace # with TMDB id for that tv series e.g. tv/1399 -->
</simple>
<simple>
<name>TVDB</name>
<string>####</string> <!-- Replace # with TVDB id for that tv series e.g. 121361 -->
</simple>
</tag>
</tags>
For a TV Show (advanced version - which should be used when possible):
<?xml version="1.0" encoding="UTF-8"?>
<tags>
<tag> <!-- TV Show Template (Advanced) -->
<targets>
<targettypevalue>70</targettypevalue> <!-- 70 is used for COLLECTION -->
</targets>
<simple>
<name>IMDB</name>
<string>tt####</string> <!-- Replace # with IMDB id for that tv series e.g. tt0944947 -->
</simple>
<simple>
<name>TMDB</name>
<string>tv/####</string> <!-- Replace # with TMDB id for that tv series e.g. tv/1399 -->
</simple>
<simple>
<name>TVDB</name>
<string>####</string> <!-- Replace # with TVDB id for that tv series e.g. 121361 -->
</simple>
</tag>
<tag> <!-- Season -->
<targets>
<targettypevalue>60</targettypevalue> <!-- 60 is used for SEASON/SEQUEL/VOLUME -->
</targets>
<simple>
<name>PART_NUMBER</name>
<string>#</string> <!-- Replace # with season number e.g. 1 -->
</simple>
<simple>
<name>TOTAL_PARTS</name>
<string>#</string> <!-- Replace # with number of episodes in that season e.g. 10 -->
</simple>
</tag>
<tag> <!-- Episode -->
<targets>
<targettypevalue>50</targettypevalue> <!-- 50 is used for MOVIE/EPISODE/CONCERT -->
</targets>
<simple>
<name>PART_NUMBER</name>
<string>#</string> <!-- Replace # with episode number of that season e.g. 4 -->
</simple>
<simple>
<name>IMDB</name>
<string>tt####</string> <!-- Replace # with IMDB id for that episode e.g. tt1829963 -->
</simple>
</tag>
</tags>
Note: when using TMDB IDs, verify that it is correctly identified by TMDB as a movie or TV show. The metadata system breaks if, for example, TMDB identifies a movie as a TV show but is tagged the 50
TargetTypeValue. You should create a TMDB account to edit or create a new entry.
Use MKVToolNix to remux the assets you’ve prepared into an MKV container.
Import the following:
If a movie is divided between more than one disc:
Append files
.The tracks must be sorted in the following order.
The main video track should be placed first.
Audio should be placed second and in the following sequence:
Subtitles should be placed next in the following order:
Forced for non-English/foreign dialogue/titles
for the production’s primary spoken language if applicable.Intertitles
for the production’s primary language if applicable.For non-English parts on English dub
if applicable.Intertitles
for the English dub if applicable.Subtitle ordering example:
for foreign dialogue
SDH
Traditional
SDH
Canadian
SDH / Canadian
For non-English parts on English dub
(only if production’s primary language was not English)Dub
(only if production’s primary language was not English)Commentary by ...
Traditional / Commentary by ...
Commentary by ...
Canadian / Commentary by ...
The video track title should reflect the BDInfo Quick Summary
MPEG-4 AVC Video / 31990 kbps / 1080p / 23.976 fps / 16:9 / High Profile 4.1
MPEG-H HEVC Video / 50156 kbps / 2160p / 23.976 fps / 16:9 / Main 10 @ Level 5.1 @ High / 4:2:0 / 10 bits / 4000nits / HDR10+ / BT.2020
MPEG-H HEVC Video / 56339 kbps / 2160p / 23.976 fps / 16:9 / Main 10 @ Level 5.1 @ High / 4:2:0 / 10 bits / 1000nits / HDR10 / BT.2020 / Dolby Vision FEL @ 5860 kbps
/
.FEL
should be specified when the layer’s bitrate exceeds ~2500 kbps, otherwise, MEL
should be specified. See blu-ray.com and the wiki for further guidance.The audio track title(s) should reflect the BDInfo Quick Summary.
DTS:X Master Audio / 7.1 / 48 kHz / 6586 kbps / 24-bit
/
.Audio track title naming exceptions:
Surround Upmix / DTS-HD Master Audio / 5.1 / 48 kHz / 3611 kbps / 24-bit
Original Mix / DTS-HD Master Audio / 4.0 / 48 kHz / 2947 kbps / 24-bit
Stereo Mix / FLAC Audio / 2.0 / 48 kHz / 1352 kbps / 16-bit
Stereoized Mono / FLAC Audio / 2.0 / 48 kHz / 387 kbps / 16-bit
FLAC Audio / 2.0 / 48 kHz / 752 kbps / 16-bit
Compatibility Track / Dolby Digital Audio / 5.1 / 48 kHz / 640 kbps
Dub / Dolby TrueHD Audio / 5.1 / 48 kHz / 2342 kbps / 24-bit
Commentary track names should be descriptive:
Commentary by director/producer Jeff Orlowski, lead James Balog, and field coordinators Adam LeWinter and Svavar Jónatansson
/
.Actor 1, Actor 2, and Actor 3
rather than Actor 1, Actor 2 and Actor 3
director
, writer
, co-writer
, producer
, cinematographer
, editor
, film historian
, British film historian
, filmmaker
Commentary by director Guy Hamilton, accompanied by cast and crew
Commentary by the kids from "School of Rock"
Commentary by filmmaker/historian Bret Wood, author of Orson Welles: A Bio-Bibliography
Commentary by "Beware the Moon" filmmaker Paul Davis
Commentary by director John Huckert moderated by Tom Fitzgerald of EXP TV
Commentary by The Hysteria Continues podcast
Isolated score with commentary by composer Mark Isham
Notes on older audio formats that may be unfamiliar to you.
Dolby Surround: (click to expand)
Dolby Surround
.DTS 2.0 surround
(usually when DTS-HD MA is used) as opposed to DTS 2.0
.Dolby Surround 4.0
instead of Dolby Digital 4.0
.Channel layout: Lt/Rt
in MediaInfo (DTS codecs only).Audio: English / Dolby Digital Audio / 2.0 / 48 kHz / 192 kbps / DN -4dB / Dolby Surround
in BDInfo.AC3 Surround, 2.0 channels, 192kbps, 48kHz, dialnorm: -27dB, 3ms
in eac3to.Dolby Surround AC-3 Digital 4.0
Dolby Surround /
for DD 4.0, orDiscrete LCRS /
or Original Surround Mix /
for 4.1 (Dolby Surround 4.0 with an enhanced LFE) and for formats other than DD.Dolby Surround
.Dolby Surround /
.Subtitles must be set to the correct language. You may need to enable additional languages via MKVToolNix settings if some are missing. You should only give subtitles a track title in the following cases:
Latin American
, Brazilian
, Canadian
, Traditional
to specify a dialect of Spanish, Portuguese, French or Chinese.Simplified
, Traditional
, Cantonese
, Simplified / Singapore
, Traditional / Hong Kong
or Traditional / Taiwan
.SDH
.
SDH
stands for “Subtitles for the Deaf or Hard of Hearing”, but are also useful for anyone watching in noisy environments (e.g. commuting) or with the sound turned down (e.g. when your partner is asleep). SDH subtitles include additional information such as background noises (e.g. [door creaks]
).SDH / Latin American
.For non-English dialogue/titles
.For non-Korean dialogue/titles
if the production’s primary language is Korean.For non-English parts on English dub
for the English dub if the production’s primary language is non-English.Canadian / Commentary by...
/ Studio / Source
/ Criterion / NTSC DVD
or / Amazon
/ OCR
Language flags. The following should be set:
zxx
.Set the following boolean flags to no
if the following cases don’t apply.
Default flags. Set the Default track
flag to yes
for the following:
Forced flags. Set the Forced display
flag to yes
for the following:
Hearing impaired flags. Set the Hearing impaired
flag to yes
for all SDH subtitles.
Visual impaired flags. Set the Visual impaired
flag to yes
for all audio tracks that include auditory descriptions for the visually impaired.
Text descriptions flags. Set the Text descriptions
flag to yes
for all subtitle tracks with text-based descriptions for the visually impaired that can be read via a screen reader or Braille device.
Original language flags. Set the Original language
flag to yes
for all audio tracks in the production’s primary language.
Commentary flags. Set the Commentary
flag to yes
for all audio and subtitle tracks that are commentary.
Dialog normalization. Tick Remove dialog normalization
on all lossless tracks as well as DTS-HD HRA. For all other tracks, make sure it is unticked.
zlib compression. Verify that zlib compression is disabled for all tracks.
Title naming. Give a title in the form:
Movie Name (Year)
TV Show Name - S##E## - Episode Name
TV Show Name - S##E##
Chapter file. Add the chapter file created from step 7 (Chapters) on the Output tab.
Tag file. Add the tag file created from step 9 (Tag) on the Output Tab.
Name the file according to site rules. Use only the following characters (no spaces):
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-
Name.Year.S##E##.Cut.Hybrid.REPACK.Resolution.Source.Type.HDR.VCodec.ACodec.Channels-Extensions.Object-Tag
Theatrical
, else, e.g.: Directors.Cut
, Extended
, Special.Edition
, Unrated
, 3D
, Super.Duper.Cut
).480i
, 576i
, 720p
, 1080p
, 1080i
, 2160p
). Video resolution.XXth Anniversary Edition
, Remastered
, 4K Remaster
, Criterion
, Limited
). Omit from filename and put in description.HDDVD
, BluRay
, UHD.BluRay
). Video disc source.REMUX
.HDR
for HDR10, HDR10Plus
, DV
, DV.HDR10Plus
).MPEG-2
, VC-1
, AVC
, HEVC
). Video codec.DD
, DD-EX
, DDP
, TrueHD
, DTS
, DTS-ES
, DTS-HD.MA
, DTS-HD.HRA
, DTS-X
, FLAC
). Audio codec of the default audio track.1.0
, 2.0
, 2.1
, 3.0
, 3.1,
4.0
, 4.1
, 5.0
, 5.1
, 6.1
, 7.1
). Audio channels of the default audio track.Atmos
).Congratulations! You have now successfully completed a high-quality remux.
It is highly encouraged that you participate in Blutopia’s user release program to receive feedback and approval from Blutopia internals.
Your approval request in the appropriate forum should consist of one Pastebin including the following in the same order:
You must add a -
before any tracks in the BDInfo that you have not remuxed and include the QUICK SUMMARY:
label at the beginning of each Quick Summary.
Example Pastebin text for a hybrid remux (click to expand)
QUICK SUMMARY:
Disc Label: EN_MAI_FAIS_CE_QU_IL_TE_PLAIT
Disc Size: 38,462,559,183 bytes
Protection: AACS
Playlist: 00001.MPLS
Size: 28,328,773,632 bytes
Length: 1:53:06.780
Total Bitrate: 33.39 Mbps
Video: MPEG-4 AVC Video / 24370 kbps / 1080p / 23.976 fps / 16:9 / Main Profile 4.1
-Audio: French / DTS-HD Master Audio / 5.1 / 48 kHz / 3829 kbps / 24-bit (DTS Core: 5.1 / 48 kHz / 1509 kbps / 24-bit)
-Audio: French / DTS-HD Master Audio / 2.0 / 48 kHz / 1677 kbps / 24-bit (DTS Core: 2.0 / 48 kHz / 768 kbps / 24-bit)
-Audio: French / DTS Audio / 2.0 / 48 kHz / 768 kbps / 16-bit
-Audio: French / DTS Audio / 2.0 / 48 kHz / 768 kbps / 16-bit
Subtitle: French / 5.665 kbps
Subtitle: French / 20.483 kbps
QUICK SUMMARY:
Disc Label: Come What May 2015 1080p USA Blu-ray AVC DTS-HD MA 5.1-CultFilms™
Disc Size: 43,812,883,300 bytes
Protection: AACS
Playlist: 00005.MPLS
Size: 27,188,355,072 bytes
Length: 1:53:13.411
Total Bitrate: 32.02 Mbps
-Video: MPEG-4 AVC Video / 25488 kbps / 1080p / 23.976 fps / 16:9 / High Profile 4.1
Audio: French / Dolby Digital Audio / 5.1 / 48 kHz / 448 kbps / DN -31dB
-Audio: French / DTS-HD Master Audio / 5.1 / 48 kHz / 3949 kbps / 24-bit (DTS Core: 5.1 / 48 kHz / 1509 kbps / 24-bit)
Audio: English / Dolby Digital Audio / 2.0 / 48 kHz / 448 kbps / DN -31dB
Subtitle: English / 25.049 kbps
General
Unique ID : 9423834467934860155940483189717009044 (0x716F6E96CA8B179C18E5C47C15B0294)
Complete name : Come.What.May.2015.Hybrid.1080p.BluRay.REMUX.AVC.DTS-HD.MA.5.1-BLURANiUM.mkv
Format : Matroska
Format version : Version 4
File size : 22.8 GiB
Duration : 1 h 53 min
Overall bit rate mode : Variable
Overall bit rate : 28.8 Mb/s
Movie name : Come What May (2015)
Encoded date : UTC 2020-06-14 21:28:57
Writing application : mkvmerge v47.0.0 ('Black Flag') 64-bit
Writing library : libebml v1.3.10 + libmatroska v1.5.2
IMDB : tt2296747
TMDB : movie/351192
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 4 frames
Format settings, GOP : M=1, N=12
Codec ID : V_MPEG4/ISO/AVC
Duration : 1 h 53 min
Bit rate mode : Variable
Bit rate : 24.4 Mb/s
Maximum bit rate : 39.6 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.490
Stream size : 19.2 GiB (85%)
Title : MPEG-4 AVC Video / 24370 kbps / 1080p / 23.976 fps / 16:9 / Main Profile 4.1
Language : French
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio #1
ID : 2
Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 1 h 53 min
Bit rate mode : Variable
Bit rate : 3 951 kb/s
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossless
Stream size : 3.12 GiB (14%)
Title : DTS-HD Master Audio / 5.1 / 48 kHz / 3949 kbps / 24-bit
Language : French
Default : Yes
Forced : No
Audio #2
ID : 3
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : A_AC3
Duration : 1 h 53 min
Bit rate mode : Constant
Bit rate : 448 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 362 MiB (2%)
Title : Commentary by director Christian Carion
Language : English
Service kind : Complete Main
Default : No
Forced : No
Text #1
ID : 4
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Duration : 1 h 45 min
Bit rate : 29 b/s
Count of elements : 912
Stream size : 22.6 KiB (0%)
Language : English
Default : Yes
Forced : No
Text #2
ID : 5
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 1 h 45 min
Bit rate : 26.9 kb/s
Count of elements : 2096
Stream size : 20.3 MiB (0%)
Title : SDH
Language : English
Default : No
Forced : No
Text #3
ID : 6
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 1 h 42 min
Bit rate : 6 258 b/s
Count of elements : 530
Stream size : 4.58 MiB (0%)
Title : Pour le dialogue non français
Language : French
Default : No
Forced : No
Text #4
ID : 7
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 1 h 45 min
Bit rate : 21.9 kb/s
Count of elements : 1935
Stream size : 16.6 MiB (0%)
Title : SDH
Language : French
Default : No
Forced : No
Menu
00:00:00.000 : en:Communist Propaganda - fr:Propagande communiste
00:05:13.313 : en:France, Summer 1939 - fr:France, été 1939
00:12:31.751 : en:War - fr:Guerre
00:20:00.190 : en:Evacuation - fr:Évacuation
00:28:14.692 : en:Council Meeting - fr:Réunion du Conseil
00:36:43.701 : en:Wine Cellar - fr:Cave à vin
00:42:34.550 : en:Germans - fr:Allemands
00:49:50.988 : en:La Fontaine Fable - fr:La Fontaine Fable
00:58:07.983 : en:Action! - fr:Action!
01:08:15.091 : en:Max! - fr:Max!
01:16:00.556 : en:French Resistance - fr:Résistance française
01:21:52.407 : en:Papa - fr:Papa
01:30:45.939 : en:Going Home - fr:Rentrer à la maison
01:40:33.527 : en:Across The River - fr:De l'autre côté de la rivière
01:46:46.899 : en:End Credits - fr:Crédits de fin
eac3to v3.34
command line: "Z:\home\me\eac3to\eac3to.exe" ../EN_MAI_FAIS_CE_QU_IL_TE_PLAIT/ 1) 1: chapters.txt 2: video.h264 3: audio.dtsma 7: french-forced.sup 8: french-sdh.sup -progressnumbers -log=eac3tolog.txt
------------------------------------------------------------------------------
M2TS, 1 video track, 4 audio tracks, 2 subtitle tracks, 1:53:07, 24p /1.001
1: Chapters, 16 chapters
2: h264/AVC, 1080p24 /1.001 (16:9)
3: DTS Master Audio, French, 5.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 1509kbps, 48kHz)
4: DTS Master Audio, French, 2.0 channels, 24 bits, 48kHz
(core: DTS, 2.0 channels, 768kbps, 48kHz)
5: DTS, French, 2.0 channels, 768kbps, 48kHz
6: DTS, French, 2.0 channels, 768kbps, 48kHz
7: Subtitle (PGS), French
8: Subtitle (PGS), French
Creating file "chapters.txt"...
[v02] Extracting video track number 2...
[s08] Extracting subtitle track number 8...
[a03] Extracting audio track number 3...
[s07] Extracting subtitle track number 7...
[v02] Creating file "video.h264"...
[a03] Creating file "audio.dtsma"...
[s08] Creating file "french-sdh.sup"...
[s07] Creating file "french-forced.sup"...
Video track 2 contains 162720 frames.
Subtitle track 7 contains 265 captions.
Subtitle track 8 contains 967 captions.
eac3to processing took 1 minute, 40 seconds.
Done.
eac3to v3.34
command line: "Z:\home\me\eac3to\eac3to.exe" "../Come What May 2015 1080p USA Blu-ray AVC DTS-HD MA 5.1-CultFilms/" 1) 1:usa.chapters.txt 4:usa.mainaudio.* -6089ms 5:commentary.* -6089ms 6:english.sup -6089ms -log=comewhatmay.usa.demuxlog.txt
------------------------------------------------------------------------------
M2TS, 1 video track, 3 audio tracks, 1 subtitle track, 1:53:13, 24p /1.001
1: Chapters, 15 chapters
2: h264/AVC, 1080p24 /1.001 (16:9)
3: AC3, French, 5.1 channels, 448kbps, 48kHz
4: DTS Master Audio, French, 5.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 1509kbps, 48kHz)
5: AC3, English, 2.0 channels, 448kbps, 48kHz
6: Subtitle (PGS), English
Creating file "usa.chapters.txt"...
[s06] Extracting subtitle track number 6...
[a05] Extracting audio track number 5...
[a04] Extracting audio track number 4...
[a05] Applying (E-)AC3 delay...
[a04] Applying DTS delay...
[a04] A remaining delay of +1ms could not be fixed.
[a05] A remaining delay of -9ms could not be fixed.
[a04] Creating file "usa.mainaudio.dtsma"...
[a05] Creating file "commentary.ac3"...
[s06] Creating file "english.sup"...
Video track 2 contains 162879 frames.
Subtitle track 6 contains 1048 captions.
eac3to processing took 1 minute, 21 seconds.
Done.