exclude audio

Questions and answers on how to get the most out of FFAStrans
Post Reply
buddhabas
Posts: 19
Joined: Tue Oct 04, 2022 9:03 pm

exclude audio

Post by buddhabas »

Hi all,
is there any chance to disable audio from this processor?

Image

Thanks!
emcodem
Posts: 1815
Joined: Wed Sep 19, 2018 8:11 am

Re: exclude audio

Post 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
emcodem, wrapping since 2009 you got the rhyme?
buddhabas
Posts: 19
Joined: Tue Oct 04, 2022 9:03 pm

Re: exclude audio

Post 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
User avatar
FranceBB
Posts: 266
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: exclude audio

Post 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. ;)
emcodem
Posts: 1815
Joined: Wed Sep 19, 2018 8:11 am

Re: exclude audio

Post 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.
emcodem, wrapping since 2009 you got the rhyme?
User avatar
FranceBB
Posts: 266
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: exclude audio

Post 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.
buddhabas
Posts: 19
Joined: Tue Oct 04, 2022 9:03 pm

Re: exclude audio

Post 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!
Last edited by buddhabas on Wed Dec 18, 2024 12:58 pm, edited 1 time in total.
emcodem
Posts: 1815
Joined: Wed Sep 19, 2018 8:11 am

Re: exclude audio

Post 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
emcodem, wrapping since 2009 you got the rhyme?
User avatar
FranceBB
Posts: 266
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: exclude audio

Post 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. ;)
Post Reply