Page 1 of 1

exclude audio

Posted: Mon Dec 16, 2024 8:06 pm
by buddhabas
Hi all,
is there any chance to disable audio from this processor?

Image

Thanks!

Re: exclude audio

Posted: Mon Dec 16, 2024 8:17 pm
by emcodem
not directly, not that i am aware of. We can use A/V decoder and a custom avs script with

Code: Select all

m_clip = KillAudio(m_clip)
return m_clip

Re: exclude audio

Posted: Mon Dec 16, 2024 9:09 pm
by buddhabas
emcodem wrote: Mon Dec 16, 2024 8:17 pm not directly, not that i am aware of. We can use A/V decoder and a custom avs script with

Code: Select all

m_clip = KillAudio(m_clip)
return m_clip
Excellent!
It does works!

Image

Many many thanks! :D

Re: exclude audio

Posted: Mon Dec 16, 2024 10:05 pm
by FranceBB
I can see the A/V Decoder there.
There's no need to index the audio if you're not gonna use it anyway.
You can untick the "Use audio" tickbox and it will skip audio indexing. ;)

Re: exclude audio

Posted: Tue Dec 17, 2024 7:14 pm
by emcodem
FranceBB wrote: Mon Dec 16, 2024 10:05 pm I can see the A/V Decoder there.
There's no need to index the audio if you're not gonna use it anyway.
You can untick the "Use audio" tickbox and it will skip audio indexing. ;)
Tried that before trying killaudio, encoder complains about unkown track layout for 32 channels this way.

Re: exclude audio

Posted: Wed Dec 18, 2024 6:45 am
by FranceBB
Yeah that's because of BlankClip() which is then used to fill the rest of silence. You still have to use KillAudio() as in your suggestion, but instead of losing time indexing it and then throwing it away, by not indexing it in the first place we're not gonna lose time as what KillAudio() would kill is the mute generated by BlankClip() so it's gonna be faster.

Re: exclude audio

Posted: Wed Dec 18, 2024 10:19 am
by buddhabas
Hi,
on my WF I have a "A/V Media" node.
Inside there is:

Code: Select all

m_clip = KillVideo(m_clip)
m_clip.TimeStretch(tempo=100.0*(24000.0/1001.0)/(25.0)).ConvertAudioToFloat()
return m_clip
But I obtain a bad error:

Audio extraction@xxx: Validate: Input audio sample format to TimeStretch must be float.

Maybe the issue is the node before (with integer value)?

Image

How can I resolve? :)
I wanto to "Change speed of a sound without changing the pitch".
from 25fps to 23.976fps.

Thanks!

Re: exclude audio

Posted: Wed Dec 18, 2024 10:51 am
by emcodem
Just guessing...

m_clip = KillVideo(m_clip)
m_clip = ConvertAudioToFloat(m_clip)
m_clip.TimeStretch(tempo=100.0*(24000.0/1001.0)/(25.0)).ConvertAudioToFloat()
return m_clip

Re: exclude audio

Posted: Wed Dec 18, 2024 9:16 pm
by FranceBB
Oh this is funny. I live in PAL land and I generally perform the 4% speed up + pitch adjustment to go from 23,976fps to 25fps, but you live in NTSC land so you gotta do the exact opposite: 4% slowdown + pitch adjustment to go from 25fps to 23,976fps.

Anyway, is the slowdown why you have a separate flow for video and audio? I'm asking cause you can perform both at the same time.
As for Harry's lines, they're absolutely correct, but note that when changing the speed, the sampling also changes so I would add ResampleAudio(48000) at the end for good measure. Sure one could argue that ffmpeg would resample it anyway, but do I look like a guy who trusts FFMpeg? Just kidding, just kidding hahaha
Anyway, please note that the current version of TimeStretch() is limited to a maximum of 16ch so if your source has more than that, it's going to fail. TimeStretch() leverages on a library called SoundTouch to perform those conversions and in the new upcoming version we're gonna have support to 32ch.


Anyway, back to the topic. In case you wanted to do everything in one single go, you can put a conditional on the input frame rate in FFAStrans to check that it's 25fps and then do the following with a custom Avisynth script:

Code: Select all

ResampleAudio(m_clip, 48000)
ConvertAudioToFloat()
AssumeFPS(23.976, 1, true)
TimeStretch(pitch=104)
ResampleAudio(48000)
ConvertAudioTo24bit()

m_clip=last

return m_clip

and then feed that to the H.264 + AAC encoder set to 23,976fps.
You can then have other conditionals for other frame rates if you wanna do something different or you can just pass anything that isn't 25fps directly to the encoding node and the filter_builder will take care of the conversion for you. ;)