Ichunjo / vardautomation

Encoding automation framework

Home Page:https://vardautomation.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic external audio file support

LightArrowsEXE opened this issue · comments

Currently when passing externally indexed files (like for example dgi or d2v files), FileInfo2 will not include any audio. I'd like for there to be an automatic check in the pah's directory for any externally demuxed audio.

My idea is as follows:

  1. Check if audios is empty (ideally prior to trimming and whatnot)
  2. If it is, check for a set list of extensions for the input file (I propose just dgi and d2v files for now due to easy repeatability, but this can be expanded if you so choose)
  3. If there's a match, use a glob to get all the audio files that match the same name + a common set of audio extensions (to stop it from picking up other junk).1
  4. Check if there's a PCM file. If there is, set that as a_src. If not, use the first file found.23
  5. Process the files as normally

Why the current implementation doesn't work

Right now, users can set an a_src themselves. But that doesn't result in a usable audio node for previewing. So if for example you're processing an episode in a DVD that's not at the start, you'll get the episode 1 audio unless you load bas yourself and handle all the trimming. Handling this automatically is much easier on the user, and falls within the scope of vardautomation's implementations.

Caveats

This implementation would probably not work well if the user passed an indexer that automatically indexed using dgindexnv (like for example a hypothetical future rewrite of lvsfunc.misc.source), as it would instead try to use the file passed to that indexer to determine the audio situation. I don't know how to best handle that.

Footnotes

  1. In the case of dgindex, the demuxed audio will often be called something like KIBA_91371 T80 2_0ch 48KHz 384Kbps DELAY 0ms.ac3 (where KIBA_91371.dgi would be the input file), for example.

  2. This can also be changed to be the biggest file, or you could maybe set a hierarchy of what kinds of files would take priority with PCM at the top or something

  3. An alternative would be to add List[VPath] support to it, but that's probably a step too far. Might be something to look at in the future perhaps?

Alternatively, on IEW Discord, an idea came to me: making a separate package for reading dgi and d2v files. It would return, among other things, the paths for the tracks, audio included.
I prefer this idea instead of put everything in vardautomation.