View Full Version : Simple FadeIn script with MeGUI?
TECK
1st February 2012, 00:17
I'm trying to do a simple FadeIn/FadeOut in MeGUI:
DirectShowSource("C:\Users\Floren\Videos\Sample.mkv", fps=23.976, audio=true, convertfps=true).AssumeFPS(24000,1001).FadeIn2(90).FadeOut2(90)
Then I open this script in MeGUI and queue it. For some reason, there is no sound into output file?
Thanks for your help.
Complete name : C:\Users\Floren\Videos\Sample.mkv
Format : Matroska
Format version : Version 2
File size : 129 MiB
Duration : 3mn 13s
Overall bit rate : 5 578 Kbps
Encoded date : UTC 2012-01-31 22:06:39
Writing application : mkvmerge v5.2.1 ('A Far Off Place') built on Jan 2 2012 23:21:10
Writing library : libebml v1.2.3 + libmatroska v1.3.0
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 3mn 13s
Bit rate : 4 827 Kbps
Width : 1 280 pixels
Height : 688 pixels
Display aspect ratio : 1.860
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.229
Stream size : 112 MiB (87%)
Language : English
Default : Yes
Forced : No
Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Muxing mode : Header stripping
Codec ID : A_AC3
Duration : 3mn 13s
Bit rate mode : Constant
Bit rate : 640 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : 2ms
Stream size : 14.8 MiB (11%)
Title : English
Language : English
Default : Yes
Forced : No
IanB
1st February 2012, 07:28
Test with Info() so see what the Direct Show world is actually giving you. i.e.DirectShowSource("C:\Users\Floren\Videos\Sample.mkv", fps=23.976, audio=true, convertfps=true)
Info()With DirectShowSource(...., audio=True, ...) the True is the default (and for video as well), which means it attempt to get both a video stream and an audio stream. But it will be happy with only one of the stream or both streams, it will only complain with zero streams. When you say either video=False or Audio=False then the call must return the other stream else complain.
If Info() indicates that there is not an Audio stream, then you need to check your Direct Show environment to make sure you have an AC-3 decoder that is prepared to negotiate with DirectShowSource(). The new Windows 7 media library stuff does not count it has to be proper Direct Show.
TECK
1st February 2012, 07:49
Thanks for the tip, Ian. Everything looks fine, the audio is present into sample:
http://farm8.staticflickr.com/7156/6799918653_b2377e4c95_o.png (http://www.flickr.com/photos/yqed/6799918653/)
This is the AVS script I used:
DirectShowSource("C:\Users\Floren\Videos\Sample-orig.mkv", fps=23.976, convertfps=true)
AssumeFPS(24000,1001)
FadeIn2(90)
FadeOut2(90)
Info()
On MeGUI Input page, I simply select the Sample.avs script and it automatically populates the Audio and Video sections:
http://farm8.staticflickr.com/7007/6799929657_d943b43e3f_o.png (http://www.flickr.com/photos/yqed/6799929657/)
Next, I queue the audio and video, then I process the queue. When I listen to the newly processed audio sample, it is mute. Yet the original .ac3 file extracted from MKV container plays fine. I'm not sure what I'm missing.
IanB
1st February 2012, 11:13
I have a vague memory about some old issue to do with Aften and Float audio under Megui, my Google-fu is failing me tonight and I cannot find a reference to it.
Try adding a ConvertAudioTo16bit() to the end of your script, just to check if DirectShowSource() is actually rendering correct audio samples. If that works maybe a MeGUI/Aften expert will be along shortly to help out with getting full quality audio.
If the ConvertAudioTo16bit() does not help, then you may need to poke at your AC-3 decoder setting to find a mode that is compatible with DirectShowSource(). Are you using ffdshow for AC-3 or something else?
_________________________________
Also you will lose quality decoding and reencoding your audio track, might it not be better to just slice out the AC-3 audio stream and remux it back into the reencoded video.
TECK
1st February 2012, 13:24
Adding the ConvertAudioTo16bit() did not helped, unfortunately. It does shows into Info as Integer 16 bit, instead of Float 32 bit.
My goal is to FadeIn/Out the sample. The video fade works perfect, only the audio fails. What I could try also is something to encode the audio file separately and create the audio fade effect. In theory, the FadeIn() should do it for both audio and video. I don't even know if you could use Avisynth to do the FadeIn() for audio only. if You can, then the problem is solved as my samples will always have few minutes of time only.
On software side, I use Avisynth, CoreAVC, AC3File, DirectVobSub and Haali Media Splitter. I also have a license purchased for DGDecNV, used with MeGUI.
IanB
2nd February 2012, 23:28
As you want to fade the audio then yes you need to reprocess it. :(
Have you tried loading your Sample.avs into Virtualdub to check if it plays there. You will need the ConvertAudioTo16bit() and also a ConvertToMono() to be able to test play the audio in Virtualdub as it does not play 5.1 or float.
If Virtualdub works then DirectShowSource() is actually rendering correct audio samples and we are looking for a MeGUI/encoder problem.
If Virtualdub did not work, then you need to poke at your AC-3 decoder setting to find a mode that is compatible with DirectShowSource(). i.e. We are looking for a direct show decoder problem.
Are you using ffdshow for AC-3 direct show decoding or something else? i.e. AC3File?
TECK
29th September 2012, 23:05
I'm revisiting this thread, as I did not find a simple solution to my audio problems.
All I want is to take a MKV/MP4 format and add Fade In/Out to it. Is there a simple procedure to successfully do this in MeGUI?
Using FadeIO or FadeIn/FadeOut fades only the video, not the audio. Thank you for your help.
IanB
29th September 2012, 23:35
Play this exact script in VirtualDub :-DirectShowSource("C:\Users\Floren\Videos\Sample-orig.mkv", fps=23.976, convertfps=true)
Info()
ConvertAudioTo16bit()
ConvertToMono()Do you hear the sound?
If NO! Then fix your DirectShow audio setup until the sound works.
If yes then proceed to this script :-DirectShowSource("C:\Users\Floren\Videos\Sample-orig.mkv", fps=23.976, convertfps=true)
AssumeFPS(24000,1001)
FadeIn2(90)
FadeOut2(90)
Info()
ConvertAudioTo16bit()
ConvertToMono()Do you still hear the sound?
If No! then we have some Fade debugging to do.
If yes then encode this script :-DirectShowSource("C:\Users\Floren\Videos\Sample-orig.mkv", fps=23.976, convertfps=true)
AssumeFPS(24000,1001)
FadeIn2(90)
FadeOut2(90)Does the encoded output file play as desired?
If yes :D
If NO! then try this stereo script :-Colorbars(1280, 688, Pixel_Type="YV12")
AssumeFPS(24000,1001)
Trim(0, -4650)
FadeIn2(90)
FadeOut2(90)
Next then try this 5.1 script :-Colorbars(1280, 688, Pixel_Type="YV12")
AssumeFPS(24000,1001)
Trim(0, -4650)
FadeIn2(90)
FadeOut2(90)
Centre=ConvertToMono()
MergeChannels(Last, Centre, Last, Centre)
Else I am stumped :confused:
TECK
30th September 2012, 02:39
Play this exact script in VirtualDub :-DirectShowSource("C:\Users\Floren\Videos\Sample-orig.mkv", fps=23.976, convertfps=true)
Info()
ConvertAudioTo16bit()
ConvertToMono()Do you hear the sound?
No, I don't hear sound. I have no idea why, the format used is AC3. I can play fine in Windows Media Player any MKV I build with MeGUI and AC3 5.1 audio. All I have installed is the CoreAVC Professional, which I purchased so I don't have a million useless codecs in my PC.
Honestly, I have no idea why everything has to be so complicated. Is a simple FadeIn I try to achive, not going to the moon.
IanB
30th September 2012, 07:38
CoreAVC is a good H.264 video codec, I assume you are seeing the video just fine, it is the audio that is being recalcitrant.
What DirectShow AC-3 Audio decoder do you have installed?
If you open the .mkv in GraphEdit or GraphStudio what does the default graph look like? Does it play both video and audio correctly?
Maybe you could try FFmpegSource for the audio.V=DirectShowSource("C:\Users\Floren\Videos\Sample-orig.mkv", fps=23.976, convertfps=true, Audio=False)
A=FFAudioSource("C:\Users\Floren\Videos\Sample-orig.mkv") # You may need some options
AudioDub(V, A)
Info()
ConvertAudioTo16bit()
ConvertToMono()
TECK
30th September 2012, 07:43
What DirectShow AC-3 Audio decoder do you have installed?
None, Windows 7 Ultimate plays fine AC3 files.
Once I encode the audio with MeGUI from DTS to AC3 5.1, it plays perfect in Windows Media Player.
https://lh5.googleusercontent.com/-07JvHuzi0FI/UGfsDixoEjI/AAAAAAAABUY/KG65kA1pkmQ/s630/IMG_30092012_025054.png
The point is: I don't see why is necessary to install additional audio codecs if I have a perfectly supported one already installed.
IanB
30th September 2012, 09:16
Okay, you may have noticed I have been harping on about DirectShow AC-3 Audio decoder.
Microsloth in their infinite wisdom have mutated the AV playback world again. The default Windows 7 playback modules are not Direct Show, they are Media Foundation.
See this topic Tool for changing preferred DirectShow filters in Windows 7 (http://forum.doom9.org/showthread.php?t=146910)
Also :search: there are many other threads discussing this topic.
Probably FFMpegSource is going to be the easiest path forward.
TECK
30th September 2012, 17:22
Thank you Ian, I appreciate taking the time to explain this to me. I will install FFMpegSource. :)
TECK
30th September 2012, 18:23
I see that FFMpegSource (http://code.google.com/p/ffmpegsource/wiki/ProjectsThatUseFFMS2) is already installed in MeGUI? How can I use it?
Emulgator
6th October 2012, 10:56
You might get AC3Filter/AC3File (http://ac3filter.net/) and have a freely available AC3 and DTS DirectShow Decoder on your system.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.