Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th February 2024, 13:30   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
LSmash weird Audio [JFYI]

DUFF THREAD, WILL BE DELETED, Please Ignore.

There is something real weird with new LWLibavAudioSource(ff_options="drc=0,...") stuff on WAV audio,
so far as I know, the eg "NICAC3Source(...,DRC=0)" is supposed to remove EXISTING DRC from AC3 files,
but if used on WAV, LWLibavAudioSource(ff_options = "drc=0,...") then seems to affect WAV, even when no drc is applied, think should only apply any drc stuff to AC3 [or other DRC applied audio],
and not apply to WAV ie linear non-compressed [without drc applied].
MeGUI Produces real nasty audio when "Normalize Peaks to:- 98" used in AAC audio settings with new LWLibavAudioSource(ff_options = "drc=0,...") stuff on linear WAV source file.

I'm going back to older LSmash before recent DRC thingy (before ff_options ="drc=0,..."), until I at least figure out what the new plug is doing wrong/different, I got many encodes with nasty audio.

I've long converted all source audio to 16 bit stereo WAV using FFMPEG script, with DRC removed, prior to encode script.
(to reduce excessive [eg 20->30 min] MEGUI normalize times with eg 24/96 bit, 7.1 audio source, if converted to 16 bit stereo within script)
EDIT: Same nasty result whether DRC box ticked or not in MEGUI audio encode AAC settings.

EDIT: It is totally possible, [even probable] that I totally misunderstand the drc thingy, but, what I always used to do with good output audio, has now totally horrible result
when ff_options="drc=0,..." rather than drc=0 as in earlier version LSMash audio source filter with WAV source.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 22nd February 2024 at 09:15.
StainlessS is offline   Reply With Quote
Old 20th February 2024, 21:53   #2  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
I cannot reproduce the issue.
I used the following script to test:
Code:
LWLibavAudioSource("input.wav")
#LWLibavAudioSource("input.wav", ff_options="drc_scale=0")
1. ffmpeg -i above_script_with_undefined_drc.avs -c:a pcm_s32le drc.wav
2. ffmpeg -i above_script with_drc0.avs -c:a pcm_s32le drc1.wav

Both drc.wav and drc1.wav are identical (same SHA256 hash).
StvG is offline   Reply With Quote
Old 21st February 2024, 01:09   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
1) I convert source AC3 or other input format audio to 16 bit stereo intermediate.WAV using FFMPEG script.
2) Use eg avs script, LWLibavAudioSource("intermediate.wav", ff_options="drc_scale=0")
3) Use MegUI to use source step 2) avs script, Nero AAC encode to AAC with Normalize Peaks to 98.

Quote:
1. ffmpeg -i above_script_with_undefined_drc.avs -c:a pcm_s32le drc.wav
2. ffmpeg -i above_script with_drc0.avs -c:a pcm_s32le drc1.wav
Maybe try use old pre change DLL LWLibavAudioSource(drc_scale=0), compare with new DLL LWLibavAudioSource(ff_options="drc_scale=0")

EDIT: The Convert to 16 bit stereo script
Code:
REM Convert audio to 16 bit stereo
REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment)
REM We DO NOT LIKE ACCENTS IN FILE NAMES.


setlocal

REM Where to Find ffmpeg
set FFMPEG="C:\BIN\ffmpeg.exe"

REM Where to get input file, No terminating Backslash, "." = current directory
set INDIR="."


REM Where to place output file, No terminating Backslash.
set OUTDIR=".\OUTPUT"


FOR %%A IN (*.thd *.dts *.ac3 *.w64 *.aac *.m4a *.eac3 *.wav *.mp3) DO (
  %FFMPEG% -i "%INDIR%\%%A" -vn -acodec pcm_s16le -ac 2 "%OUTDIR%\%%~nxA.WAV"

)
EDIT:
Good pre change dll, LSMASHSource_x64_1147.0.0.0.06Nov2023_[Asd-g].dll # Good, pre drc stuff, LWLibavAudioSource(drc_scale=0)
One of the bad dll's, LSMASHSource_x64_1167.0.0.0.12Jan2024.dll # not good new dll, LWLibavAudioSource(ff_options="drc_scale=0")

EDIT: I'll try create a reproducible file set.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 21st February 2024 at 01:24.
StainlessS is offline   Reply With Quote
Old 21st February 2024, 02:15   #4  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
I don't use MeGUI. I installed the latest version but I didn't find NeroAAC for audio encoding (only FFmpeg AAC..).

I did one more test:
1. Converted ac3 5.1 to 16-bit wav 2.0 (ffmpeg -i in.ac3 -c:a pcm_s16le -ac 2 out.wav)
2. Used LWLibavAudioSource("out.wav", ff_options="drc_scale=0") with LSMASHSource_x64_1167.0.0.0 (ffmpeg -i script.avs -c:a -pcm_s32le 1.wav)
3. Used LWLibavAudioSource("out.wav") with LSMASHSource_x64_1167.0.0.0 (ffmpeg -i script.avs -c:a -pcm_s32le 2.wav)
4. Used LWLibavAudioSource("out.wav", drc_scale=0) with LSMASHSource_x64_1147.0.0.0 (ffmpeg -i script.avs -c:a -pcm_s32le 3.wav)

All three files (1.wav, 2.wav, 3.wav) have same SHA256 hash.

Edit: I downloaded Nero AAC Encoder.
I tested:
1. ffmpeg -i script.avs -f wav - | neroAacEnc.exe -ignorelength -q 0.5 -if - -of 1.mp4 (script.avs: LWLibavAudioSource("out.wav", ff_options="drc_scale=0") with LSMASHSource_x64_1167.0.0.0)
2. ffmpeg -i script.avs -f wav - | neroAacEnc.exe -ignorelength -q 0.5 -if - -of 2.mp4 (script.avs: LWLibavAudioSource("out.wav", "drc_scale=0) with LSMASHSource_x64_1147.0.0.0)
3. Nero AAC Encoder doesn't output identical files even if I run the same command twice. So to compare 1.mp4 and 2.mp4 I created the following script:
Code:
BlankClip(length=65000, pixel_type="yv12")
AudioDub(LWLibavAudioSource("1.mp4"))
a=Waveform()
AudioDub(LWLibavAudioSource("2.mp4"))
Waveform()
WriteFileIf("output.txt", "LumaDifference(a) > 0", "current_frame")
After the run of the script, the "output.txt" was empty (meaning both 1.mp4 and 2.mp4 are identical).

Last edited by StvG; 21st February 2024 at 20:33. Reason: Correct BlankClip pixel_type
StvG is offline   Reply With Quote
Old 22nd February 2024, 09:11   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Sorry StvG,
this thread is totally bogus, is self inflicted problem, not problem of LSMash.

I made some changes somewhere in big (35KB,700 line) script, still not sure where the problem resides and as I updated on all machines, I dont
positively know what I did wrong. I have however managed to kludge the problem until I find it.

Anyway, part of fix was to convert all input WAVs to float, I'm using this if anybody finds it of use.

ConvStereoAudio.Bat
Code:
REM Convert audio to WAV, 32 bit FLOAT stereo, 44.1KHz without dynamic range compression.
REM We DO NOT LIKE SPACES IN FILE NAMES (REM == REMark ie comment)
REM We DO NOT LIKE ACCENTS IN FILE NAMES.
REM Input from same directory at this bat file, output to existing "OUTPUT" directory in same directory as this bat file.

setlocal

REM Where to Find ffmpeg
set FFMPEG="C:\BIN\ffmpeg.exe"

REM Where to get input file, No terminating Backslash, "." = current directory
set INDIR="."

REM Where to place output file, No terminating Backslash.
set OUTDIR=".\OUTPUT"


FOR %%A IN (*.thd *.dts *.ac3 *.w64 *.aac *.m4a *.eac3 *.wav *.mp3) DO (
  %FFMPEG% -drc_scale 0 -i "%INDIR%\%%A" -vn -acodec pcm_f32le -ac 2  -ar 44100 "%OUTDIR%\%%~nxA.WAV"
)
I'll probably delete this dodgy thread in a couple of days.

Again, sorry for this waste of space
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 24th February 2024, 19:39   #6  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,542
If somebody else is happen to run into the same condition it maybe helpful to leave the thread up...
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 24th February 2024, 23:22   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK boss, up it stays.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:35.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.