VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Hi. I have two videos, Alpha and Bravo, and I've created an avisynth script for each. I want to make a third video, Charlie, using the script: 'Import(Alphascript ++ Bravoscript)'.

    I've managed to fix the errors that arose because of the different Dimensions and FrameRates but I'm stuck at the error: 'Splice: The number of audio channels doesn't match'.

    For Alpha, mediainfo says:
    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : mp4a-40-2
    Duration : 23 min 22 s
    Bit rate mode : Variable
    Bit rate : 38.0 kb/s
    Maximum bit rate : 96.0 kb/s
    Channel(s) : 2 channels
    Channel(s)_Original : 1 channel
    Channel positions : Front: C
    Sampling rate : 22.05 kHz
    Frame rate : 21.533 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 6.35 MiB (3%)
    Encoded date : UTC 1970-01-01 00:00:00
    Tagged date : UTC 2011-12-06 02:51:01

    Other #1
    ID : 65536
    Type : Hint
    Format : RTP
    Codec ID : rtp
    Duration : 23 min 21 s
    Encoded date : UTC 2011-12-06 02:50:59
    Tagged date : UTC 2011-12-06 02:51:01

    Other #2
    ID : 65537
    Type : Hint
    Format : RTP
    Codec ID : rtp
    Duration : 23 min 22 s
    Encoded date : UTC 2011-12-06 02:51:01
    Tagged date : UTC 2011-12-06 02:51:01
    Bit rate mode : VBR

    And for Bravo:
    Audio
    ID : 1
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : mp4a-40-2
    Duration : 22 min 25 s
    Bit rate mode : Variable
    Bit rate : 160 kb/s
    Maximum bit rate : 576 kb/s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 kHz
    Frame rate : 46.875 FPS (1024 SPF)
    Compression mode : Lossy
    Stream size : 25.6 MiB (4%)

    The bulk of Charlie will be from Bravo so how do I script Alpha to give it the same audio properties as Bravo? At present, Alphascript looks like this:
    Code:
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    LoadPlugin("E:\Free\MeGUI\tools\lsmash\LSMASHSource.dll")
    a=LSMASHVideoSource("E:\Alpha.mp4").AssumeFPS(30000,1001)
    b=LSMASHaudioSource("E:\Alpha.mp4")
    audiodub(a,b)
    Crop(102, 8, -100, -8)
    trim(0,82).IResize(720,480)
    Many thanks if you can help. Also, can anyone explain those two 'Other' audio tracks which are showing up as I can only 'see' the main track?
    Quote Quote  
  2. See ConvertToMono, MergeChannels.
    Last edited by jagabo; 5th Jun 2018 at 07:51.
    Quote Quote  
  3. Thanks for the hint, jagabo. Alphascript is now:
    Code:
    a=LSMASHVideoSource("E:\alpha.mp4").AssumeFPS(30000,1001)
    b=LSMASHaudioSource("E:\alpha.mp4").converttomono().resampleaudio(48000)
    audiodub(a,b)
    Crop(102, 8, -100, -8)
    trim(0,82).IResize(720,480)
    and Bravoscript is:
    Code:
    a=LSMASHVideoSource("E:\bravo.mp4")
    b=LSMASHaudioSource("E:\bravo.mp4").converttomono()
    audiodub(a,b)
    trim(0,300)
    and 'Import Alpha++Bravo' now gives me a playing vid (with 1 channel audio).

    You'll note that I've not made use of your other hint, MergeChannels. Could I have done this a better way? Thanks again.
    Quote Quote  
  4. If most of your video has a stereo track wouldn't you want to keep that and convert the other clips mono track to stereo? MergeChannels(b,b) will put the mono audio track on both the left and right channels (ConvertToStereo used to do that but it was eliminated some time back). Or just create your own ConverToStereo function and call it in your script:

    Code:
    function ConvertToStereo(clip a)
    {
        MergeChannels(a,a)
    }
    Quote Quote  
  5. Believe it or not, I did try 'ConvertToStereo' on the basis that it should exist given there's a 'ConvertToMono'. However, after getting the 'no function called ConvertToStereo' error, I didn't pursue it further. Your function works fine, though, so thanks (again).
    Quote Quote  
  6. There used to be a ConvertToStereo() but it was removed at some point (2.58?). Probably because the MergeChannels() equivalent is so simple.
    Quote Quote  
  7. Currently, Bravoscript is as simple as it gets, nothing fancy has been done to it. I need Alpha to be the same as Bravo which is why Alphascript is:
    Code:
    function ConvertToStereo(clip a)
    {
        MergeChannels(a,a)
    }
    a=LSMASHVideoSource("E:\alpha.mp4").AssumeFPS(30000,1001)
    b=LSMASHaudioSource("E:\alpha.mp4").converttostereo().resampleaudio(48000)
    audiodub(a,b)
    Crop(102, 8, -100, -8)
    trim(0,82).IResize(720,480)
    I've tried to make this cleaner by taking out the 'converttostereo' function and using only mergechannels. All my attempts have failed. Can it be done and, if so, how would such a script look? Thank you.
    Last edited by pooksahib; 5th Jun 2018 at 15:05.
    Quote Quote  
  8. As far as I know you can't pipe the mono source directly to MergeChannels() to create stereo. There's no way to tell it to repeat the single mono track to create stereo if you do that.
    Quote Quote  
  9. Got it!
    Code:
    a=LSMASHVideoSource("E:\alpha.mp4").AssumeFPS(30000,1001)
    b=LSMASHaudioSource("E:\alpha.mp4").resampleaudio(48000)
    c=mergechannels(b,b)
    audiodub(a,c)
    Quote Quote  



Similar Threads

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