Hello!
As I've encountered some problems with the AV Decoder in v1.4.1 when trying to convert D10/IMX files, I've realized I don't really understand if need this node. The documentation says it is needed if I want to use filters behind. I often use crop, resize, pad and watermark filters.
When I bypass the A/V Media decoder, my workflows still run. So don't these filters need the AV decoder and its generated AviSynth script?
The Insert media filter node however does need the AV Decoder results, when the resolutions of the video itself and the intro/outro don't match.
When do I need the AV Decoder to perform a full decode? In v1.4.1 the full decode results in incorrectly cropped IMX files. But I don't need the full decode (and its lossless x264 file), do I? The options "intelligent" and "no decode" don't touch the incoming video, only the AviScript is generated, the IMX files are processed properly. This is my experience. Can you confirm my thoughts?
(My workflows usually look like this: Input files MXF OP1a D10/IMX (SD) and AVC Intra (HD) > A/V Decoder > analyze interlacing > deinterlace > crop > resize > insert watermark > insert intro and outro > encode as h.264, IMX, AVC Intra)
kind regards
Usage of A/V Media Decoder?
Re: Usage of A/V Media Decoder?
Hi Pogle,
the "Full Decode" option in the A/V decoder was inserted to overcome some edge cases in which ffms2 (i.e the indexer in Avisynth we're invoking as part of this) has some issues.
For instance, there were some problematic DNX120 files from OpenCube with which ffms2 had some issues (you could see some green lines), there were some ProRes files from some Arri cameras that ffms2 interpreted incorrectly (you could see blue faces instead of pink due to the wrong planes) etc. All of them have since been fixed.
For audio, this was needed for Sony's IPCM before FFAudioSource() introduced support while in some other cases like DolbyE and DolbyED2 Full Decode is still mandatory 'cause otherwise the audio won't be decoded properly when encoded in those two codecs.
Anyway, what Full Decode does is create a lossless H.264 file for videos at 8bit and 10bit or a lossless HuffYUV file for videos up to 16bit, while for audio it creates a lossless PCM file.
You can even have a mix and match of them, namely leave the video as "No Decode" and the audio as "Full Decode" and it will work just fine.
In general, when setting the A/V Decoder to "No Decode", it will do something like this:
In other words, it indexes the file and it creates a .ffindex temporary metadata file in which it stores the type of each and every frame of the source and it will use it to decode the video and the audio. The A/V Decoder is required whenever you want to use a filter or a custom Avisynth script etc, however nothing stops you from using it even if you just want to "connect" it to an encoder. To be fair, out of 307 workflows in my farm, I'd say that well over 290 use it and they're all set in the following way:
Video: No Decode
Audio: Full Decode, DolbyE
with the "Use Avisynth x64" tickbox set as well as the "non linear" one, while the "force 8bit" one is unticked.
the "Full Decode" option in the A/V decoder was inserted to overcome some edge cases in which ffms2 (i.e the indexer in Avisynth we're invoking as part of this) has some issues.
For instance, there were some problematic DNX120 files from OpenCube with which ffms2 had some issues (you could see some green lines), there were some ProRes files from some Arri cameras that ffms2 interpreted incorrectly (you could see blue faces instead of pink due to the wrong planes) etc. All of them have since been fixed.
For audio, this was needed for Sony's IPCM before FFAudioSource() introduced support while in some other cases like DolbyE and DolbyED2 Full Decode is still mandatory 'cause otherwise the audio won't be decoded properly when encoded in those two codecs.
Anyway, what Full Decode does is create a lossless H.264 file for videos at 8bit and 10bit or a lossless HuffYUV file for videos up to 16bit, while for audio it creates a lossless PCM file.
You can even have a mix and match of them, namely leave the video as "No Decode" and the audio as "Full Decode" and it will work just fine.
In general, when setting the A/V Decoder to "No Decode", it will do something like this:
Code: Select all
video=FFVideoSource("video.mxf")
audio=FFAudioSource("audio.mxf")
AudioDub(video, audio)Video: No Decode
Audio: Full Decode, DolbyE
with the "Use Avisynth x64" tickbox set as well as the "non linear" one, while the "force 8bit" one is unticked.
Re: Usage of A/V Media Decoder?
As Frankie left this question open...
The filters you mention are avisynth filter so of course they require a generated avisynth script.
What happens when you do not insert A/V decoder in your workflow but use such a filter, the filter will detect the current %s_source% file does not have ".avs" extension and invoke the A/V decoder function in the background with default options set. So after all the A/V decoder is there but you dont see it and you have no options to influence its behaviour.
emcodem, wrapping since 2009 you got the rhyme?
Re: Usage of A/V Media Decoder?
Ah, right, that's live already, lol.
I was gonna say "shhh" as I thought you were gonna spoil a "surprise", but I've actually now realized that the change was from Oct 21st, 2024.
I swear I thought we did it more recently and it was gonna come in 1.4.2, but actually it was there when 1.4.1 got released in February this year (2025), so it's already there ehehehehehehehe
Anyway, yes, starting from 1.4.1 (this is a very recent change) when there's a filter, if there isn't an A/V Decoder node, then the _def_dec_avmedia_ini() function is called, which invokes the A/V Decoder to perform the indexing.
How does it do that? Well... Easy:
Use video = true
Use audio = true
Video decoding method: No Decode
Video Format: Same as Source
Non linear access unticked
Force 8bit unticked
Audio Decoding Method: No Decode
Audio Channels: Same as Source
Audio Bit Depth: 24bit
Audio Sample Rate: 48000Hz
About the use x64 Avisynth, it checks if the special force 32bit tickbox in the workflow is ticked and if it is, it goes x86, if it's not it goes x64.
In other words, it will always call FFVideoSource() and FFAudioSource() as indexers and rely on them to do the right thing.
I was gonna say "shhh" as I thought you were gonna spoil a "surprise", but I've actually now realized that the change was from Oct 21st, 2024.
I swear I thought we did it more recently and it was gonna come in 1.4.2, but actually it was there when 1.4.1 got released in February this year (2025), so it's already there ehehehehehehehe
Anyway, yes, starting from 1.4.1 (this is a very recent change) when there's a filter, if there isn't an A/V Decoder node, then the _def_dec_avmedia_ini() function is called, which invokes the A/V Decoder to perform the indexing.
How does it do that? Well... Easy:
Use video = true
Use audio = true
Video decoding method: No Decode
Video Format: Same as Source
Non linear access unticked
Force 8bit unticked
Audio Decoding Method: No Decode
Audio Channels: Same as Source
Audio Bit Depth: 24bit
Audio Sample Rate: 48000Hz
About the use x64 Avisynth, it checks if the special force 32bit tickbox in the workflow is ticked and if it is, it goes x86, if it's not it goes x64.
In other words, it will always call FFVideoSource() and FFAudioSource() as indexers and rely on them to do the right thing.
Re: Usage of A/V Media Decoder?
Thanks again for your help.