VideoHelp Forum
+ Reply to Thread
Results 1 to 27 of 27
Thread
  1. I use avisynth for video all the time and its easy for me to combine or split them with trimming and ++ in the script.

    I have no experience whatsoever with encoding or combining 2 audio tracks and encoding them with avisynth though.

    How do you call audio and tell it to encode at a specified bitrate and then do the same with a second audio track and have them merge?


    Lets say this was the video trimmings. (I was told to use ++ because it can sync both video and audio that have different silence points)

    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    __t0 ++ __t1 ++ __t2 ++ __t3

    Normally I just use Megui AVS cutter and it saves a cuts file that will cut the audio in the correct places when I encode it. It does the avisynth work in the background without me making a script call for it.

    That's good for one episode or doing just video and works just fine for me, but what if I need to attach footage from another episode and audio from another episode?

    I know how to import another avs script and connect it to the one I am writing. I just wrote another script for the second episode and made it only the frames I want video wise, then I imported and attached it to the end of the first episode. I have the entire video completely trimmed and attached perfectly.

    The trimmings are as follows for the second episode.

    __film = last
    __t0 = __film.trim(24, 1475)
    __t1 = __film.trim(1547, 13941)
    __t2 = __film.trim(14014, 33266)
    __t3 = __film.trim(33339, 34082)
    __t0 ++ __t1 ++ __t2 ++ __t3


    What do I do for the audio? How would I call it in the script to encode the 2 separate audio files and combine them? I also need them to sync with the trimmings.
    Quote Quote  
  2. Just telling me how to import and encode a single .ac3 fie into a 384Kbps .mp4 file with ffaudiosource would be very helpful. I might be able to figure out the rest on my own if I learn how to do that.
    Quote Quote  
  3. Code:
    a = ffaudiosource("audio.ext")
    v = ffvideosource("video.ext")
    AudioDub(v,a)
    
    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    __t0 ++ __t1 ++ __t2 ++ __t3
    If audio.ext and video.ext (symbolic names here) are the same file be sure to open audio first.
    Last edited by jagabo; 12th Jul 2018 at 12:17.
    Quote Quote  
  4. Thanks for showing me that!! I will mess with it some.



    I don't have to specify a bitrate for the audio to encode to?

    I checked the MeGui log of it encoding an audio file and it looks like its using lines like

    -ignorelength -lc -cbr 576000 -if - -of "{0}"

    There's no extra parameters in the script needed?


    Code:
    -[Information] Versions
    --[Information] [7/11/2018 2:40:06 PM] MeGUI Version : 2112 (svn)
    --[Information] [7/11/2018 2:40:06 PM] OS : Windows Seven x64 SP1 (6.1.65536.7601)
    --[Information] [7/11/2018 2:40:06 PM] Latest .Net Framework installed : 4.0 (4.0.0.0)
    --[Information] [7/11/2018 2:40:06 PM] AviSynth Version : 2.6.0.4 (9/18/2013 7:37:18 AM)
    -[Information] Log for job1 (audio, T3_Audio - English.flac -> T3_Audio - English.mp4)
    --[Information] [7/11/2018 2:41:30 PM] Started handling job
    --[Information] [7/11/2018 2:41:30 PM] Preprocessing
    --[Information] [7/11/2018 2:41:30 PM] Encoding started
    --[Information] [7/11/2018 2:41:30 PM] MediaInfo
    ---[Information] File: C:\Users\User\Desktop\Encoding\FF\Movie\T3_Audio - English.flac
    ---[Information] General
    ----[Information] Format: FLAC
    ----[Information] FormatString: FLAC
    ----[Information] FileSize: 1455746975
    ----[Information] PlayTime: 01:55:13.406
    ---[Information] Audio
    ----[Information] ID: 
    ----[Information] StreamOrder: 
    ----[Information] Format: FLAC
    ----[Information] FormatProfile: 
    ----[Information] FormatSettingsSBR: 
    ----[Information] FormatSettingsPS: 
    ----[Information] SamplingRate: 48000
    ----[Information] SamplingRateString: 48.0 KHz
    ----[Information] Channels: 6
    ----[Information] ChannelsString: 6 channels
    ----[Information] ChannelPositionsString2: 
    ----[Information] BitRateMode: VBR
    ----[Information] Delay: 
    ----[Information] Title: 
    ----[Information] Language: 
    ----[Information] LanguageString: 
    --[Information] [7/11/2018 2:41:30 PM] Trying to open the file with FFAudioSource()
    --[Information] [7/11/2018 2:42:10 PM] Successfully opened the file with FFAudioSource()
    --[Information] [7/11/2018 2:42:10 PM] Avisynth script
    ---[NoImage] LoadPlugin("C:\Program Files (x86)\MeGui\tools\ffms\ffms2.dll")
    ---[NoImage] FFAudioSource("C:\Users\User\Desktop\Encoding\FF\Movie\T3_Audio - English.flac")
    ---[NoImage] return last
    --[Information] [7/11/2018 2:42:10 PM] Commandline used: -ignorelength -lc -cbr 576000 -if - -of "{0}"
    --[Information] [7/11/2018 2:42:10 PM] Avisynth script environment opened
    --[Information] [7/11/2018 2:42:10 PM] Script loaded
    --[Information] Output Decoder
    ---[Information] [7/11/2018 2:42:10 PM] Channels: 6
    ---[Information] [7/11/2018 2:42:10 PM] Bits per sample: 16
    ---[Information] [7/11/2018 2:42:10 PM] Sample rate: 48000
    --[Information] [7/11/2018 2:42:10 PM] Commandline: C:\Program Files (x86)\MeGui\neroAacEnc.exe -ignorelength -lc -cbr 576000 -if - -of "C:\Users\User\Desktop\Encoding\FF\Movie\T3_Audio - English.mp4"
    --[Information] [7/11/2018 2:42:10 PM] Encoder process started
    --[Information] [7/11/2018 2:51:25 PM] Output from encoder via stderr
    ---[NoImage] *************************************************************
    ---[NoImage] *                                                           *
    ---[NoImage] *  Nero AAC Encoder                                         *
    ---[NoImage] *  Copyright 2009 Nero AG                                   *
    ---[NoImage] *  All Rights Reserved Worldwide                            *
    ---[NoImage] *                                                           *
    ---[NoImage] *  Package build date: Feb 18 2010                          *
    ---[NoImage] *  Package version:    1.5.4.0                              *
    ---[NoImage] *                                                           *
    ---[NoImage] *  See -help for a complete list of available parameters.   *
    ---[NoImage] *                                                           *
    ---[NoImage] *************************************************************
    --[Information] [7/11/2018 2:51:26 PM] MediaInfo
    ---[Information] File: C:\Users\User\Desktop\Encoding\FF\Movie\T3_Audio - English.mp4
    ---[Information] General
    ----[Information] Format: MPEG-4
    ----[Information] FormatString: MPEG-4
    ----[Information] FileSize: 498783758
    ----[Information] PlayTime: 01:55:13.472
    ---[Information] Audio
    ----[Information] ID: 1
    ----[Information] StreamOrder: 
    ----[Information] Format: AAC
    ----[Information] FormatProfile: LC
    ----[Information] FormatSettingsSBR: No (Explicit)
    ----[Information] FormatSettingsPS: 
    ----[Information] SamplingRate: 48000
    ----[Information] SamplingRateString: 48.0 KHz
    ----[Information] Channels: 6
    ----[Information] ChannelsString: 6 channels
    ----[Information] ChannelPositionsString2: 3/2/0.1
    ----[Information] BitRateMode: VBR
    ----[Information] Delay: 
    ----[Information] Title: 
    ----[Information] Language: 
    ----[Information] LanguageString: 
    --[Information] [7/11/2018 2:51:26 PM] Postprocessing
    ---[Information] Deleting intermediate files
    ----[Information] [7/11/2018 2:51:26 PM] Successfully deleted C:\Users\User\Desktop\Encoding\FF\Movie\T3_Audio - English.flac.ffindex
    --[Information] [7/11/2018 2:51:26 PM] Job completed

    Basically, what that log says MeGui is doing to the audio in the GUI, I wish to know how to do in an Avisynth script without the GUI.
    Last edited by killerteengohan; 12th Jul 2018 at 13:40.
    Quote Quote  
  5. Okay nvm, apparently I just need to specify the audio source in the script like you showed and then instead of selecting the .ac3 file in megui, just select the script itself. All the settings are taken care of by the GUI.

    THANKS ALOT!!! for the help with that one.

    ffaudiosource does not seem to be working with .ac3 though. I read through the log after doing an ac3file and megui used something called nicac3source apparently. I tried that instead and it worked fine.
    Last edited by killerteengohan; 12th Jul 2018 at 17:10.
    Quote Quote  
  6. How do I attach and ending theme to this? this was the script I used for the episode.


    Code:
    a = nicac3source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3")
    v = DGDecode_mpeg2source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1.d2v", info=3)
    AudioDub(v,a)
    
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    crop( 2, 0, -2, 0)
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    
    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    __t0 ++ __t1 ++ __t2 ++ __t3


    This cut both the video and audio fine. How would I go about taking the video and audio from a separate source and combining them??

    for video I usually just do it like this and it connects the video in the second script right to the end of the video.

    __film = last
    __t0 = __film.trim(0, 0)
    Insert=Import("????.avs")
    __t0 ++ Insert


    I specified audio and video in the second script and added this to the bottom of the first script, but the audio will not encode and connect. The video will not load either, only the second episode shows and the first does not appear at all. Am I doing something wrong?


    Code:
    a = nicac3source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3")
    v = DGDecode_mpeg2source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1.d2v", info=3)
    AudioDub(v,a)
    
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    crop( 2, 0, -2, 0)
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    
    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    __t0 ++ __t1 ++ __t2 ++ __t3 
    
    __film = last
    __t0 = __film.trim(0, 0)
    Insert=Import("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 2\VTS_01_1 - Copy.avs")
    __t0 ++ Insert
    Last edited by killerteengohan; 12th Jul 2018 at 17:08.
    Quote Quote  
  7. Originally Posted by killerteengohan View Post
    ffaudiosource does not seem to be working with .ac3 though.
    Works for me.
    Quote Quote  
  8. Try using AviSource() instead if import().
    Quote Quote  
  9. Originally Posted by killerteengohan View Post
    I specified audio and video in the second script and added this to the bottom of the first script, but the audio will not encode and connect. The video will not load either, only the second episode shows and the first does not appear at all. Am I doing something wrong?


    Code:
    a = nicac3source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3")
    v = DGDecode_mpeg2source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1.d2v", info=3)
    AudioDub(v,a)
    
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    crop( 2, 0, -2, 0)
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    
    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    __t0 ++ __t1 ++ __t2 ++ __t3 
    
    __film = last
    __t0 = __film.trim(0, 0)
    Insert=Import("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 2\VTS_01_1 - Copy.avs")
    __t0 ++ Insert


    I guess it was just how I ended the script at the bottom.

    I changed it to this and it works fine.

    __film = last
    Insert=Import("C:\Users\User\Desktop\Encoding\Wolv erine\DVD\Episode 2\VTS_01_1 - Copy.avs")
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    __t0 ++ __t1 ++ __t2 ++ __t3 ++ Insert
    Quote Quote  
  10. Originally Posted by jagabo View Post
    Try using AviSource() instead if import().
    I'm not working with a source that's in AVI Format, will that work? I'll try it asap, I cannot right this minute.

    Even if it doesn't, I got nicac3audio to work with the .ac3 files.
    Quote Quote  
  11. Here is the Megui log for the audio that failed with ffaudiosource and then the one that worked with nicac3audio. Problem is, I want it to work open with ffaudiosource, not nicaudio. I just cant get it to work. Do I need a .dll file for ffaudiosource?



    -[Information] Log for job3 (audio, VTS_01_1 - Copy.avs -> VTS_01_1 - Copy.mp4)
    --[Information] [7/12/2018 3:34:35 PM] Started handling job
    --[Information] [7/12/2018 3:34:35 PM] Preprocessing
    --[Information] [7/12/2018 3:34:35 PM] Encoding started
    -[NoImage] Script error: there is no function named "ffaudiosource"
    -[NoImage] (C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs, line 4)
    -[Error] [7/12/2018 3:34:35 PM] Exception message
    -[NoImage] at MeGUI.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
    -[NoImage] at MeGUI.AvsFile..ctor(String script, Boolean parse)
    -[NoImage] at MeGUI.MediaInfoFile.GetSourceInformation(String file, LogItem oLog)
    -[Error] [7/12/2018 3:34:35 PM] Stacktrace
    -[Error] [7/12/2018 3:34:35 PM] Inner exception: null
    --[Error] [7/12/2018 3:34:35 PM] MediaInfo - Unhandled Error
    --[Information] [7/12/2018 3:34:35 PM] Trying to open the file with FFAudioSource()
    --[Information] [7/12/2018 3:34:36 PM] Failed opening the file with FFAudioSource(). FFAudioSource: Can't open 'C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs'
    --[Information] [7/12/2018 3:34:36 PM] Trying to open the file with NicAudio
    --[Information] [7/12/2018 3:34:36 PM] Failed opening the file with NicAudio(). Script error: there is no function named "ffaudiosource"
    (C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs, line 4)
    --[Information] [7/12/2018 3:34:36 PM] Trying to open the file with DirectShowSource()
    --[Information] [7/12/2018 3:34:36 PM] Failed opening the file with DirectShowSource()
    -[Error] [7/12/2018 3:34:36 PM] Exception message: Input file cannot be opened: C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 - Copy.avs
    -[NoImage] at MeGUI.AviSynthAudioEncoder.createAviSynthScript()
    -[NoImage] at MeGUI.AviSynthAudioEncoder.encode()
    -[Error] [7/12/2018 3:34:36 PM] Stacktrace
    -[Error] [7/12/2018 3:34:36 PM] Inner exception: null
    --[Error] [7/12/2018 3:34:36 PM] An error occurred
    --[Information] [7/12/2018 3:34:36 PM] Job completed


    -[Information] Log for job3 (audio, VTS_01_1 - Copy.avs -> VTS_01_1 - Copy.mp4)
    --[Information] [7/12/2018 3:36:13 PM] Started handling job
    --[Information] [7/12/2018 3:36:13 PM] Preprocessing
    --[Information] [7/12/2018 3:36:13 PM] Encoding started
    --[Information] [7/12/2018 3:36:14 PM] MediaInfo
    ---[Information] File: C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 - Copy.avs
    -[Information] Format: AVS
    -[Information] FormatString: AviSynth Script
    -[Information] FileSize: 702
    -[Information] PlayTime: 00:23:30.4920000
    ---[Information] General
    -[Information] ID: 0
    -[Information] StreamOrder:
    -[Information] Width: 848
    -[Information] Height: 480
    -[Information] FrameCount: 33818
    -[Information] FrameRate: 23.976023976024
    -[Information] ScanType: Progressive
    -[Information] Codec: AVS Video
    -[Information] CodecString: AVS
    -[Information] Format: AVS
    -[Information] AspectRatio: 1.76666667
    -[Information] AspectRatioString:
    -[Information] Delay: 0
    -[Information] Title:
    -[Information] Language:
    -[Information] LanguageString:
    ---[Information] Video
    -[Information] ID: 0
    -[Information] StreamOrder:
    -[Information] Format: AVS
    -[Information] FormatProfile:
    -[Information] FormatSettingsSBR:
    -[Information] FormatSettingsPS:
    -[Information] SamplingRate: 48000
    -[Information] SamplingRateString: 48000
    -[Information] Channels: 6
    -[Information] ChannelsString: 6 channels
    -[Information] ChannelPositionsString2:
    -[Information] BitRateMode: CBR
    -[Information] Delay: 0
    -[Information] Title:
    -[Information] Language:
    -[Information] LanguageString:
    ---[Information] Audio
    --[Information] [7/12/2018 3:36:14 PM] Trying to open the file with FFAudioSource()
    --[Information] [7/12/2018 3:36:15 PM] Failed opening the file with FFAudioSource(). FFAudioSource: Can't open 'C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs'
    --[Information] [7/12/2018 3:36:15 PM] Trying to open the file with NicAudio
    --[Information] [7/12/2018 3:36:15 PM] Successfully opened the file with NicAudio
    -[NoImage] Import("C:\Users\User\Desktop\Encoding\Wolverine\D VD\Episode 1\VTS_01_1 - Copy.avs")
    -[NoImage] return last
    --[Information] [7/12/2018 3:36:15 PM] Avisynth script
    --[Information] [7/12/2018 3:36:15 PM] Commandline used: -ignorelength -lc -cbr 320000 -if - -of "{0}"
    --[Information] [7/12/2018 3:36:15 PM] Avisynth script environment opened
    --[Information] [7/12/2018 3:36:16 PM] Script loaded
    --[Information] Output Decoder
    ---[Information] [7/12/2018 3:36:16 PM] Channels: 6
    ---[Information] [7/12/2018 3:36:16 PM] Bits per sample: 32
    ---[Information] [7/12/2018 3:36:16 PM] Sample rate: 48000
    --[Information] [7/12/2018 3:36:16 PM] Commandline: C:\Program Files (x86)\MeGui\neroAacEnc.exe -ignorelength -lc -cbr 320000 -if - -of "C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.mp4"
    --[Information] [7/12/2018 3:36:16 PM] Encoder process started
    -[NoImage] ************************************************** ***********
    -[NoImage] * *
    -[NoImage] * Nero AAC Encoder *
    -[NoImage] * Copyright 2009 Nero AG *
    -[NoImage] * All Rights Reserved Worldwide *
    -[NoImage] * *
    -[NoImage] * Package build date: Feb 18 2010 *
    -[NoImage] * Package version: 1.5.4.0 *
    -[NoImage] * *
    -[NoImage] * See -help for a complete list of available parameters. *
    -[NoImage] * *
    -[NoImage] ************************************************** ***********
    --[Information] [7/12/2018 3:37:41 PM] Output from encoder via stderr
    --[Information] [7/12/2018 3:37:41 PM] MediaInfo
    ---[Information] File: C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 - Copy.mp4
    -[Information] Format: MPEG-4
    -[Information] FormatString: MPEG-4
    -[Information] FileSize: 56630591
    -[Information] PlayTime: 00:23:30.560
    ---[Information] General
    -[Information] ID: 1
    -[Information] StreamOrder:
    -[Information] Format: AAC
    -[Information] FormatProfile: LC
    -[Information] FormatSettingsSBR: No (Explicit)
    -[Information] FormatSettingsPS:
    -[Information] SamplingRate: 48000
    -[Information] SamplingRateString: 48.0 KHz
    -[Information] Channels: 6
    -[Information] ChannelsString: 6 channels
    -[Information] ChannelPositionsString2: 3/2/0.1
    -[Information] BitRateMode: VBR
    -[Information] Delay:
    -[Information] Title:
    -[Information] Language:
    -[Information] LanguageString:
    ---[Information] Audio
    --[Information] [7/12/2018 3:37:41 PM] Postprocessing
    ---[Information] Deleting intermediate files
    --[Information] [7/12/2018 3:37:41 PM] Job completed
    Quote Quote  
  12. Nope avisource is not working either. The audio still cannot be opened with ffaudiosource




    -[Information] Log for job5 (audio, VTS_01_1 - Copy.avs -> VTS_01_1 - Copy_new.mp4)
    --[Information] [7/12/2018 6:34:19 PM] Started handling job
    --[Information] [7/12/2018 6:34:19 PM] Preprocessing
    --[Information] [7/12/2018 6:34:19 PM] Encoding started
    -[NoImage] Script error: there is no function named "ffaudiosource"
    -[NoImage] (C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs, line 5)
    -[Error] [7/12/2018 6:34:20 PM] Exception message
    -[NoImage] at MeGUI.AviSynthClip..ctor(String func, String arg, AviSynthColorspace forceColorspace, AviSynthScriptEnvironment env)
    -[NoImage] at MeGUI.AvsFile..ctor(String script, Boolean parse)
    -[NoImage] at MeGUI.MediaInfoFile.GetSourceInformation(String file, LogItem oLog)
    -[Error] [7/12/2018 6:34:20 PM] Stacktrace
    -[Error] [7/12/2018 6:34:20 PM] Inner exception: null
    --[Error] [7/12/2018 6:34:20 PM] MediaInfo - Unhandled Error
    --[Information] [7/12/2018 6:34:20 PM] Trying to open the file with FFAudioSource()
    --[Information] [7/12/2018 6:34:20 PM] Failed opening the file with FFAudioSource(). FFAudioSource: Can't open 'C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs'
    --[Information] [7/12/2018 6:34:20 PM] Trying to open the file with NicAudio
    --[Information] [7/12/2018 6:34:20 PM] Failed opening the file with NicAudio(). Script error: there is no function named "ffaudiosource"
    (C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs, line 5)
    --[Information] [7/12/2018 6:34:20 PM] Trying to open the file with DirectShowSource()
    --[Information] [7/12/2018 6:34:20 PM] Failed opening the file with DirectShowSource()
    -[Error] [7/12/2018 6:34:20 PM] Exception message: Input file cannot be opened: C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 - Copy.avs
    -[NoImage] at MeGUI.AviSynthAudioEncoder.createAviSynthScript()
    -[NoImage] at MeGUI.AviSynthAudioEncoder.encode()
    -[Error] [7/12/2018 6:34:20 PM] Stacktrace
    -[Error] [7/12/2018 6:34:20 PM] Inner exception: null
    --[Error] [7/12/2018 6:34:20 PM] An error occurred
    --[Information] [7/12/2018 6:34:20 PM] Job completed
    Last edited by killerteengohan; 12th Jul 2018 at 17:59.
    Quote Quote  
  13. I got ahold of ffms2.dll and added to plugins folder and ffaudiosource function now exists and the audio encodes but it is using NicAudio and not ffaudiosource. It still fails to run through megui's ffaudiosource no matter what.



    -[Information] Log for job5 (audio, VTS_01_1 - Copy.avs -> VTS_01_1 - Copy_new.mp4)
    --[Information] [7/12/2018 6:38:42 PM] Started handling job
    --[Information] [7/12/2018 6:38:42 PM] Preprocessing
    --[Information] [7/12/2018 6:38:42 PM] Encoding started
    --[Information] [7/12/2018 6:38:43 PM] MediaInfo
    ---[Information] File: C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 - Copy.avs
    -[Information] Format: AVS
    -[Information] FormatString: AviSynth Script
    -[Information] FileSize: 804
    -[Information] PlayTime: 00:47:03.1540000
    ---[Information] General
    -[Information] ID: 0
    -[Information] StreamOrder:
    -[Information] Width: 848
    -[Information] Height: 480
    -[Information] FrameCount: 67688
    -[Information] FrameRate: 23.976023976024
    -[Information] ScanType: Progressive
    -[Information] Codec: AVS Video
    -[Information] CodecString: AVS
    -[Information] Format: AVS
    -[Information] AspectRatio: 1.76666667
    -[Information] AspectRatioString:
    -[Information] Delay: 0
    -[Information] Title:
    -[Information] Language:
    -[Information] LanguageString:
    ---[Information] Video
    -[Information] ID: 0
    -[Information] StreamOrder:
    -[Information] Format: AVS
    -[Information] FormatProfile:
    -[Information] FormatSettingsSBR:
    -[Information] FormatSettingsPS:
    -[Information] SamplingRate: 48000
    -[Information] SamplingRateString: 48000
    -[Information] Channels: 6
    -[Information] ChannelsString: 6 channels
    -[Information] ChannelPositionsString2:
    -[Information] BitRateMode: CBR
    -[Information] Delay: 0
    -[Information] Title:
    -[Information] Language:
    -[Information] LanguageString:
    ---[Information] Audio
    --[Information] [7/12/2018 6:38:43 PM] Trying to open the file with FFAudioSource()
    --[Information] [7/12/2018 6:38:43 PM] Failed opening the file with FFAudioSource(). FFAudioSource: Can't open 'C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy.avs'
    --[Information] [7/12/2018 6:38:43 PM] Trying to open the file with NicAudio
    --[Information] [7/12/2018 6:38:44 PM] Successfully opened the file with NicAudio
    -[NoImage] Import("C:\Users\User\Desktop\Encoding\Wolverine\D VD\Episode 1\VTS_01_1 - Copy.avs")
    -[NoImage] return last
    --[Information] [7/12/2018 6:38:44 PM] Avisynth script
    --[Information] [7/12/2018 6:38:44 PM] Commandline used: -ignorelength -lc -cbr 320000 -if - -of "{0}"
    --[Information] [7/12/2018 6:38:44 PM] Avisynth script environment opened
    --[Information] [7/12/2018 6:38:44 PM] Script loaded
    --[Information] Output Decoder
    ---[Information] [7/12/2018 6:38:44 PM] Channels: 6
    ---[Information] [7/12/2018 6:38:44 PM] Bits per sample: 32
    ---[Information] [7/12/2018 6:38:44 PM] Sample rate: 48000
    --[Information] [7/12/2018 6:38:44 PM] Commandline: C:\Program Files (x86)\MeGui\neroAacEnc.exe -ignorelength -lc -cbr 320000 -if - -of "C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 - Copy_new.mp4"
    --[Information] [7/12/2018 6:38:44 PM] Encoder process started
    --[Information] [7/12/2018 6:40:39 PM] Standard output stream
    -[NoImage] avs [info]: 1920x1080p 1:1 @ 24000/1001 fps (cfr)
    -[NoImage] x264 [warning]: VBV maxrate specified, but no bufsize, ignored
    -[NoImage] x264 [info]: using SAR=1/1
    -[NoImage] x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX AVX2 FMA3 BMI1 BMI2
    -[NoImage] x264 [info]: profile Main, level 4.1
    -[NoImage]
    -[NoImage] x264 [info]: frame I:1601 Avg QP:12.10 size:187019
    -[NoImage] x264 [info]: frame P:74296 Avg QP:15.19 size: 91075
    -[NoImage] x264 [info]: frame B:106163 Avg QP:16.27 size: 41825
    -[NoImage] x264 [info]: consecutive B-frames: 16.7% 12.4% 12.9% 58.1%
    -[NoImage] x264 [info]: mb I I16..4: 28.5% 0.0% 71.5%
    -[NoImage] x264 [info]: mb P I16..4: 45.8% 0.0% 0.0% P16..4: 45.9% 0.0% 0.0% 0.0% 0.0% skip: 8.3%
    -[NoImage] x264 [info]: mb B I16..4: 10.4% 0.0% 0.0% B16..8: 45.3% 0.0% 0.0% direct:18.7% skip:25.6% L0:40.2% L1:36.2% BI:23.6%
    -[NoImage] x264 [info]: final ratefactor: 15.20
    -[NoImage] x264 [info]: direct mvs spatial:99.5% temporal:0.5%
    -[NoImage] x264 [info]: coded y,uvDC,uvAC intra: 75.4% 57.4% 30.0% inter: 39.2% 24.3% 6.2%
    -[NoImage] x264 [info]: i16 v,h,dc,p: 30% 27% 27% 16%
    -[NoImage] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 11% 7% 8% 7% 7% 7% 6%
    -[NoImage] x264 [info]: i8c dc,h,v,p: 59% 19% 18% 4%
    -[NoImage] x264 [info]: Weighted P-Frames: Y:2.7% UV:1.7%
    -[NoImage] x264 [info]: kb/s:12122.26
    -[NoImage] encoded 182060 frames, 24.36 fps, 12122.26 kb/s
    --[Information] [7/12/2018 6:40:39 PM] Standard error stream
    --[Information] [7/12/2018 6:40:39 PM] Postprocessing
    ---[Information] Deleting intermediate files
    --[Information] [7/12/2018 6:40:40 PM] Job completed
    Last edited by killerteengohan; 12th Jul 2018 at 17:59.
    Quote Quote  
  14. When I try to open the .ac3 audio file directly with the GUI and not using a script it encodes just fine with ffaudiosource as you can see here.


    -[Information] Log for job6 (audio, VTS_01_1 T81 3_2ch 384Kbps DELAY 0ms.ac3 -> VTS_01_1 T81 3_2ch 384Kbps DELAY 0ms_new.mp4)
    --[Information] [7/12/2018 6:50:06 PM] Started handling job
    --[Information] [7/12/2018 6:50:06 PM] Preprocessing
    --[Information] [7/12/2018 6:50:06 PM] Encoding started
    --[Information] [7/12/2018 6:50:06 PM] MediaInfo
    ---[Information] File: C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 T81 3_2ch 384Kbps DELAY 0ms.ac3
    -[Information] Format: AC-3
    -[Information] FormatString: AC-3
    -[Information] FileSize: 68160000
    -[Information] PlayTime: 00:23:40.000
    ---[Information] General
    -[Information] ID:
    -[Information] StreamOrder:
    -[Information] Format: AC-3
    -[Information] FormatProfile:
    -[Information] FormatSettingsSBR:
    -[Information] FormatSettingsPS:
    -[Information] SamplingRate: 48000
    -[Information] SamplingRateString: 48.0 KHz
    -[Information] Channels: 6
    -[Information] ChannelsString: 6 channels
    -[Information] ChannelPositionsString2: 3/2/0.1
    -[Information] BitRateMode: CBR
    -[Information] Delay:
    -[Information] Title:
    -[Information] Language:
    -[Information] LanguageString:
    ---[Information] Audio
    --[Information] [7/12/2018 6:50:06 PM] Trying to open the file with FFAudioSource()
    --[Information] [7/12/2018 6:50:12 PM] Successfully opened the file with FFAudioSource()
    -[NoImage] LoadPlugin("C:\Program Files (x86)\MeGui\tools\ffms\ffms2.dll")
    -[NoImage] FFAudioSource("C:\Users\User\Desktop\Encoding\Wolv erine\DVD\Episode 1\VTS_01_1 T81 3_2ch 384Kbps DELAY 0ms.ac3")
    -[NoImage] return last
    --[Information] [7/12/2018 6:50:12 PM] Avisynth script
    --[Information] [7/12/2018 6:50:12 PM] Commandline used: -ignorelength -lc -cbr 320000 -if - -of "{0}"
    --[Information] [7/12/2018 6:50:12 PM] Avisynth script environment opened
    --[Information] [7/12/2018 6:50:13 PM] Script loaded
    --[Information] Output Decoder
    ---[Information] [7/12/2018 6:50:13 PM] Channels: 6
    ---[Information] [7/12/2018 6:50:13 PM] Bits per sample: 16
    ---[Information] [7/12/2018 6:50:13 PM] Sample rate: 48000
    --[Information] [7/12/2018 6:50:13 PM] Commandline: C:\Program Files (x86)\MeGui\neroAacEnc.exe -ignorelength -lc -cbr 320000 -if - -of "C:\Users\User\Desktop\Encoding\Wolverine\DVD\Epis ode 1\VTS_01_1 T81 3_2ch 384Kbps DELAY 0ms_new.mp4"
    --[Information] [7/12/2018 6:50:13 PM] Encoder process started
    -[NoImage] ************************************************** ***********
    -[NoImage] * *
    -[NoImage] * Nero AAC Encoder *
    -[NoImage] * Copyright 2009 Nero AG *
    -[NoImage] * All Rights Reserved Worldwide *
    -[NoImage] * *
    -[NoImage] * Package build date: Feb 18 2010 *
    -[NoImage] * Package version: 1.5.4.0 *
    -[NoImage] * *
    -[NoImage] * See -help for a complete list of available parameters. *
    -[NoImage] * *
    -[NoImage] ************************************************** ***********
    --[Information] [7/12/2018 6:52:40 PM] Output from encoder via stderr
    --[Information] [7/12/2018 6:52:40 PM] MediaInfo
    ---[Information] File: C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 T81 3_2ch 384Kbps DELAY 0ms_new.mp4
    -[Information] Format: MPEG-4
    -[Information] FormatString: MPEG-4
    -[Information] FileSize: 57012572
    -[Information] PlayTime: 00:23:40.075
    ---[Information] General
    -[Information] ID: 1
    -[Information] StreamOrder:
    -[Information] Format: AAC
    -[Information] FormatProfile: LC
    -[Information] FormatSettingsSBR: No (Explicit)
    -[Information] FormatSettingsPS:
    -[Information] SamplingRate: 48000
    -[Information] SamplingRateString: 48.0 KHz
    -[Information] Channels: 6
    -[Information] ChannelsString: 6 channels
    -[Information] ChannelPositionsString2: 3/2/0.1
    -[Information] BitRateMode: VBR
    -[Information] Delay:
    -[Information] Title:
    -[Information] Language:
    -[Information] LanguageString:
    ---[Information] Audio
    --[Information] [7/12/2018 6:52:40 PM] Postprocessing
    -[Information] [7/12/2018 6:52:40 PM] Successfully deleted C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episo de 1\VTS_01_1 T81 3_2ch 384Kbps DELAY 0ms.ac3.ffindex
    ---[Information] Deleting intermediate files
    --[Information] [7/12/2018 6:52:40 PM] Job completed



    Its when I try to encode it with the .avs file and call ffaudiosource or nicac3audio in the script that it does not work or only works with nicaudio in megui.
    Quote Quote  
  15. Would it help if I shared the scripts used?



    Script #1


    Code:
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgindex\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\avisynth_plugin\ColorMatrix.dll")
    
    a = ffaudiosource("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3")
    v = DGDecode_mpeg2source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1.d2v", info=3)
    AudioDub(v,a)
    
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    crop( 2, 0, -2, 0)
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    
    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    Insert=Import("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 2\VTS_01_1 - Copy.avs")
    __t0 ++ __t1 ++ __t2 ++ __t3 ++ Insert


    Script #2 (Imported)


    Code:
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgindex\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\avisynth_plugin\ColorMatrix.dll")
    
    a = ffaudiosource("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 2\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3")
    v = DGDecode_mpeg2source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 2\VTS_01_1.d2v", info=3)
    AudioDub(v,a)
    
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    crop( 2, 0, -2, 0)
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    
    __film = last
    __t0 = __film.trim(24, 1475)
    __t1 = __film.trim(1547, 13941)
    __t2 = __film.trim(14014, 33266)
    __t3 = __film.trim(33339, 34082)
    __t0 ++ __t1 ++ __t2 ++ __t3
    Quote Quote  
  16. It looks to me like it should work. Try deleting the ffindex files and loading the script again.
    Quote Quote  
  17. I guess ffaudiosource is incapable of opening a .avs file. It works fine with the actual .ac3 file directly loaded into megui, but when I try to open a .avs file with all the information in it, ffaudiosource fails to open it in MeGui.

    Means I am out of luck from the way things look. I guess I will just have to settle for nicaudio since that works. nicaudio is not a bad thing to use is it? audio sounds fine to me when made with nicaudio. is there really even a downside to using nicaudio?
    Quote Quote  
  18. I don't see your script using ffaudiosource to open an avs script.
    Quote Quote  
  19. My script is not opening it with ffaudiosource, MeGui is. In the audio encoder of MeGui where you browse for audio input files I am selecting the episode 1 .avs file instead of the .ac3 audio file, because I need it to combine the audio files from episode 1 and episode 2 in the exact places I trimmed the video. That's why I made the script like I did.

    This works but only with nicaudio. ffaudiosource always fails to open it and claims it cannot open .avs file in the log
    Last edited by killerteengohan; 12th Jul 2018 at 20:00.
    Quote Quote  
  20. I would be content with nicaudio if it did not give much different audio results. When I compare the audio waves, nicaudio looks quite different and with a higher volume that has clipping in some parts in the different channels.


    Top = ffaudiosource
    Middle = nicaudio
    Bottom = AC3 Source

    Image
    [Attachment 46063 - Click to enlarge]
    Quote Quote  
  21. Why don't you just open the script in VirtualDub, export the audio as a WAV file, then use that WAV file in Megui?
    Quote Quote  
  22. because .WAV will turn it into multiple separate mono audio channels?
    Quote Quote  
  23. I tried an updated megui instead of the one I been using. It seems to load and do the audio, but for some reason its putting episode 2 audio first and episode 1 audio second so their playing backwards. It plays episodes 2 audio then episodes 1 right after.

    Why are they reversed in the output?

    Its doing the same thing with the video. I just noticed that.
    Quote Quote  
  24. I take that back, its not playing episode 2 then one. Its encoding and playing episode 2 twice in a row. its not even acknowledging episode 1 even though its in the script I am loading.
    Quote Quote  
  25. I have no idea why the hell this makes any difference but all I did was swap the insert line in the script to the top and its working now.


    Script #1


    Code:
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgindex\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\avisynth_plugin\ColorMatrix.dll")
    
    a = ffaudiosource("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3")
    v = DGDecode_mpeg2source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1.d2v", info=3)
    AudioDub(v,a)
    
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    crop( 2, 0, -2, 0)
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    
    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    Insert=Import("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 2\VTS_01_1 - Copy.avs")
    __t0 ++ __t1 ++ __t2 ++ __t3 ++ Insert

    Script #1 (Fixed)


    Code:
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgindex\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\avisynth_plugin\ColorMatrix.dll")
    Insert=Import("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 2\VTS_01_1 - Copy.avs")
    
    a = ffaudiosource("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3")
    v = DGDecode_mpeg2source("C:\Users\User\Desktop\Encoding\Wolverine\DVD\Episode 1\VTS_01_1.d2v", info=3)
    AudioDub(v,a)
    
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    crop( 2, 0, -2, 0)
    LanczosResize(848,480) # Lanczos (Sharp)
    #denoise
    
    __film = last
    __t0 = __film.trim(0, 5333)
    __t1 = __film.trim(5408, 16939)
    __t2 = __film.trim(17004, 33211)
    __t3 = __film.trim(33284, 34027)
    __t0 ++ __t1 ++ __t2 ++ __t3 ++ Insert
    Quote Quote  
  26. Yeah it looks like switching to the updated megui fixed my problem loading the .avs file with ffaudiosource. It works perfectly now after making that tweak to the script and loading in most recent megui version.

    Thanks for taking so much time to assist with this. I never thought it would have been this tedious, but I appreciate it.
    Quote Quote  
  27. Odd fix. You could do the processing of both videos in one script.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!