GithubHelp home page GithubHelp logo

ichunjo / vardautomation Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 2.0 1.2 MB

Encoding automation framework

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

Python 100.00%
vapoursynth automation python video-encoding encoding framework

vardautomation's People

Contributors

dependabot[bot] avatar ichunjo avatar lightarrowsexe avatar mukunku avatar rivenskaye avatar setsugennoao avatar tomato39 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vardautomation's Issues

Make subprocess catch mkvmerge exit code 1

mkvmerge returns exit code 1 if a warning is thrown (see: docs). However, currently this forcibly halts the muxing in vardautomation, because it errors before it can actually output anything it appears (and consequently, no cleaning up can be run either).

There should be an additional check to catch the exit code, if possible, and let vardautomation know that it's a non-fatal error and it should otherwise continue (and maybe throw a warning if you want, such as the one stderr should return).

Automatic external audio file support

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?

mkvmerge error after writing file

https://discord.com/channels/@me/599711298275770398/972537849524154378

Some unknown error can occur when running mkvmerge that can't be caught in a try/except clause. The final output is still being muxed, but it seems to throw an error when trying to exit, taking the entire process down with it.

Removing check=True in tooling/base.py:44 as done here seems to resolve the error

-            subprocess.run(self.params, check=True, text=True, encoding='utf-8')
+            subprocess.run(self.params, text=True, encoding='utf-8')

This might be a temporary solution for the time being, but a more permanent solution should be found asap.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.