VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Member
    Join Date
    Aug 2024
    Location
    Denmark
    Search PM
    Hi, I'm new to the forum and I have some questions:

    The movie Spirit (original, not the sequel) was never released on Blu-ray here in Denmark, so in order to bring the best possible version of it to my kids, I'm trying to sync the dubbed DVD (PAL 25fps) audio to the american Blu-ray (NTSC 23.976fps).

    After much trial and error in both Audacity and with different FFmpeg scripts, I tried both MeGUI and UsEac3to, and while they both seem to produce the same, correct pitch (when listened to) and the exact same length on the files, their spectrograms looks vastly different (I'm using Spek to view them), and I'm not sure which file is the most correct to use going forward.

    My plan is this: make an MKV from the DVD with MakeMKV, then use gMKVExtractGUI to extract the AC3 from the MKV file, slow it down from 25fps to 23.976fps whilst converting it to a lossless format (I'm currently stuck here), import it into Audacity and line it up with the audio from the Blu-ray, since it starts a bit later than the DVD does (even when the DVD's video is converted from 25fps to 23.976fps), and when done editing, export it as AC3 for compability reasons (my old 5.1 receiver is connected to the TV through Toslink Optical).

    The reason for the last file, the one ending in "no2ndpass", is UsEac3to said it was clipping and that a second pass was needed, and when that second pass was run through, the finished product looked vastly different on the spectrogram in comparison to the MeGUI one. I therefore added -no2ndpass in the hopes that it would look more like the original file, but it didn't. I have uploaded a gif of the different spectrograms here:

    Image
    [Attachment 81308 - Click to enlarge]


    If the gif is moving too fast, here are the images of the spectrograms, one by one:

    Here is the log for MeGUI (6666.1007):
    Code:
    [Information] Log
    -[Information] Versions
    --[Information] MeGUI: 2944 x64
    --[Information] MeGUI Debug Data: available
    --[Information] Update Check: stable update server
    --[Information] System Information
    ---[Information] Operating System: Windows 10 Pro 22H2 x64 (10.0.19045.4651)
    ---[Information] .NET Framework: 4.0 (4.0.0.0)
    ---[Information] .NET Framework: 4.8 (4.8.09037)
    ---[Information] Redistributables
    ----[Information] Microsoft Visual C++ 2010 x64:  10.0.40219
    ----[Information] Microsoft Visual C++ 2010 x86:  10.0.40219
    ----[Information] Microsoft Visual C++ 2015-2022 x64:  14.40.33810
    ----[Information] Microsoft Visual C++ 2015-2022 x86:  14.40.33810
    ---[Information] DPI: 125% (120/120)
    ---[Information] Monitor 1
    ----[Information] Resolution: 1920x1080
    ----[Information] Primary Screen: True
    --[Information] Component Information
    ---[Information] Haali Media Splitter: 1.9.42.1 (10-01-2009)
    ---[Information] Haali DSS2: not installed
    ---[Information] ICSharpCode.SharpZipLib: 0.85.5.452 (07-08-2008)
    ---[Information] MediaInfo: 18.05.0.0 (08-05-2018)
    ---[Information] SevenZipSharp: 0.64.3890.29348 (02-01-2011)
    ---[Information] 7z: 9.20 (18-11-2010)
    --[Information] AviSynth Information
    ---[Information] AviSynth Wrapper
    ----[Information] Version: 1.0.2847.0
    ----[Information] Date: 06-05-2018
    ----[Information] Interface: 3
    ---[Information] AviSynth
    ----[Information] AviSynth Status: ignored as portable build is forced
    ---[Information] AviSynth portable
    ----[Information] File Version: 3.5
    ----[Information] File Date: 02-04-2020
    ----[Information] File Name: AviSynth+ 3.5 (r3106, 3.5, x86_64)
    ----[Information] File Path: c:\users\oscar\nedlastinger\firefox\megui.x64-6666.1405\avisynth.dll
    ----[Information] AviSynth Version: AviSynth+ 3.5 (r3106, 3.5, x86_64)
    ----[Information] AviSynth+: true
    ----[Information] AviSynth MT: true
    ----[Information] AviSynth Status: active
    -[Information] Update detection
    --[Information] [25.07.2024 14:32:08] Using cached update config and server: http://megui.org/auto/stable/
    --[Information] [25.07.2024 14:32:08] No package requires an update
    -[Information] Log for job1 (audio, Spirit_Original.ac3 -> Spirit_MeGUI.flac)
    --[Information] [25.07.2024 14:32:32] Started handling job
    --[Information] [25.07.2024 14:32:32] Preprocessing
    --[Information] [25.07.2024 14:32:32] MediaInfo
    ---[Information] File: D:\Video\Spirit_Original.ac3
    ---[Information] General
    ----[Information] Format: AC-3
    ----[Information] FileSize: 230487552
    ----[Information] PlayTime: 01:20:01.824
    ---[Information] Audio
    ----[Information] Format: AC-3
    ----[Information] FormatInfo: Audio Coding 3
    ----[Information] SamplingRate: 48000
    ----[Information] SamplingRateString: 48.0 kHz
    ----[Information] Channels: 6
    ----[Information] ChannelsString: 6 channels
    ----[Information] ChannelPositionsString2: 3/2/0.1
    ----[Information] BitRateMode: CBR
    ----[Information] [25.07.2024 14:32:32] The language information is not available for this track. The default MeGUI language has been selected.
    --[Information] [25.07.2024 14:32:32] Trying to open the file with LWLibavAudioSource()
    --[Information] [25.07.2024 14:32:34] Successfully opened the file with LWLibavAudioSource()
    --[Information] [25.07.2024 14:32:37] AviSynth script
    ---[NoImage] ClearAutoloadDirs()
    ---[NoImage] AddAutoloadDir("C:\Users\Oscar\Nedlastinger\Firefox\MeGUI.x64-6666.1405\tools\avs\plugins")
    ---[NoImage] LoadPlugin("C:\Users\Oscar\Nedlastinger\Firefox\MeGUI.x64-6666.1405\tools\lsmash\LSMASHSource.dll")
    ---[NoImage] LWLibavAudioSource("D:\Video\Spirit_Original.ac3")
    ---[NoImage] # detected channels: 6
    ---[NoImage] # detected channel positions: 3/2/0.1
    ---[NoImage] ConvertAudioToFloat(last)
    ---[NoImage] SSRC(Round((AudioRate()*1001.0)/960.0)).AssumeSampleRate(AudioRate())
    ---[NoImage] AudioBits(last)>24?ConvertAudioTo24bit(last):last 
    ---[NoImage] return last
    --[Information] [25.07.2024 14:32:37] Command line used: --force --force-raw-format --endian=little --sign=signed -5 - -o "{0}"
    --[Information] [25.07.2024 14:32:37] AviSynth script environment opened
    --[Information] [25.07.2024 14:32:38] Script loaded
    --[Information] [25.07.2024 14:32:38] Output Decoder
    ---[Information] [25.07.2024 14:32:38] Channels: 6
    ---[Information] [25.07.2024 14:32:38] Bits per sample: 24
    ---[Information] [25.07.2024 14:32:38] Sample rate: 48000
    --[Information] [25.07.2024 14:32:38] Job command line: C:\Users\Oscar\Nedlastinger\Firefox\MeGUI.x64-6666.1405\tools\flac\flac.exe --force --force-raw-format --endian=little --sign=signed -5 - -o "D:\Video\Spirit_MeGUI.flac" --channels=6 --bps=24 --sample-rate=48000
    --[Information] [25.07.2024 14:32:38] Process started
    --[Information] [25.07.2024 14:32:38] Standard output stream
    --[Information] [25.07.2024 14:32:38] Standard error stream
    ---[Information] [25.07.2024 14:37:40] flac 1.4.2
    ---[Information] [25.07.2024 14:37:40] Copyright (C) 2000-2009  Josh Coalson, 2011-2022  Xiph.Org Foundation
    ---[Information] [25.07.2024 14:37:40] flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
    ---[Information] [25.07.2024 14:37:40] welcome to redistribute it under certain conditions.  Type `flac' for details.
    ---[Information] [25.07.2024 14:37:40] (No runtime statistics possible; please wait for encoding to finish...)
    --[Information] [25.07.2024 14:37:40] MediaInfo
    ---[Information] File: D:\Video\Spirit_MeGUI.flac
    ---[Information] General
    ----[Information] Format: FLAC
    ----[Information] FileSize: 1977106095
    ----[Information] PlayTime: 01:23:26.901
    ---[Information] Audio
    ----[Information] Format: FLAC
    ----[Information] FormatInfo: Free Lossless Audio Codec
    ----[Information] SamplingRate: 48000
    ----[Information] SamplingRateString: 48.0 kHz
    ----[Information] Channels: 6
    ----[Information] ChannelsString: 6 channels
    ----[Information] ChannelPositionsString2: 3/2/0.1
    ----[Information] BitRateMode: VBR
    ----[Information] [25.07.2024 14:37:40] The language information is not available for this track. The default MeGUI language has been selected.
    --[Information] [25.07.2024 14:37:40] Postprocessing
    ---[Information] [25.07.2024 14:37:40] Deleting intermediate files
    ----[Information] [25.07.2024 14:37:40] Successfully deleted D:\Video\Spirit_Original.ac3.lwi
    --[Information] [25.07.2024 14:37:40] Job completed

    Here is the log for UsEac3to (eac3to352-UsEac3to134) with second run:
    Code:
    eac3to v3.52
    command line: "C:\Users\Oscar\Nedlastinger\Firefox\eac3to352-UsEac3to134\eac3to.exe"  "D:\Video\Spirit_Original.ac3" Spirit_UsEac3To.flac -slowdown -progressnumbers -log="C:\Users\Oscar\Nedlastinger\Firefox\eac3to352-UsEac3to134\UsEac3To.log"
    ------------------------------------------------------------------------------
    Running in fast mode
    Keeping dialnorm
    AC3, 5.1 channels, 1:20:02, 384kbps, 48kHz, dialnorm: -27dB
    Decoding with libav/ffmpeg...
    Changing FPS from 25.000 to 23.976...
    Reducing depth from 64 to 24 bits...
    Encoding FLAC with libFlac...
    Creating file "Spirit_UsEac3To.flac"...
    Clipping detected, a 2nd pass will be necessary.  <WARNING>
    Starting 2nd pass...
    Decoding with libav/ffmpeg...
    Changing FPS from 25.000 to 23.976...
    Reducing depth from 64 to 24 bits...
    Encoding FLAC with libFlac...
    Applying -1.67dB gain...
    Creating file "Spirit_UsEac3To.flac"...
    eac3to processing took 24 minutes, 31 seconds.
    Done.

    Here is the log for UsEac3to (eac3to352-UsEac3to134) without second run:
    Code:
    eac3to v3.52
    command line: "C:\Users\Oscar\Nedlastinger\Firefox\eac3to352-UsEac3to134\eac3to.exe"  "D:\Video\Spirit_Original.ac3" Spirit_UsEac3To_no2ndpass.flac -slowdown -no2ndpass -progressnumbers -log="C:\Users\Oscar\Nedlastinger\Firefox\eac3to352-UsEac3to134\UsEac3To.log"
    ------------------------------------------------------------------------------
    Running in fast mode
    Keeping dialnorm
    AC3, 5.1 channels, 1:20:02, 384kbps, 48kHz, dialnorm: -27dB
    Decoding with libav/ffmpeg...
    Changing FPS from 25.000 to 23.976...
    Reducing depth from 64 to 24 bits...
    Encoding FLAC with libFlac...
    Creating file "Spirit_UsEac3To_no2ndpass.flac"...
    Clipping detected, a 2nd pass will be necessary.  <WARNING>
    The 2nd pass is skipped by request.  <WARNING>
    eac3to processing took 11 minutes, 17 seconds.
    Done.

    Let me know if you want a sample-file (and how I can chop it up into smaller pieces without ruining the audio) or the whole file, and I'll get it to you. I'm willing to throw everything I've learned about this slowdown process out the window and learn the proper way, if I've done something wrong or in an improper way.

    Thank you very much.
    Quote Quote  
  2. Originally Posted by spinkeln View Post
    Hi, I'm new to the forum and I have some questions:

    The movie Spirit (original, not the sequel) was never released on Blu-ray here in Denmark, so in order to bring the best possible version of it to my kids, I'm trying to sync the dubbed DVD (PAL 25fps) audio to the american Blu-ray (NTSC 23.976fps).

    After much trial and error in both Audacity and with different FFmpeg scripts, I tried both MeGUI and UsEac3to, and while they both seem to produce the same, correct pitch (when listened to) and the exact same length on the files, their spectrograms looks vastly different (I'm using Spek to view them), and I'm not sure which file is the most correct to use going forward.

    My plan is this: make an MKV from the DVD with MakeMKV, then use gMKVExtractGUI to extract the AC3 from the MKV file, slow it down from 25fps to 23.976fps whilst converting it to a lossless format (I'm currently stuck here), import it into Audacity and line it up with the audio from the Blu-ray, since it starts a bit later than the DVD does (even when the DVD's video is converted from 25fps to 23.976fps), and when done editing, export it as AC3 for compability reasons (my old 5.1 receiver is connected to the TV through Toslink Optical).

    Thank you very much.
    You could use the easy way to get your lossless (23.976 fps length) flac audio.
    Use clever FFmpeg-GUI, load the mkv (from your DVD, ripped with MakeMKV), click main, click encode audiostream, set the ac3 stream, click go to the encoder.
    Then set all like in the picture below.
    Click encode. Done.

    Image
    [Attachment 81330 - Click to enlarge]
    Last edited by ProWo; 8th Aug 2024 at 11:06.
    Quote Quote  
  3. There's probably several reasons why the spectrograms could look a bit different, although if they sound the same I wouldn't worry too much. Resampling isn't an exact science and no two resamplers will produce identical results. As far as I know MeGUI and eac3to both use SSRC for resampling audio though, and it looks like they both appear to be using SSRC's fast mode. Some differences....

    MeGUI would be decoding the audio as 32 bit floating point. eac3to appears to decode it as 64 bit floating point.
    There's a few SSRC options neither of them give you access to such as applying dither, and I don't know if MeGUI and eac3to use the same settings.

    You could do the resampling two different ways in Avisynth. MeGUI did it this way:

    Audio.SSRC(Round(48000.0*1001.0/960.0), fast=true).AssumeSampleRate(48000)

    but this should produce the desired output, although with possibly a slightly different result.

    Audio.AssumeSampleRate(round(48000.0*1001.0/960.0)).SSRC(48000, fast=true)

    I don't know how eac3to does it.

    For the record, MeGUI's audio encoder configuration has an option for normalizing the audio. After the resampling is done, it would run a second pass using Avisynth's Normalize() function. Also for the record, MeGUI's HD Streams Extractor uses eac3to to do the work. You need to click on settings in the top left corner and tick all the boxes as for some inexplicable reason they're mostly unchecked by default. The +Options column then lets you type eac3to arguments manually.

    Quote Quote  
  4. Member
    Join Date
    Aug 2024
    Location
    Denmark
    Search PM
    Originally Posted by ProWo View Post
    Originally Posted by spinkeln View Post
    Hi, I'm new to the forum and I have some questions:

    The movie Spirit (original, not the sequel) was never released on Blu-ray here in Denmark, so in order to bring the best possible version of it to my kids, I'm trying to sync the dubbed DVD (PAL 25fps) audio to the american Blu-ray (NTSC 23.976fps).

    After much trial and error in both Audacity and with different FFmpeg scripts, I tried both MeGUI and UsEac3to, and while they both seem to produce the same, correct pitch (when listened to) and the exact same length on the files, their spectrograms looks vastly different (I'm using Spek to view them), and I'm not sure which file is the most correct to use going forward.

    My plan is this: make an MKV from the DVD with MakeMKV, then use gMKVExtractGUI to extract the AC3 from the MKV file, slow it down from 25fps to 23.976fps whilst converting it to a lossless format (I'm currently stuck here), import it into Audacity and line it up with the audio from the Blu-ray, since it starts a bit later than the DVD does (even when the DVD's video is converted from 25fps to 23.976fps), and when done editing, export it as AC3 for compability reasons (my old 5.1 receiver is connected to the TV through Toslink Optical).

    Thank you very much. :)
    You could use the easy way to get your lossless (23.976 fps length) flac audio.
    Use clever FFmpeg-GUI, load the mkv (from your DVD, ripped with MakeMKV), click main, click encode audiostream, set the ac3 stream, click go to the encoder.
    Then set all like in the picture below.
    Click encode. Done.

    Image
    [Attachment 81330 - Click to enlarge]
    Thank you for this, while it is much easier to use that GUI than trying to find a compatible FFmpeg script to run, it seems to have given me the exact same output as the script did, and I did not find that to be accurate enough for my use.

    When every track is synced to the Blu-ray track on a specific spot at 0:00:06:241645 (h:mm:ss:ms), this is how they line up:
    Audacity 0:00:06:241645
    clever FFmpeg 0:00:06:241645
    MeGUI 0:00:06:241645
    UsEac3to 0:00:06:241645

    When I look at the Blu-ray track at exactly 0:42:35:680500, this is where I have to go to on the other tracks to find that exact same spot:
    Audacity 0:42:35:682710
    clever FFmpeg 0:42:35:678270
    MeGUI 0:42:35:680165
    UsEac3to 0:42:35:680165

    And when I look at the Blu-ray track at exactly 1:23:13:053435, this is where I have to go to on the other tracks to find that exact same spot:
    Audacity 1:23:13:057605
    clever FFmpeg 1:23:13:048935
    MeGUI 1:23:13:052625
    UsEac3to 1:23:13:052625

    While Audacity and FFmpeg fluctuate between 2,2ms and 4,5ms difference from the Blu-ray, MeGUI and UsEac3to only has a difference of 0,3ms to 0,8ms in comparison to the Blu-ray. It's not going to be noticeable when viewing the video with only one audio playing at a time, but I'll always know, and that's enough for me to only focus on MeGUI and UsEac3to.


    Originally Posted by hello_hello View Post
    There's probably several reasons why the spectrograms could look a bit different, although if they sound the same I wouldn't worry too much. Resampling isn't an exact science and no two resamplers will produce identical results. As far as I know MeGUI and eac3to both use SSRC for resampling audio though, and it looks like they both appear to be using SSRC's fast mode. Some differences....

    MeGUI would be decoding the audio as 32 bit floating point. eac3to appears to decode it as 64 bit floating point.
    There's a few SSRC options neither of them give you access to such as applying dither, and I don't know if MeGUI and eac3to use the same settings.

    You could do the resampling two different ways in Avisynth. MeGUI did it this way:

    Audio.SSRC(Round(48000.0*1001.0/960.0), fast=true).AssumeSampleRate(48000)

    but this should produce the desired output, although with possibly a slightly different result.

    Audio.AssumeSampleRate(round(48000.0*1001.0/960.0)).SSRC(48000, fast=true)

    I don't know how eac3to does it.

    For the record, MeGUI's audio encoder configuration has an option for normalizing the audio. After the resampling is done, it would run a second pass using Avisynth's Normalize() function. Also for the record, MeGUI's HD Streams Extractor uses eac3to to do the work. You need to click on settings in the top left corner and tick all the boxes as for some inexplicable reason they're mostly unchecked by default. The +Options column then lets you type eac3to arguments manually.

    Where did you get your MeGUI's HD Streams Extractor? I originally used MeGUI (6666.1007) taken from here: https://www.videohelp.com/software/MeGUI and it looks like this:
    Image
    [Attachment 81351 - Click to enlarge]


    I googled MeGUI HD-DVD/Blu-ray Streams Extractor and found this: https://www.videohelp.com/software/HD-DVD-Blu-Ray-Stream-Extractor
    And while the oldest version availible on that link looks a lot closer to the one you have, it does not have the "Settings" button:
    Image
    [Attachment 81352 - Click to enlarge]



    When it comes to Avisynth, I got recommended to use BeHappy, as that was said to be easier to set up for someone like me who's never used Avisynth, but I still couldn't make it work. How does someone like me, who knows absolutely nothing about Avisynth even start? There is an overwhelming amount of information out there, and there are regular, forks, alphas and + versions of Avisynth. I just don't know where to start.

    It would be great to run both of those lines you gave me in Avisynth and see if that first line matches up to MeGUI and since you said that the last line "should produce the desired output, although with possibly a slightly different result." I would love to compare them to each other and see exactly what is different and if I would be able to use one, or both of them.
    Quote Quote  
  5. MeGUI's HD Streams Extractor can be found under the Tools menu. As far as I know it was based on the original stand-alone version you linked to, but the stand-alone version hasn't been actively developed for a long time.

    The difference between the two ways of resampling in Avisynth I mentioned is simply the order it's done in.

    From MeGUI's log file, the SSRC resampler was used to resample the audio at a sample rate of 50050Hz. After the resampling, the duration and pitch should be identical, but instead of there being 48000 samples per second there's 50050. Then AssumeSampleRate was used to slow the rate of playback down to 48000Hz again.

    SSRC(Round(48000.0*1001.0/960.0), fast=true) # resampled at 50050Hz
    AssumeSampleRate(48000)

    And if you do the math:

    25 / 23.976
    or to be as accurate as possible
    25 / (24000 / 1001) = 1.04270833333
    and
    50050 / 48000 = 1.04270833333

    It's possible to do it the other way around by first slowing it down and then resampling it, but sorry... the second example I offered earlier was incorrect and should have been:

    AssumeSampleRate(round(48000.0*960.0/1001.0)).SSRC(48000, fast=true)

    Although now I'm doing the math I've realized it'd be less accurate as the audio would be slowed down to 46033.966034 samples per second, which would need to be rounded to 46034 samples per second before it's resampled again at 48000Hz, and
    48000 / 46034 = 1.04202848211
    so for this particular conversion the order in which MeGUI did it was the better choice.

    For a conversion between integer frame rates such as from 25fps to 24fps it shouldn't matter which order it's done in, in respect to the accuracy of the duration, as there'd be no rounding involved either way.
    48000 * 1000 / 960 = 50000
    48000 * 960 / 1000 = 46080
    The result might be slightly different though in respect to how it's resampled.

    So sorry... for a 25fps to 23.967fps conversion it appears there's really only one order it should be done in and everything else I've mentioned so far is irrelevant.

    I honestly wouldn't be worried about it too much, but I'm happy to help with the basics of Avisynth when I can, although no doubt others will be willing to help.

    If you'd like to mess around with resampling using a GUI, try this version of foobar2000.
    https://forum.videohelp.com/threads/396860-foobar2000-portable-(for-audio-encoding)
    It comes with a bunch of encoder presets for PAL-NTSC conversions, but there should also be several resampling DSPs you can add to the conversion chain. Each one has a drop down list of standard sample rates, but you can type in the rate you want to use.
    Foobar2000 might have a bit of a learning curve itself but it's a very good audio converter as well as a great player.

    As a quick example I took a 48kHz flac file and resampled it at 50050Hz using the SSRC DSP while converting it to flac again.
    Then I opened that file and slowed it down to 48000Hz with ffmpeg. I didn't have a preset already configured so I modified an existing one to output a wave file. The ffmpeg command line for changing the playback rate:

    -i - -ignore_length true -af "asetrate=48000" -c:a pcm_s24le %d

    And as you can see:



    Once you get the hang of it you can resample the audio on it's way to ffmpeg without the need for the intermediate file. I converted the file twice more using the "single pass" method and the number of samples and the duration didn't change.

    So... you can drive yourself nutty playing around with that if you want to.



    The ffmpeg encoder preset for changing the playback rate:

    Last edited by hello_hello; 14th Aug 2024 at 11:50.
    Quote Quote  
  6. Member
    Join Date
    Aug 2024
    Location
    Denmark
    Search PM
    I use foobar2000 as my main music player, so I'm already quite familiar with it, but I wasn't aware it could also do this. I'll have to play around with it a bit when the weekend comes and I have some spare time available. Thank you very much for all your help so far @hello_hello!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!