Ticket #4535: mythburn-fixmpegaudiostreams.diff

File mythburn-fixmpegaudiostreams.diff, 916 bytes (added by thrantastic@…, 13 years ago)

Fix adding a second audio stream to ffmpeg encoding with mythburn.py

  • mythburn.py

    old new  
    20192019
    20202020    #add second audio track if required
    20212021    if audio2[AUDIO_ID] != -1:
     2022        for param in parameters:
     2023            name = param.attributes["name"].value
     2024            value = param.attributes["value"].value
     2025
     2026            # only re-encode the audio if it is not already in AC3 format
     2027            if audio1[AUDIO_CODEC] == "AC3":
     2028                if name == "-acodec":
     2029                    value = "copy"
     2030                if name == "-ar" or name == "-ab" or name == "-ac":
     2031                    name = ""
     2032                    value = ""
     2033
     2034            if name == "-acodec" or name == "-ar" or name == "-ab" or name == "-ac":
     2035                    command += " " + name + " " + value
     2036
    20222037        command += " -newaudio"
    20232038
    20242039    #make sure we get the correct stream(s) that we want