View Full Version : Interleaved source - how to get a synced result?
aufkrawall
2nd May 2012, 14:04
Hello,
the source file has an audio interleave of 974 ms.
How should my script look like to maintain synced state please?
Thanks in advance.
hanfrunz
2nd May 2012, 16:50
Search for the "delay" function in the audio section of the manual.
aufkrawall
3rd May 2012, 23:16
I already tried several things that didn't work, so I ask here.
It'd be nice if you could give me some more precise advice that saves me from trying around verious things for hours.
The option of VirtualDub works just fine, so maybe the exact Avisynth counterpart functions may help.
poisondeathray
3rd May 2012, 23:32
Did you try this?
http://avisynth.org/mediawiki/DelayAudio
Gavino
4th May 2012, 00:20
The option of VirtualDub works just fine, so maybe the exact Avisynth counterpart functions may help.
Which VDub option do you mean exactly?
Avisynth's DelayAudio() corresponds to VDub's 'audio skew correction'.
There is nothing corresponding to the 'audio block placement' options, since those are related to the output file and not under the control of Avisynth.
aufkrawall
4th May 2012, 03:54
Ok, thanks.
Do you know how this can be achieved by MeGUI?
http://mewiki.project357.com/wiki/MeGUI/FAQ#How_do_I_use_delay.3F
aufkrawall
4th May 2012, 19:49
That is just delay, but not audio block placement.
What is your target output format?
You need to tell us what you are trying to accomplish!
Assuming you are trying to create an AVI file, AFAIK, the AVI Muxer in MEGUI does not support the audio block placement option, so you'd have to use VirtualDub. But why is this so important to you? You asked about maintaining audio sync; audio block placement is not related to audio sync. From VirtualDub help file:
"Audio interleaving has absolutely zero impact on when audio plays -- regardless of how audio and video frames are scattered in an AVI file, they still maintain the same timing relationship, because the index block sequences them properly."
aufkrawall
8th May 2012, 06:51
What is your target output format?
You need to tell us what you are trying to accomplish!
Sorry, I thought it was clear.
The source file has Dxtory video codec and PCM audio in an AVI container.
Audio e.g. has a preload of 1000ms and its interleave is 974ms.
I want to transcode video with x264, decoding with AviSynth DSS2 (Dxtory Directshow decoder).
Target container is MP4 with AAC audio.
Of course video and audio should remain synchronous.
How to achieve this? :)
"Audio interleaving has absolutely zero impact on when audio plays -- regardless of how audio and video frames are scattered in an AVI file, they still maintain the same timing relationship, because the index block sequences them properly."
Hm, odd. If I just use different values for preload/delay, it's not synchronous anymore. :(
What is your process chain that leads to desync?
When you say desync, do you mean a fixed offset or does the desync grow as the file progresses?
aufkrawall
8th May 2012, 16:52
What is your process chain that leads to desync?
It's very simple.
DirectShowSource("video.avi")
AssumeFPS(60)
ConvertToYV12(matrix="rec709")
-> MeGUI.
Is this what you meant? :)
When you say desync, do you mean a fixed offset or does the desync grow as the file progresses?
I just tried it again and the desync grows as time elapses.
Edit: If I just play the original AVI, of course everything is synced.
Gavino
8th May 2012, 19:18
AssumeFPS(60)
Why did you add this?
It will obviously cause an audio desync unless the original rate is exactly 60fps.
aufkrawall
8th May 2012, 23:16
That doesn't cause the problem, audio is also asynchronous without it.
I added it because sometimes for some reason the encoded result had 60.003fps instead of exactly 30 60 like the source.
StainlessS
9th May 2012, 07:10
AssumeFPS(60,sync_audio=true)
ResampleAudio(ORIGINALRATE)
aufkrawall
9th May 2012, 11:05
What am I supposed to insert for ORIGINALRATE?
Gavino
9th May 2012, 11:37
ORIGINALRATE = AudioRate()
AssumeFPS(60,sync_audio=true)
ResampleAudio(ORIGINALRATE)
aufkrawall
9th May 2012, 12:26
Doesn't help. :(
Would it be helpful if I uploaded a test sample?
Emulgator
9th May 2012, 15:26
Avisynth indeed makes no assumptions about 30fps footage where it should.
See here: http://forum.doom9.org/showthread.php?t=164406
Rounding Interpretation of [dwMicroSecPerFrame] in case of 30 fps
The signaling gives 33333 µs presentation time, this breaks indeed down
to a framerate of 300000/99999 or 30.000300003.... fps, so not compatible to anything...
I guess it is the same thing with 60fps...
aufkrawall
9th May 2012, 15:59
I guess it is the same thing with 60fps...
Oops, sorry. I meant "60.0003 instead of exactly 60 like the source".
I don't know why I wrote 30. :o
But the a/v unsync issue shouldn't be related to this.
poisondeathray
9th May 2012, 16:22
If you play the .avs script - is it in sync?
What are your computer specs?
aufkrawall
9th May 2012, 16:56
If you play the .avs script - is it in sync?
It doesn't play smooth then, maybe because it's too huge for being processed by Avisynth in realtime (HDDs make lots of noise then).
Playing the the original AVI with 846 Mbps is no problem.
But I'd guess that if it played right, still a/v wouldn't be synced.
What are your computer specs?
i5 2500k with currently 4.8 Ghz, 8 GB DDR3 1600, GTX 570 and 2x 2TB WD Black @ Raid 0.
Speed shouldn't be the problem, I can play raw video and x264 10bit without dropped frames.
poisondeathray
9th May 2012, 16:59
It doesn't play smooth then, maybe because it's too huge for being processed by Avisynth in realtime (HDDs make lots of noise then).
Playing the the original AVI with 846 Mbps is no problem.
But I'd guess that if it played right, still a/v wouldn't be synced.
This doesn't make any sense. You can playback original AVI, but can't play a simple directshow script? Something is wrong
Does Dxtory have a VFW decoder? Can you use AVISource() ?
What format does it record to ? (what is the video in the AVI?) Use mediainfo if you don't know
EDIT: sorry I missed that you mentioned it was Dxtory codec earlier....
poisondeathray
9th May 2012, 17:03
If it doesn't have a VFW decoder, Try playing a DirectShowSource("video.avi") script instead of DSS2
What does info() report about the FPS when you use directshowsource()
aufkrawall
9th May 2012, 17:08
This doesn't make any sense. You can playback original AVI, but can't play a simple directshow script? Something is wrong
I suppose this is caused by Haali Splitter.
Does Dxtory have a VFW decoder? Can you use AVISource() ?
lol :rolleyes:
Simply using AviSource() has solved the whole issue. :scared:
poisondeathray
9th May 2012, 17:20
Out of curiosity , does DirectShowSource() work ?
What filters are connected in graphstudio when you render the file?
DSS2 doesn't serve audio, so how did you load the audio when testing the DSS2 script ?
If you want to get it fixed, maybe you can submit a bug report (if you've confirmed this was a haali splitter issue, not something else)
aufkrawall
10th May 2012, 16:18
Oops again, I didn't use dss2.
Without Haali Splitter DirectShowsource() still doesn't work right (still slow and unsynced).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.