Giter VIP home page Giter VIP logo

Comments (7)

mdhiggins avatar mdhiggins commented on June 3, 2024

Not an option using the base configuration, would need to be a custom function

Feel free to post your custom function that's not working and I'll take a look. canBypassConvert is probably the one you want

from sickbeard_mp4_automator.

screamjojo avatar screamjojo commented on June 3, 2024

If I had DTS in autoprocess.ini I've trying this custom "blockaudiocopy" :

def blockAudioCopy(mp, stream, path, info):
    # Custom function that skips HDR files that are missing proper HDR metadata / framedata
    mp.log.info("Initiating custom audio copy check method.")
    fra_audio_streams = [a for a in info.audio if a.metadata.get('language', '') == 'fra' and (a.metadata.get('codec', '') != 'ac3' or a.metadata.get('codec', '') != 'aac' or a.metadata.get('codec', '') != 'eac3')]
    if stream in fra_audio_streams:
        mp.log.info("found a fra language with not ac3 or aac or eac3 codec, conversion needed")
        return True
    return False

from sickbeard_mp4_automator.

mdhiggins avatar mdhiggins commented on June 3, 2024

I was more looking for your canBypassConvert attempt since that's what you're trying to do now, no?

from sickbeard_mp4_automator.

mdhiggins avatar mdhiggins commented on June 3, 2024

Sorry, I misremembered the name of the custom function, you would want to intervene on the validation function, not canBypassConvert as this is an internal function you shouldn't be modifying unless you're looking to fork the code

def validation(mp, info, path, tagdata):
    # Custom function that skips files that don't have french audio
    mp.log.info("Initiating custom validation method.")
    fra_audio_streams = [a for a in info.audio if a.metadata.get('language', '') == 'fra']
    return len(fra_audio_streams) > 0

from sickbeard_mp4_automator.

screamjojo avatar screamjojo commented on June 3, 2024

Sorry, I misremembered the name of the custom function, you would want to intervene on the validation function, not canBypassConvert as this is an internal function you shouldn't be modifying unless you're looking to fork the code

def validation(mp, info, path, tagdata):
    # Custom function that skips files that don't have french audio
    mp.log.info("Initiating custom validation method.")
    fra_audio_streams = [a for a in info.audio if a.metadata.get('language', '') == 'fra']
    return len(fra_audio_streams) > 0

Thank you but it's not what I want. I would like to don't convert the others audio tracks if not fra, but the file may be converted ...

from sickbeard_mp4_automator.

mdhiggins avatar mdhiggins commented on June 3, 2024

Got it, that wasn't clear at all

Might be able to do this by getting creative about manipulating the codec settings on the fly for each stream

If you want to always remux nonfrench streams you could force the codec pool to be 'copy' in those instances and then apply a more standard codec pool for the french streams

def blockAudioCopy(mp, stream, path):
    # Custom function that modifies codec pool depending on language
    mp.log.info("Initiating custom audio copy check method.")
    if stream.metadata.get('language') == 'fra':
        mp.settings.acodec = ['ac3', 'eac3', 'aac']  # maintain default behavior
    else:
        mp.settings.acodec = ['copy']  # force copy
    return False

Otherwise if that's still not the desired effect you need to be much more explicit about what you're trying to do

Of note, you're essentially bypassing your audio codec settings here and manually setting them, so in the future if you decide you change what codecs you want you'll need to update this function too

from sickbeard_mp4_automator.

screamjojo avatar screamjojo commented on June 3, 2024

Got it, that wasn't clear at all

Might be able to do this by getting creative about manipulating the codec settings on the fly for each stream

If you want to always remux nonfrench streams you could force the codec pool to be 'copy' in those instances and then apply a more standard codec pool for the french streams

def blockAudioCopy(mp, stream, path):
    # Custom function that modifies codec pool depending on language
    mp.log.info("Initiating custom audio copy check method.")
    if stream.metadata.get('language') == 'fra':
        mp.settings.acodec = ['ac3', 'eac3', 'aac']  # maintain default behavior
    else:
        mp.settings.acodec = ['copy']  # force copy
    return False

Otherwise if that's still not the desired effect you need to be much more explicit about what you're trying to do

Of note, you're essentially bypassing your audio codec settings here and manually setting them, so in the future if you decide you change what codecs you want you'll need to update this function too

Worked like a charm !
Thank you so much :)

from sickbeard_mp4_automator.

Related Issues (20)

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.