Page 1 of 3

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

Posted: Sat Feb 01, 2020 10:52 am
by Seppia
Hello

I'm trying to achieve the following :
Given a source .MP4 H264 video source with a few AAC stereo audio tracks, I need to :
- convert the video to ProRes proxy
- burn a Time-code on the video
- while modifyng as little as possible to the audio tracks codec and layout

So far my workflow is :
[Monitor] > [A/V Media] (required for the next "Time code" node) > [Time-code] > [custom FFMPEG] with the custom parameters being

Code: Select all

-map 0:v -vcodec prores_ks -profile:v 0 -qscale:v 16 -acodec copy -map 0:a
> [Deliver]

No particular problems for the video part, but I would like the audio to be an actual passthrough (= no remap, no re-encode of audio). The problem is, because I need the burn-in "Time Code" filter node, this requires an A/V Media decoder node upfront. And whenever I submit a file to the "A/V Media" decoder node, regardless of its "Audio decode" settings (= whether I pick "No decode", "Full decode" or "Intelligent") the audio ends up being re-encoded as PCM, and all the channels are remapped as mono tracks (even if the "Force output audio channel" is set to "Same as source").

Also if I disable both A/V Media and Time-code nodes, the audio is properly passed through (same AAC codec and same channels/tracks map as the source). But of course I don't get the burned-in Time Code on the video...

So I can't figure out how to do an actual audio passthrough because of this A/V Media node.

So I was thinking about extracting audio upfront, by putting an Audio extraction node before the A/V Media node and by disabling audio altogether in the A/V Media node (as I only need it for the video part), but I can't seem to remux both audio and video in my custom FFMPEG node.

Any thoughts ?

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

Posted: Sat Feb 01, 2020 2:38 pm
by momocampo
Hello Seppia and welcome to the forum!

Well I created a workflow for you but I need to know with which version of FFAStrans you work. 0.9 or beta 1.0?
Please tell me and I will send you ;)

Cheers.

Benjamin

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

Posted: Sat Feb 01, 2020 5:04 pm
by momocampo
Ok here is the workflow for FFAStrans 1.0 beta 7.
https://www.transfernow.net/21gr66r420dp

To resume :
Monitor> Populate variable to specify your final destination folder and a temporary folder to merge video and audio( you could use the %s_job_work% variable to avoid my last command executor node).
Then first branch extract audio from original file to audio file aac (copy) and deliver in temporary folder.
Second branch, AV\Media (only video) > timecode (set what you want) > Encode prores node (I specified only 1 audio track)> Delivery node (to temp folder) >COmmand executor to merge audio and video with audio mapping and delivery in final destination folder > Command executor to delete temp files.
Now you have your Prores file with the original audio aac from the source mp4 file.

Voilà ! You could edit it to personalize your paths.

Cheers

Benjamin

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

Posted: Sat Feb 01, 2020 5:57 pm
by Seppia
momocampo wrote: Sat Feb 01, 2020 2:38 pm Hello Seppia and welcome to the forum!
Thanks :-) !
momocampo wrote: Sat Feb 01, 2020 2:38 pmWell I created a workflow for you but I need to know with which version of FFAStrans you work. 0.9 or beta 1.0?
Currently (and successfully) trying the latest Beta 7.1 of the upcoming 1.0 version
momocampo wrote: Sat Feb 01, 2020 5:04 pmOk here is the workflow for FFAStrans 1.0 beta 7.
https://www.transfernow.net/21gr66r420dp
Thanks, I'll give it a try as soon as possible !
momocampo wrote: Sat Feb 01, 2020 5:04 pmTo resume :
Monitor> Populate variable to specify your final destination folder and a temporary folder to merge video and audio( you could use the %s_job_work% variable to avoid my last command executor node).
Then first branch extract audio from original file to audio file aac (copy) and deliver in temporary folder.
Second branch, AV\Media (only video) > timecode (set what you want) > Encode prores node (I specified only 1 audio track)> Delivery node (to temp folder) >COmmand executor to merge audio and video with audio mapping and delivery in final destination folder > Command executor to delete temp files.
I was hoping to avoid the temporary audio file extraction and the Command Executor, and merge audio directly in the FFMPEG node. But maybe I didn't get how the "audio extractor" worked...
Thanks anyway !

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

Posted: Sun Feb 02, 2020 9:46 am
by momocampo
was hoping to avoid the temporary audio file extraction and the Command Executor, and merge audio directly in the FFMPEG node. But maybe I didn't get how the "audio extractor" worked...
Thanks anyway !
Hey,
Ok so possible too and maybe simpler :
Monitor>AV/MEDIA>Timecode> Custom ffmpeg (with delivery destination inside)

Custom FFmpeg:

Code: Select all

-i "%s_original_full%" -c:v prores_ks -profile:v 2 -acodec copy  -map 0:v:0 -map 1:a:0 "c:\output.mov"
Don't forget to delete ALL boxes in the custom ffmpeg node (video and audio codec, bitrate video and audio. extension).
-proficle:v 2 --> Prores 422
Use 1 to Prores LT or 3 to 422 HQ
Specify your destination folder and output file name too :) (in my example :-- "c:\output.mov"--)


It will be ok for you now :)

Cheers.

Benjamin

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

Posted: Sun Feb 02, 2020 9:01 pm
by Seppia
momocampo wrote: Sun Feb 02, 2020 9:46 amOk so possible too and maybe simpler :
Monitor>AV/MEDIA>Timecode> Custom ffmpeg (with delivery destination inside)

Custom FFmpeg:

Code: Select all

-i "%s_original_full%" -c:v prores_ks -profile:v 2 -acodec copy  -map 0:v:0 -map 1:a:0 "c:\output.mov"
Don't forget to delete ALL boxes in the custom ffmpeg node (video and audio codec, bitrate video and audio. extension).
-proficle:v 2 --> Prores 422
Use 1 to Prores LT or 3 to 422 HQ
Specify your destination folder and output file name too :) (in my example :-- "c:\output.mov"--)
Thank you for putting me on the right tracks (...pun intended...) by making me realise that I could still add additional input to the Custom FFMPEG node command line (and not only from input nodes inside FFASTRANS graphical interface) !

I had to remove the last character of your "-map 1:a:0" part, as I require all audio tracks to be passed through from the input source.
And I tuned the -vcodec part, as I need the "proxy" flavour of the ProRes family (so -profile:v 0).
I also use the -qscale:v factor (to speed up encoding), that I set to 16 to decrease bitrate (and also degrades visual quality, which is acceptable for me in this workflow) : an idea I took from the Man himself ;-)
Finally I added an extra Deliver node (and removed the ""c:\output.mov"" from your FFMPEG line), after the Custom FFMPEG node, just for clearer visualisation of the workflow inside FFASTRANS' graphical interface.

So my final Custom FFMPEG node command is :

Code: Select all

-i "%s_original_full%" -map 0:v -vcodec prores_ks -profile:v 0 -qscale:v 16 -map 1:a -acodec copy

And I'm a happy camper, so thanks again :-) !

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

Posted: Mon Feb 03, 2020 10:07 am
by momocampo
Hello Seppia,

Happy to help.
Of course you can adapt your command as you wish, sorry I forgot you wanted Prores Proxy.
See you;)

Benjamin

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

Posted: Mon Mar 29, 2021 5:23 am
by ainz
@momocampo,
hi, im very new to FFAStrans, and im having trouble figuring out how to create a workflow to get what i need done.
What needs to happen in my case is
1. File gets dropped on folder
2. file gets decoded and video gets sent through avisynth filter.
3. And audio should be copied over to the temp folder
4. filtered video and source audio get merged and output to the needed folder.

i think its just like what Seppia was trying to accomplish.
would appreciate any help you can give me

thank you

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

Posted: Mon Mar 29, 2021 6:45 am
by momocampo
Hello Ainz and welcome to this forum.

Before I anwser you, I need to know if you just want to merge a video and an audio file or if you have to apply a filter or something else on your video (avisynth). If you don't have to apply a filter, you don't need to use avisynth, ffmpeg can do it very well.
So, tell answer me and I will give you a way to merge your files.

;)
B.

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

Posted: Mon Mar 29, 2021 7:13 am
by emcodem
@ainz

in addition to what B. said, being able to "truly passthrough" audios depends a lot on your input files, e.g. no matter what we do, we will never really be able to passtrough Dolby Atmos as far as i am aware. PCM on the other hand should be passed through by default without any changes using the A/V Decode node (and therefore subsequent filter nodes).

So i guess it is most important to ask: what input audio formats/codecs are you working with?

Generally, we will most likely need to work with custom ffmpeg/Commandline ffmpeg to get this done.