View Full Version : AViSynth questions w/ MeGUI (Trimming & Joining)
BlueToast
18th July 2009, 23:37
I am using MeGUI (made sure everything was up to date) and I generated a *.d2v straight from my two DVDs by selecting the first video file in the VIDEO_TS folder.
1. How would I go about combining two *.avs scripts (specified below)?
Script #1
DGDecode_mpeg2source("D:\Network\Deskto\1984 Montrose (1 of 2)\L1_1-2.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Load_Stdcall_Plugin("C:\Program Files\MeGUI\tools\yadif\yadif.dll")
Yadif(order=1)
#crop
#resize
#denoise
Trim(1379,2817) ++ Trim(18731,20649) ++ Trim(28052,33626) ++ Trim(50619,52657) ++ Trim(62637,66533) ++ Trim(78072,87872) ++ Trim(118621,119221) ++ Trim(153117,160040) ++ Trim(180060,188751) ++ Trim(204815,214076) ++ Trim(255944,285345) ++ Trim(304825,310549)
Script #2
DGDecode_mpeg2source("D:\Network\Deskto\1984 Montrose (2 of 2)\L1_2-2.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Load_Stdcall_Plugin("C:\Program Files\MeGUI\tools\yadif\yadif.dll")
Yadif(order=1)
#crop
#resize
#denoise
Trim(9650,10040) ++ Trim(75734,80230) ++ Trim(89371,97612) ++ Trim(112897,130609) ++ Trim(160040,171518)
2. Note the information in the following picture:
http://www.hlrse.net/Qwerty/L1_1-2.png
http://www.hlrse.net/Qwerty/L1_2-2.png
These are the audio for L1_1-2.d2v and L1_2-2.d2v. How would I go about joining the audio files and applying the trims? I am a little worried about the information in the filenames too, namely the part where it says "DELAY -594ms". I suppose that if I can do this correctly I can just end up re-encoding the audio to an m4a or something, or just mux it together with the video after encoding the video.
3. How do you join audio?
4. How do you trim audio?
Apologies if I have repeat questions. :( I would greatly appreciate any help.
thewebchat
19th July 2009, 00:41
1) Try this:
Load_Stdcall_Plugin("C:\Program Files\MeGUI\tools\yadif\yadif.dll")
DGDecode_mpeg2source("D:\Network\Deskto\1984 Montrose (1 of 2)\L1_1-2.d2v", info=3)
part1 = Trim(1379,2817) ++ Trim(18731,20649) ++ Trim(28052,33626) ++ Trim(50619,52657)
\ ++ Trim(62637,66533) ++ Trim(78072,87872) ++ Trim(118621,119221) ++ Trim(153117,160040)
\ ++ Trim(180060,188751) ++ Trim(204815,214076) ++ Trim(255944,285345) ++ Trim(304825,310549)
DGDecode_mpeg2source("D:\Network\Deskto\1984 Montrose (2 of 2)\L1_2-2.d2v", info=3)
part2 = Trim(9650,10040) ++ Trim(75734,80230) ++ Trim(89371,97612) ++ Trim(112897,130609)
\ ++ Trim(160040,171518)
part1+part2
Yadif(order=1)
2) Why do you have 6 .ac3 files per disc? If you created the d2vs with DGIndex + audio demuxing, you would have only one file.
3) You can concatenate AC-3 streams with MKVToolnix. Open the mkvmerge GUI, drag/drop the first one in, and use "append" for all the rest. You need to remux each .ac3 once to get the delay applied to it before you concatenate. So, say you have two files "blah DELAY10ms.ac3" and "blah2 DELAY 12ms.ac3". Drag/drop "blah DELAY 10ms.ac3" into mkvmerge GUI and it will automatically read the delay from the filename so when you remux it to "blah DELAY 0ms.mka" it will have no delay. Then you do the same for "blah2 DELAY 12ms.ac3" and finally adjoin the two.
4) You can split AC-3 streams with mkvmerge GUI too. Global -> enable splitting -> split by timecodes. Make sure to split the joined MKA from step (3).
Note: if you plan to re-encode the audio, you can skip 3 and 4 and load them into AviSynth. Use FFAudioSource and DelayAudio then AudioDub them before using Trim. Example:
DGDecode_mpeg2source("D:\Network\Deskto\1984 Montrose (1 of 2)\L1_1-2.d2v", info=3)
audio = FFAudioSource("some file DELAY 500ms.ac3").DelayAudio(500)
\ + FFAudioSource("some file2 DELAY 450ms.ac3").DelayAudio(450)
AudioDub(audio,last)
Trim(1379,2817) ++ Trim(18731,20649) ++ Trim(28052,33626) ++ Trim(50619,52657)
\ ++ Trim(62637,66533) ++ Trim(78072,87872) ++ Trim(118621,119221) ++ Trim(153117,160040)
\ ++ Trim(180060,188751) ++ Trim(204815,214076) ++ Trim(255944,285345) ++ Trim(304825,310549)
Note2: Are you sure you want to be using Yadif and not some ivtc filter?
BlueToast
19th July 2009, 05:54
Note2: Are you sure you want to be using Yadif and not some ivtc filter? Recommend one and where can I get it? What is an ivtc filter and how is it different/better than Yadif? :?
Thanks! I greatly appreciate your helpful reply. :)
Also, how would I go about using an image file as a frame with a duration of X seconds and also fades in and does a fade crossover into the frames after?
Inspector.Gadget
19th July 2009, 06:10
If you have MeGUI installed, you already have the pick of the litter among IVTC filters. What does MeGUI's source detector tell you about your source? When you move through the source one frame at a time in the AVS Script Creator, do you see combing on every frame, only two out of every five, or some combination?
[P]ako
19th July 2009, 06:10
As for your fist question you can also create individual *.avs files and then create a third avs calling the other two:
V1 = script1.avs
V2 = script2.avs
final = v1 + v2
return final
m3mbran3
19th July 2009, 06:15
Yadif is for de-interlacing interlaced content and ivtc (inverse telecine) is for resoring the original framerate of the picture. Wiki (http://en.wikipedia.org/wiki/Inverse_telecine#Reverse_telecine_.28a.k.a._IVTC.2Finverse_telecine.29) can explain it better.
Either way, if you load the d2v file in the avs script creator of megui and "analyse" the content it will tell you what needs to be done. If it does need to be IVTC'd then you should have the avs line "tfm(order=1).tdecimate()"
edit: the inspector beat me to it but basically says the same thing.
edit2: out of interest, are there any other methods of IVTC? I have only been using what megui tells me, but that doesn't necessarily mean it is the best way. Although I assume since it is such an elementary operation there are probably not any other ways about it.
kemuri-_9
19th July 2009, 07:38
edit2: out of interest, are there any other methods of IVTC? I have only been using what megui tells me, but that doesn't necessarily mean it is the best way. Although I assume since it is such an elementary operation there are probably not any other ways about it.
a number of people like animeivtc...
and then there's the die-hard masochists who do manual ivtc with say YATTA.
Gavino
19th July 2009, 09:21
ako;1306635']As for your fist question you can also create individual *.avs files and then create a third avs calling the other two:
V1 = script1.avs
V2 = script2.avs
final = v1 + v2
return final
That should be:
V1 = Import("script1.avs")
V2 = Import("script2.avs")
...
thewebchat
19th July 2009, 13:13
Also, how would I go about using an image file as a frame with a duration of X seconds and also fades in and does a fade crossover into the frames after?
ImageSource and FadeIn/FadeOut/Dissolve. These things are in the manual.
thewebchat
19th July 2009, 13:17
edit2: out of interest, are there any other methods of IVTC? I have only been using what megui tells me, but that doesn't necessarily mean it is the best way. Although I assume since it is such an elementary operation there are probably not any other ways about it.
For automated solutions, there's also Decomb which people consider inferior to TIVTC, IT which is some crappy jap filter, AnimuIVTC which is some useless script that does nothing, or just using a motion-adaptive deinterlacer (e.g. TDeint, Yadif).
For manual solutions, you can write overrides for FieldHint, TelecideHints, and TDecimate or you can use a pretty GUI for that (namely: Yatta).
[P]ako
19th July 2009, 20:48
That should be:
V1 = Import("script1.avs")
V2 = Import("script2.avs")
...
Oops, missed that. Now I am mad at myself.
Wilbert
19th July 2009, 20:54
there's also Decomb which people consider inferior to TIVTC, IT which is some crappy jap filter, AnimuIVTC which is some useless script that does nothing
@thewebchat,
You never learn (http://forum.doom9.org/showthread.php?t=147901) do you. Now prove it.
thewebchat
20th July 2009, 00:21
Proven. (http://forum.doom9.org/showthread.php?t=138305)
Now you can stop trolling me about it.
Wilbert
20th July 2009, 18:36
Now you can stop trolling me about it.
You are wasting my time. For the last time point out which post(s) you are referring to.
BlueToast
25th July 2009, 19:10
DGDecode_mpeg2source("D:\Network\Deskto\1984 Montrose (1 of 2)\L1_1-2.d2v", info=3)
audio = FFAudioSource("some file DELAY 500ms.ac3").DelayAudio(500)
\ + FFAudioSource("some file2 DELAY 450ms.ac3").DelayAudio(450)
AudioDub(audio,last)
Trim(1379,2817) ++ Trim(18731,20649) ++ Trim(28052,33626) ++ Trim(50619,52657)
\ ++ Trim(62637,66533) ++ Trim(78072,87872) ++ Trim(118621,119221) ++ Trim(153117,160040)
\ ++ Trim(180060,188751) ++ Trim(204815,214076) ++ Trim(255944,285345) ++ Trim(304825,310549)Ok, so if I do this..
1) How do I process the video? Do I just feed it right into MeGUI on some encoder like x286?
2) How do I process the audio with re-encoding?
3) How do I process the audio without re-encoding?
I have always wondered about questions 2 and 3 because MeGUI doesn't seem to have any feature or tool where you can treat audio as if it were video (but without being video).
4) And what is the "\" in the script I'm quoting?
thewebchat
25th July 2009, 23:28
1) The video returned is standard AviSynth video. You can process it in any encoding application that supports AVS input.
2) The script you quoted contains a audio track associated with the AVS video. I suggest using wavi or avs2wav to pipe to a command-line audio encoder like lame or neroAacEnc. Alternatively, you can open the AVS in VirtualDub and save an actual WAV.
3) Steps 3+4 in my original post explain how to join the separate .ac3 files. You can then mux in the combined AC-3 track using any muxing application like MKVMerge or AviMux-GUI.
4) \ is a line break. It allows you to split a command over multiple lines. For example:
Trim(0,
\ 2300)
is equivalent to Trim(0, 2300)
BlueToast
26th July 2009, 05:27
Ok, my brain is overwhelmed on doing this (I have been working on this all day today trying to do this by myself based on the help I have received here so far, and now I am just overloaded and confused). I really need help. For some reason some of the functions are not working for me like I want them to (I open my *.avs files in MPlayer to preview them). It would be a life saver if someone could help me put this together. :( Due before Wednesday this week.
Project Six
Diagram: http://www.hlrse.net/Qwerty/avs_projectsix.png
http://www.hlrse.net/Qwerty/avs_key.png
All videos were recorded by the same device with the same settings. If any audio re-encoding is necessary, the bitrate I intend to use is 384kbps @ 48Hz. I also intend to use x264 as my encoder. Resolution of videos are 720x480 at a framerate of 29.97. The video bitrate is 4505kbps. This is just some information I thought should be known.
Chapters are:
* 1984 Chicago (1 of 6)
* 1994 Chicago (2 of 6)
* 1994 Sacramento (3 of 6)
* 1995 Los Angeles (4 of 6)
* 1995 Chicago (5 of 6)
* 1997 Sacramento (6 of 6)
intro.png is simply just an image with the name of the chapter in the center of the screen. Manually created one for each chapter through Photoshop.
Each chapter should fade out/in from their appropriate intro.png image.
Each fade should take no more than 3 seconds to complete its effect.
With the exclusion of the time it takes to fade, each intro.png should display for 5 seconds.
All fading should use the color black.
All VTS_0<number>_1.avs script files have the following in common:
DGDecode_mpeg2source("D:\Network\Deskto\<folder>\VIDEO_TS\VTS_0<number>_1.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Load_Stdcall_Plugin("C:\Program Files\MeGUI\tools\yadif\yadif.dll")
Yadif(order=1)
#crop
#resize
#denoise
6 Part Merge.avs
V1 = Import("D:\Network\Deskto\1984 Chicago (1 of 6)\VIDEO_TS\VTS_01_1.avs")
V2 = Import("D:\Network\Deskto\1994 Chicago (2 of 6)\Disc A\VIDEO_TS\VTS_01_1.avs")
V3 = Import("D:\Network\Deskto\1994 Chicago (2 of 6)\Disc B\VIDEO_TS\VTS_01_1.avs")
V4 = Import("D:\Network\Deskto\1994 Sacramento (3 of 6)\VIDEO_TS\VTS_01_1.avs")
V5 = Import("D:\Network\Deskto\1995 Los Angeles (4 of 6)\VIDEO_TS\VTS_01_1.avs")
V6 = Import("D:\Network\Deskto\1995 Chicago (5 of 6)\VIDEO_TS\VTS_01_1.avs")
V7 = Import("D:\Network\Deskto\1997 Sacramento (6 of 6)\VIDEO_TS\VF.avs")
VFat = V1 + V2 + V3 + V4 + V5 + V6 + V7
return VFat
Below is a list of Trims for each chapter (with all the videos joined in order). Technically some whole VOB's are not included in the trims, even though they are combined through the AVS scripts. This is so that I could trim out the exact locations my friend wanted me to save.
1984 Chicago (1 of 6)
Trim(10010,21608) ++ Trim(30420,33387)
1994 Chicago (2 of 6) Disc A
Trim(62787,66054) ++ Trim(80979,89371)
1994 Chicago (2 of 6) Disc B
Trim(18312,21728) ++ Trim(69471,73756)
1994 Sacramento (3 of 6)
Trim(0,4675) ++ Trim(41898,48971) ++ Trim(80949,82897) ++ Trim(188871,190519)
1995 Los Angeles (4 of 6)
Trim(4376,7253) ++ Trim(23107,28352) ++ Trim(52747,57453) ++ Trim(91079,93477) ++ Trim(97403,98751) ++ Trim(133516,134146)
1995 Chicago (5 of 6)
Trim(197952,198851) ++ Trim(207003,208681)
1997 Sacramento (6 of 6) - From VF.avs
Import("VF-Merge.avs")
Trim(91109,97792) ++ Trim(139151,141459) ++ Trim(147692,151888) ++ Trim(190160,195015)
VF-Merge.avs
VTS1 = Import("VTS_01_1.avs")
VTS2 = Import("VTS_02_1.avs")
VTS3 = Import("VTS_03_1.avs")
VTS4 = Import("VTS_04_1.avs")
VTS5 = Import("VTS_05_1.avs")
VMan = VTS1 + VTS2 + VTS3 + VTS4 + VTS5
return VMan
Project Montrose
Diagram: http://www.hlrse.net/Qwerty/avs_projectmontrose.png
http://www.hlrse.net/Qwerty/avs_key.png
Same thing as Project Six, except for the following details:
intro.wav (might be MP3 or OGG instead) is basically a vocal introduction featuring a small speech about the video before it begins.
intro.png should display as long as the length of intro.wav, and then fade out and fade in to the video.
There should not be any fading between the two "chapters"; this only happens after the introduction.
Fade into intro.png and play intro.wav. Once intro.wav is done, intro.png fades out and the video fades in. Video fades out at the end.
Below is a list of Trims for each chapter (with all the videos joined in order).
1984 Montrose (1 of 2)
Trim(1379,2817) ++ Trim(18731,20649) ++ Trim(28052,33626) ++ Trim(50619,52657) ++ Trim(62637,66533) ++ Trim(78072,87872) ++ Trim(118621,119221) ++ Trim(153117,160040) ++ Trim(180060,188751) ++ Trim(204815,214076) ++ Trim(255944,285345) ++ Trim(304825,310549)
1984 Montrose (2 of 2)
Trim(9650,10040) ++ Trim(75734,80230) ++ Trim(89371,97612) ++ Trim(112897,130609) ++ Trim(160040,171518)
It was not easy to put together the diagrams since I made them from scratch in MSPaint. I really hope those help exlpain my current situation and scenario(s). I am honestly trying to understand and do this myself, and it is not my intension to have someone do all the work for me. I have done what I could so far, but I feel that I need to start all the AVS scripting from scratch due to inefficiency and disorganization in the architecture of my scripts. I do not know better and wish to be taught a better/more efficient way of doing this for my scenarios. :( Beginning to enter panic mode.
EDIT :: Creation of DVD chapters is undesired. I just used that term for labeling, that's all.
EDIT2 :: I have VirtualDub, MeGUI, NeroAAC, wavi-avs2wav, mkvtoolnix, ffdshow, and an MPlayer installation with as many codecs I could find for it.
thewebchat
26th July 2009, 06:40
You can crossfade two clips using Dissolve(). It takes two clips as arguments and combines them with overlap. So, if you wanted to dissolve, say, "v1" and "v2", you would just do "Dissolve(v1,v2,90)" instead of "v1++v2" for a 90-frame (3 second) overlap. Images can be overlaid using Layer() if they are the same frame size as the video and contain an alpha channel. Note that you definitely want to load audio into AVS if using crossfades since it will change the video duration.
You can simply load your intro frames as additional clips and splice/dissolve them in the same way as the other clips. For example:
v1 = Import("v1.avs")
v2 = Import("v2.avs")
v3 = Import("v3.avs")
title1 = ImageSource("title1.png",end=150).ConvertToYV12().AudioDub(BlankClip(v1,length=150))
title2 = ImageSource("title2.png",end=150).ConvertToYV12().AudioDub(BlankClip(v1,length=150))
title3 = ImageSource("title3.png",end=150).ConvertToYV12().AudioDub(BlankClip(v1,length=150))
cross1 = Dissolve(title1,v1,90)
cross2 = Dissolve(title2,v2,90)
cross3 = Dissolve(title3,v3,90)
cross1++cross2++cross3
For the second one, you are being inconsistent. You said that you wanted it to "either dissolve or fade in/out" but then you later say that you want "fades out and the video fades in".
BlueToast
26th July 2009, 15:02
Sorry about that. I fixed that and removed all notes about dissolving. I was just curious about dissolve. I think I just want things to fade in and fade out; keeping it simple. I also forgot to include the trims for Project Montrose.
BlueToast
29th July 2009, 01:54
Bump.
thewebchat
29th July 2009, 14:50
FadeIn/FadeOut will do a linear fade to a solid color. It does not change the length of the clip so you can process each individual segment separately and without audio.
JohannesL
29th July 2009, 15:33
FadeOut adds one extra frame. FadeOut0 doesn't.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.