Log in

View Full Version : Inconsistent results -- Quenc/Media Player


Fallen
24th September 2008, 23:08
I Know its me -- but its driving me nuts

Any Help greatly appreciated -- Sorry for the long post

I am taking a motion clip (App 7 sec) (From Vob) then overlayinging thumbnails (Static Image)
Then Audiodubbing an audio file that is longer then the motion clip (App 30 sec)

When I serve the following AVS (without the converttoyv12) to Media Player or KMPlayer all is as I expect clip duration is 30 sec. Everything is Happy

When I run the same avs through Quenc it is clipped to the length of the clip. Duration is 7 sec

I Know its me :stupid: I just can't see what I'm missing

I found a workaround Instead of Pageout=AudioDub(pageout,dummy)
Pageout=Overlay(dummy,Pageout ...
But its very very slow -- Potentially dealing with hundreds of variations of the script to create each menu page and when I add motion Thumbnails --Oui

And another workaround -- serve the avs through Quenc (No Audio)
then another avs to process the audio QuEnc it (No Video)
and tcmplex the results together -- clunky but it works A pain trying to transfer the rootpage clip length across to the audio (For when I actually want the audio length to match the clip)

Here is the avs --- clip102 is the motion clip

SetMemoryMax(128)
LoadPlugin("C:\PROGRAM FILES\TITLEWRITER\TOOLS\RenderingPrograms\DGDecode\DGDecode.dll")
Import("C:\PROGRAM FILES\TITLEWRITER\TOOLS\Macros\Functions.avs")
max=1
MenuType=0
clip102=mpeg2source("D:\NIM_3\Titlewriter\Menu\Access102.d2v").ConverttoRGB32
(clip102.framecount<max) ? eval("""
short=Blankclip(clip102,max)
clip102=overlay(short,clip102,opacity=1)
""") : NOP
PageOut=mergestill(clip102,"D:\NIM_3\Titlewriter\Menu\background.bmp")

PageOut=ConvertFps(PageOut,"ntsc_video")
LoadPlugin ("C:\PROGRAM FILES\TITLEWRITER\TOOLS\macros\nicaudio.dll")
audio=RaWavSource("C:\MYSTUFF\MUSIC\MP-3\ENYA-AFERVENTIS.WAV",2)
audlen=30*FrameRateNumerator(Pageout)/FrameRateDenominator(Pageout)
dummy=Blankclip(Pageout,length=audlen)
dummy=AudioDub(dummy,audio)
fadeit=3*FrameRateNumerator(Pageout)/FrameRateDenominator(Pageout)
dummy=fadein(dummy,fadeit)
dummy=fadeout(dummy,fadeit)
Pageout=AudioDub(Pageout,dummy)
return PageOut.converttoyv12

and here is the QuEnc command line

quenc.exe -i rootpage.avs -o rootpage.mpg -notoall -mpeg2mux dvd -2 -b 6500 -maxbframes 2 -gopsize 12 -maxbitrate 9500 -audiobitrate 96 -audiocodec mp2 -auto

And here is the top of the DgIndex for the motion clip

DGIndexProjectFile16
1
D:\NIM_3\VIDEO_TS\VTS_01_1.VOB

Stream_Type=1
MPEG_Type=2
iDCT_Algorithm=2
YUVRGB_Scale=1
Luminance_Filter=0,0
Clipping=0,0,0,0
Aspect_Ratio=16:9
Picture_Size=720x480
Field_Operation=0
Frame_Rate=29970 (30000/1001)
Location=0,5e95,0,69ce

900 6 0 49588224 0 1 1 71 72 d3 f0 f1 e2 f3 f0 e1 f2 f3 e0
900 6 0 49858560 0 1 1 71 72 d3 f0 f1 e2 f3 f0 e1 f2 f3 e0

Gavino
25th September 2008, 16:22
I found a workaround Instead of Pageout=AudioDub(pageout,dummy)
Pageout=Overlay(dummy,Pageout ...
But its very very slow
Try using this amended variant of AudioDub as an alternative workaround. It extends the video clip (if shorter) to match the audio length.
function AudioDub2(clip v, clip a) {
vFrames = v.Framecount
aFrames = ceil(v.Framerate*a.AudioLengthF/a.AudioRate)
v = vFrames < aFrames ? v.Loop(aFrames-vFrames+1, vFrames-1) : v
AudioDub(v, a)
}

Fallen
25th September 2008, 17:28
Thanx Gavino
About 50% faster then overlay-- I didn't even know about loop -- New to Avisynth

Problem is it also increases the mpg size (obviously) (as does the overlay) from about 8 meg to over 32 meg -- I could live with the speed I guess but the size * Possible number of menu pages -- Oh my

I've done this before in mplex (only with a m2v (created with mjpegtools,mpeg2enc) and mp2)
ended up with about 8.5 meg (still with a minute and a half of the same audio) -- but mplex doesn't seem to like the m2v,mp2 that Quenc spits out)

I can live with pages in the 8-9 meg range
Tried the TcMplex workaround again -- results clipped to video length (10 Sec) so that workaround isn't--

and the software players (not Media Player Classic) still play the avs -- with 30 sec of audio as expected

I'm getting a bit frustrated

Gavino
25th September 2008, 20:32
Sounds like a bug/feature of QuEnc that it is ignoring the audio length and taking only the video length into account. I confirmed this myself with a quick experiment. Try asking on the MPEG-2 Encoding (http://forum.doom9.org/forumdisplay.php?f=62) forum.

OTOH, it's not clear to me what a 'correct' encoder should do. I tried with TMPGEnc and it created an mpg which had the complete audio, but also a much larger file so I think it is just doing the equivalent of my suggested workaround.

Fallen
25th September 2008, 22:46
Yes -- thats what I think also --it seems to be in the dvd multiplex area as the novideo noaudio kicks out the full file audio file

tested with a still image and a 20 sec audio -- no sound which is a problem when authoring a dvd

Been playing around -- got mplex to accept the Quenc m2v mp2 output and is the right size m2v+mp2 + some change

-- ran the full generator -- and the final Video_TS.vob Plays correctly (when played alone) and is the right size
Big but -- The @#$#! players still truncate it when playing the compiliation (as a dvd)

Looked at the video/audio packs in vobedit all seem correct --and the ifo's seem fine

Tired now -- I need to walk away from this for the day