Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st February 2012, 00:17   #1  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
Simple FadeIn script with MeGUI?

I'm trying to do a simple FadeIn/FadeOut in MeGUI:
Quote:
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.

Code:
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

Last edited by TECK; 1st February 2012 at 00:25.
TECK is offline   Reply With Quote
Old 1st February 2012, 07:28   #2  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Test with Info() so see what the Direct Show world is actually giving you. i.e.
Code:
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.
IanB is offline   Reply With Quote
Old 1st February 2012, 07:49   #3  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
Thanks for the tip, Ian. Everything looks fine, the audio is present into sample:



This is the AVS script I used:
Code:
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:



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.
TECK is offline   Reply With Quote
Old 1st February 2012, 11:13   #4  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
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.
IanB is offline   Reply With Quote
Old 1st February 2012, 13:24   #5  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
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.
TECK is offline   Reply With Quote
Old 2nd February 2012, 23:28   #6  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
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?
IanB is offline   Reply With Quote
Old 29th September 2012, 23:05   #7  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
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.
TECK is offline   Reply With Quote
Old 29th September 2012, 23:35   #8  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
Play this exact script in VirtualDub :-
Code:
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 :-
Code:
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 :-
Code:
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

If NO! then try this stereo script :-
Code:
Colorbars(1280, 688, Pixel_Type="YV12")
AssumeFPS(24000,1001)
Trim(0, -4650)
FadeIn2(90)
FadeOut2(90)
Next then try this 5.1 script :-
Code:
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

Last edited by IanB; 29th September 2012 at 23:48.
IanB is offline   Reply With Quote
Old 30th September 2012, 02:39   #9  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
Quote:
Originally Posted by IanB View Post
Play this exact script in VirtualDub :-
Code:
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.

Last edited by TECK; 30th September 2012 at 02:47.
TECK is offline   Reply With Quote
Old 30th September 2012, 07:38   #10  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
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.
Code:
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()
IanB is offline   Reply With Quote
Old 30th September 2012, 07:43   #11  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
Quote:
Originally Posted by IanB View Post
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.



The point is: I don't see why is necessary to install additional audio codecs if I have a perfectly supported one already installed.

Last edited by TECK; 30th September 2012 at 07:54.
TECK is offline   Reply With Quote
Old 30th September 2012, 09:16   #12  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
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

Also there are many other threads discussing this topic.

Probably FFMpegSource is going to be the easiest path forward.
IanB is offline   Reply With Quote
Old 30th September 2012, 17:22   #13  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
Thank you Ian, I appreciate taking the time to explain this to me. I will install FFMpegSource.
TECK is offline   Reply With Quote
Old 30th September 2012, 18:23   #14  |  Link
TECK
Registered User
 
Join Date: Apr 2005
Posts: 179
I see that FFMpegSource is already installed in MeGUI? How can I use it?
TECK is offline   Reply With Quote
Old 6th October 2012, 10:56   #15  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
You might get AC3Filter/AC3File and have a freely available AC3 and DTS DirectShow Decoder on your system.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.