I have a blu-ray source I am trying to encode, but its been split up into multiple parts. I have combined the video easily and that comes out just fine, I am having trouble with the audio.
Normally I just append these together with mkvmerge/mkvtoolnix, but it will not append correctly and goes out of sync as the video goes on. Most likely the audio tracks are not as long as the individual video's or are slightly shorter than the video length.
I figured encoding with ++ and avisynth would be my best bet since supposedly it will fill in the empty gaps if there are any. I am having a problem with it though. I dont know for sure how to do this. Can anyone help with how I would write the script for this?
Here is what I have so far for the video.
Code:Insert2=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00055\00055.avs") Insert3=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00053\00053.avs") Insert4=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00056\00056.avs") Insert5=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00054\00054.avs") Insert6=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00057\00057.avs") Insert7=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00058\00058.avs") Insert8=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00059\00059.avs") Insert9=Import("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00060\00060.avs") LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgavcindex\DGAVCDecode.dll") AVCSource("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00052\00052.dga") __film = last __t0 = __film.trim(0, 0) __t0 ++ Insert2 ++ Insert3 ++ Insert4 ++ Insert5 ++ Insert6 ++ Insert7 ++ Insert8 ++ Insert9
What would I add and how would I add it if I wanted to encode the audio via avisynth script as well?
I used to use this when doing only one file, but this is multiple and connecting multiple, so it wont work for me in this situation.
Code:a = ffaudiosource("C:\Users\???\Desktop\Encoding\Video\DVD\Episode 1\VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3") v = DGDecode_mpeg2source("C:\Users\???\Desktop\Encoding\Video\DVD\Episode 1\VTS_01_1.d2v", info=3) AudioDub(v,a)
All of the audio files are in each different folder with the video files I loaded in the script, and their names are all exactly the same. T2_Audio - English.flac I just thought I would mention that in case the names of the audio files were needed.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 15 of 15
Thread
-
Last edited by killerteengohan; 14th Mar 2021 at 18:08.
-
How would I do that exactly?
Here is the script for insert 2
Code:LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgavcindex\DGAVCDecode.dll") AVCSource("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00055\00055.dga")
-
The same way you include the audio in your other example.
Code:LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgavcindex\DGAVCDecode.dll") a = ffaudiosource("C:\path_to_audio\filename.ext") v = AVCSource("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00055\00055.dga") AudioDub(v,a)
-
Wow that actually worked. I didn't even have to tell it how to connect to the others. I thought I was going to have to go into each individual script, import the next piece, and attach it to the current piece. Then do this one by one, until each one was connected to the next one, and then a final script would join them all together.
-
Is there any special way to connect a 2 channel audio to a 6 channel audio without downmuxing the 6 channel into 2 channel?
-
Here's a simple AviSynth funtion to convert 2 channels to 6 channels by adding four silent channels to the existing stereo pair:
Code:function a2to6(clip v) { silent = v.Amplify(0.0) MergeChannels(v, silent, silent) # 5.1 order FL FR FC LFE RL RR }
Code:function a2to6(clip v) { left = v.GetChannel(1) right = v.GetChannel(2) silent = left.ConvertToMono().Amplify(0.0) six = MergeChannels(left, right, silent, silent, silent, silent) # 5.1 order FL FR FC LFE RL RR AudioDub(v,six) }
-
Thanks, I never knew about those options in avisynth. I will play around them some.
Would duplicating the the 2 channels until you have 4 channels, and adding 2 silent ones work as well? That way the L would be FL/RL, and R would be FR/RR and the other 2 would be silent? I'm still trying to figure that one out with setting tinkering in your more descriptive example. -
You will then have extrawide, phantom L & R channels. Not optimal if you want distinct sound sources.
Scott -
It may not sound "better" but If you want to try it :
If you want to try it you could use
Code:function a2to6(clip v) { silent = v.Amplify(0.0) MergeChannels(v, silent, v) # 5.1 order FL FR FC LFE RL RR }
Code:function a2to6(clip v) { left = v.GetChannel(1) right = v.GetChannel(2) silent = left.ConvertToMono().Amplify(0.0) six = MergeChannels(left, right, silent, silent, left, right) # 5.1 order FL FR FC LFE RL RR AudioDub(v,six) }
-
Am I using this wrong? It makes my script break, and say invalid argument to function trim. (For this line) __t0 = __film.trim(25, 2080)
Code:LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgavcindex\DGAVCDecode.dll") a = ffaudiosource("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00052\T2_Audio - English.flac") v = AVCSource("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00052\00052.dga") function a2to6(clip v) { left = v.GetChannel(1) right = v.GetChannel(2) silent = left.ConvertToMono().Amplify(0.0) six = MergeChannels(left, right, silent, silent, silent, silent) # 5.1 order FL FR FC LFE RL RR AudioDub(v,six) } __film = last __t0 = __film.trim(25, 2080) __t0
It works fine when I take out the function a2to6 part of the script and put in AudioDub(v,a) in its place. -
Code:
LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgavcindex\DGAVCDecode.dll") function a2to6(clip v) { left = v.GetChannel(1) right = v.GetChannel(2) silent = left.ConvertToMono().Amplify(0.0) six = MergeChannels(left, right, silent, silent, silent, silent) # 5.1 order FL FR FC LFE RL RR AudioDub(v,six) } a = ffaudiosource("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00052\T2_Audio - English.flac") v = AVCSource("C:\Users\???\Desktop\Encoding\Video\USA\OVA\00052\00052.dga") AudioDub(v,a) a2to6() __film = last __t0 = __film.trim(25, 2080) __t0
-
Do I put that only in the pieces script where the audio for the piece is 2 channels, or do I put that in the final script and it will leave the 6 channel audio's alone?
-
It's just like every other function in AviSynth: it only effects streams to which you apply it.
Code:av1 = WhateverSource().a2to6() av2 = WhateverSource() av1++av2
-
My encoder was using 100% cpu so I only just now got to try this. It seems to have worked perfectly.
Thanks!Last edited by killerteengohan; 20th Mar 2021 at 01:14.
Similar Threads
-
Combining audio and video in avisynth script
By killerteengohan in forum RestorationReplies: 1Last Post: 29th Dec 2018, 10:04 -
Options for combining multiple mp3 files into 1 large file w/o quality loss
By kschwi in forum AudioReplies: 5Last Post: 8th Dec 2018, 07:31 -
Batch combining multiple audio files with same picture to create mp4 files
By MD_89 in forum AudioReplies: 25Last Post: 1st Dec 2018, 22:29 -
Combining multiple Video files and compressing
By unknown in forum Newbie / General discussionsReplies: 10Last Post: 8th Nov 2018, 02:46 -
Combining mkv files (video, audio, subtitles) to create a proper episode...
By Cinderwolf in forum Newbie / General discussionsReplies: 2Last Post: 26th Dec 2017, 21:16