True audio passthrough with "A/V Media" filter ?

Questions and answers on how to get the most out of FFAStrans
ainz
Posts: 5
Joined: Mon Mar 29, 2021 5:18 am

Re: True audio passthrough with "A/V Media" filter ?

Post by ainz »

so what im trying to work with is anime!.
So most of the source audio would be AAC, or AC3, which i want to merge with the encoded video.
the Source video will have to go through a debanding filter with avisynth, which is whats causing the issue, I am able to extract the audio, and encode the video and save them in a tmp folder.
Im not sure how to use the command executer, to merge both these files.
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: True audio passthrough with "A/V Media" filter ?

Post by emcodem »

Ok, so if you have video in one file and audio in the other, all you need to do is a commandline executor node with about this content:

Code: Select all

cmd /C ""%s_ffmpeg%" -i "__PATH_TO_VIDEO__" -i "__PATH_TO_AUDIO__" -map 0:v -map 1:a -codec copy "__PATH_TO_OUTPUT__""
Where
  • __PATH_TO_VIDEO__ would be like %s_source% in case you used one of the inbuilt encoders.
  • __PATH_TO_AUDIO__ would be the full path to your previously extracted audio, you need to store/set the filename in a variable using the populate variables node for example.
  • __PATH_TO_OUTPUT__ could probably be like "E:\videos\%s_original_name%.mov" for example.
And for explaination, as we have 2 times -i in our ffmpeg command, the maps work like this:

-map 0:v copies all video streams from the "first input file" to the output file
-map 1:a copies all audio streams from the "second input file" to the output file
-codec copy of course takes care that we rewrap only instead of encode audio and video.

As for the "temp dir", you can use %s_job_work% - this a "unique per job" subdirectory in the ffastrans cache folder, it will be housekeeped by ffastrans (if you didnt set your workflow to "keep work dir always"). If you do this, you could e.g. extract your audio before/while filtering/ encoding the video using this commandline:

Code: Select all

cmd /C ""%s_ffmpeg%" -i "%s_source%" -map 0:a -codec copy "%s_job_work%\original_audio.mov""
Which leads to __PATH_TO_AUDIO__ to be fixed: "%s_job_work%\original_audio.mov" - as the work directory is unique per job, you don't need to take care of a unique filename or such.

Re-thinking this, there is no real need to first extract your audios, so actually __PATH_TO_AUDIO__ can just be %s_original_full% and no extra step for audio extraction needed.
emcodem, wrapping since 2009 you got the rhyme?
ainz
Posts: 5
Joined: Mon Mar 29, 2021 5:18 am

Re: True audio passthrough with "A/V Media" filter ?

Post by ainz »

@emcodem Thank you for taking the time to explain this out for me. im still getting errors, but i'll keep trying to fix, i must be doing something wrong.

In the mean time let me drop the link to the workflow, maybe that would give you an idea of what i seem to be doing wrong.

Code: Select all

https://www.transfernow.net/dl/20210329moYBZwWS
thank you again for all the help and advice
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: True audio passthrough with "A/V Media" filter ?

Post by emcodem »

Hey,
thanks, a workflow is always good to have so i know what you are looking at.
So, first you should get the webinterface when doing these kind of experiments. It lets you easily investigate the logs and therefore see whats happening. E.g. for your commandline processor, you can copy the actually executed command from the log viewer and try it manually on commandline.

Second, your custom avs just returns the original m_clip, so your neo_f3kdb is not even used at all. Instead you should do like this:

Code: Select all

LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\neo-f3kdb\x64\neo-f3kdb.dll")
m_clip = neo_f3kdb (m_clip, range=16, y=64, cb=64, cr=64, grainy=0, grainc=0)
Return m_clip
Third, the final wrapping commandline seems to basically work. I just got some errors regarding timestamps but finally got it to work when using mov instead of mkv as output. I believe there are some setpts commands or such available in ffmpeg to indicate that it should start from 0 with all timecodes but i don't have it at hand right now.
emcodem, wrapping since 2009 you got the rhyme?
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: True audio passthrough with "A/V Media" filter ?

Post by emcodem »

try using

Code: Select all

-use_wallclock_as_timestamps 1

before the -i for the video
emcodem, wrapping since 2009 you got the rhyme?
ainz
Posts: 5
Joined: Mon Mar 29, 2021 5:18 am

Re: True audio passthrough with "A/V Media" filter ?

Post by ainz »

@emcodem
thank you again for helping me.
so i am able to run the command structure now, But it seems to create 2 files.
1, audio only
2. video only

this is the command im using.

Code: Select all

%comspec% /C ""%s_ffmpeg%" -use_wallclock_as_timestamps 1 -i "%s_source%" -i "%s_original_full%" -map 0:v -map 1:a -codec copy "D:\FFtrans_work_folders\Encoded\%s_original_name%.mkv""
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: True audio passthrough with "A/V Media" filter ?

Post by emcodem »

Hmmm so the command basically cannot create 2 different files as it is. I guess it's more a matter about how you start your jobs.
Is your input file "one file" with audio and video or do you need to start with 2 different files, one for audio and one for video?
A screenshot of your job monitor would be good to see :-)
emcodem, wrapping since 2009 you got the rhyme?
ainz
Posts: 5
Joined: Mon Mar 29, 2021 5:18 am

Re: True audio passthrough with "A/V Media" filter ?

Post by ainz »

the input file is 1 file containing both Audio and video,
it just refuses to map the subs and audio.
i'll keep experimenting, im almost there i think.
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: True audio passthrough with "A/V Media" filter ?

Post by emcodem »

cool 8-)
if u need help, please send some job log or some further data. The more data you provide, the easier you make it for us to help you. Workflow+Short File would be optimal (upload to ffastrans.com/share)
emcodem, wrapping since 2009 you got the rhyme?
mrazik
Posts: 36
Joined: Sat May 30, 2020 9:48 pm

Re: True audio passthrough with "A/V Media" filter ?

Post by mrazik »

Hi gents,

can you please share the workflow again? Looks like the link is unaccessible.

Many thanks,
mrazik
FFAStrans 1.2.2
Webinterface 1.2.0.4
- - - - - - - - - - - - - - - -
Intel Xeon CPU E5-1620 v3 @ 3.5GHz
8.00 GB RAM
NVIDIA Quadro K620
256GB SSD
1GB NIC
- - - - - - - - - - - - - - - -
Windows 10 Pro 64b
Post Reply