Log in

View Full Version : MKV: extract an Xvid.... strange things...


loa-ash
3rd May 2005, 09:28
Hi guys,


I've a particular problem when I try to extract an xvid by an mkv file...
I'm using mkvextractGui 1.4.2 then I Open the mkv file that contains
1 video (xvid), 3 audio, 2 subtitles streams...
I check the video track then I extract it correctly....
But now the problems: I check the duration about Track01.avi extracted from the mkv and this is 41 seconds more than the file in the mkv...

(Now I try to explain better, sorry but my english is poor :()

i.e.

I've open the MKV with VLC and the duration is 30:02...
I extract the track01.avi from mkv and then I've open it with VLC and duration is 30:43...

the difference is 41seconds... this is not Normal :eek: :eek:

I've also extract audio track and all is ok:

track audio in mkv is: 30.02
track audio extraced is 30.02



Why this difference, where is the problem?

Please help me!!!


P.S: Video Data: 23.976 fps

bond
3rd May 2005, 11:28
maybe its a flaw in vlc, check in virtualdub the length and framerate too

loa-ash
3rd May 2005, 11:33
VirtualDubMod tell me that:

Video: 44210 frames duration: 30:43.92
Audio: duration: 30:02

arghhhhhhh

:devil:

bond
3rd May 2005, 11:40
what framerate does vd tell?

loa-ash
3rd May 2005, 11:41
vdm tell me: 23.976fps

bond
3rd May 2005, 13:24
so you have the same number of frames too in the .avi compared to the .mkv? :D

loa-ash
3rd May 2005, 14:54
yes... but what I must to do?

bond
3rd May 2005, 14:55
open the avi and mkv in virtualdubmod and check whether both show the same framenumber

loa-ash
3rd May 2005, 16:29
If I Open the mkv with Virtualdubmod I've this error message:

"Only handle [s_text] sub for the moment"...

stephanV
3rd May 2005, 17:09
remux the mkv in mkvtoolnix so it only has the video stream, then open it...

my guess its vfr

loa-ash
3rd May 2005, 18:36
I've also tried to mux video track and one audio track with mkvmerge:

mkvmerge -o "video.mkv" "video.avi" "audio.aac"

the result is that the new video.mkv has audio out of sync... :(:(

stephanV
3rd May 2005, 19:35
take the original file, not the extracted avi

loa-ash
3rd May 2005, 20:07
how can I do this? :(

stephanV
3rd May 2005, 20:34
i assume you have it somewhere on your HD? just use mmg.exe for ease...

loa-ash
3rd May 2005, 20:52
oh sorry I haven't confused your question....:(

how can I use mmg for muxing?

loa-ash
3rd May 2005, 21:08
mmg.exe is used for muxing audio and video tracks..... but... there is something wrong in your suggest...because you've tell me "take the original file... not the extraced avi..." but i can't mux a file.mkv... mmg is used for single tracks audio/video....

:(

stephanV
3rd May 2005, 21:50
thats not true, it can open any mkv with any number of tracks

(why dont you just try first ???)

loa-ash
3rd May 2005, 22:22
I've tried mkvmeger gui 1.4.2 to open file.mkv but return me an error:

c:\file.mkv retur code: -1

that's incredible..

:( :( :(

bond
3rd May 2005, 23:47
Originally posted by stephanV
my guess its vfr [/B] might be, but than its strange that it gets longer in .avi, as normally vfr streams have less frames than their cfr counterparts and not the other way round

loa-ash
4th May 2005, 04:03
maybe done. :D


I've used mkv2vfr to extrac timecodes.txt then I've created this
avs script:

source=AviSource("video.avi",audio=false)
audio=WavSource("Track2.wav")
videoA=source.Trim(0,3331).AssumeFPS(23.9761).ChangeFPS(119.88)
videoB=source.Trim(3332,3396).AssumeFPS(29.9677).ChangeFPS(119.88)
videoC=source.Trim(3397,3420).AssumeFPS(23.9760).ChangeFPS(119.88)
videoD=source.Trim(3421,3960).AssumeFPS(29.9700).ChangeFPS(119.88)
videoE=source.Trim(3961,4240).AssumeFPS(23.9747).ChangeFPS(119.88)
videoF=source.Trim(4241,4243).AssumeFPS(18.0723).ChangeFPS(119.88)
videoG=source.Trim(4244,4651).AssumeFPS(23.9760).ChangeFPS(119.88)
videoH=source.Trim(4652,4654).AssumeFPS(17.9641).ChangeFPS(119.88)
videoI=source.Trim(4655,4866).AssumeFPS(23.9765).ChangeFPS(119.88)
videoJ=source.Trim(4867,5306).AssumeFPS(29.9687).ChangeFPS(119.88)
videoK=source.Trim(5307,5430).AssumeFPS(23.9753).ChangeFPS(119.88)
videoL=source.Trim(5431,5650).AssumeFPS(29.9728).ChangeFPS(119.88)
videoM=source.Trim(5651,6634).AssumeFPS(23.9760).ChangeFPS(119.88)
videoN=source.Trim(6635,6809).AssumeFPS(29.9709).ChangeFPS(119.88)
videoO=source.Trim(6810,9829).AssumeFPS(23.9759).ChangeFPS(119.88)
videoP=source.Trim(9830,9880).AssumeFPS(19.1083).ChangeFPS(119.88)
videoQ=source.Trim(9881,15056).AssumeFPS(23.9759).ChangeFPS(119.88)
videoR=source.Trim(15057,15091).AssumeFPS(29.9914).ChangeFPS(119.88)
videoS=source.Trim(15092,15623).AssumeFPS(23.9758).ChangeFPS(119.88)
videoT=source.Trim(15624,15628).AssumeFPS(29.9401).ChangeFPS(119.88)
videoU=source.Trim(15629,18776).AssumeFPS(23.9760).ChangeFPS(119.88)
videoV=source.Trim(18777,18786).AssumeFPS(29.9401).ChangeFPS(119.88)
videoW=source.Trim(18787,19506).AssumeFPS(23.9760).ChangeFPS(119.88)
videoX=source.Trim(19507,19541).AssumeFPS(29.9658).ChangeFPS(119.88)
videoY=source.Trim(19542,21754).AssumeFPS(23.9868).ChangeFPS(119.88)
videoZ=source.Trim(21755,21774).AssumeFPS(29.9850).ChangeFPS(119.88)
videoA1=source.Trim(21775,25338).AssumeFPS(23.9759).ChangeFPS(119.88)
videoB2=source.Trim(25339,25343).AssumeFPS(30.1205).ChangeFPS(119.88)
videoC3=source.Trim(25344,25963).AssumeFPS(23.9753).ChangeFPS(119.88)
videoD4=source.Trim(25964,26008).AssumeFPS(29.9800).ChangeFPS(119.88)
videoE5=source.Trim(26009,26424).AssumeFPS(23.9756).ChangeFPS(119.88)
videoF6=source.Trim(26425,26509).AssumeFPS(29.9718).ChangeFPS(119.88)
videoG7=source.Trim(26510,30381).AssumeFPS(23.9760).ChangeFPS(119.88)
videoH8=source.Trim(30382,30606).AssumeFPS(29.9720).ChangeFPS(119.88)
videoI9=source.Trim(30607,30670).AssumeFPS(23.9700).ChangeFPS(119.88)
videoL1=source.Trim(30671,30673).AssumeFPS(18.0723).ChangeFPS(119.88)
videoM2=source.Trim(30674,32173).AssumeFPS(23.9758).ChangeFPS(119.88)
videoN3=source.Trim(32174,32178).AssumeFPS(29.9401).ChangeFPS(119.88)
videoO4=source.Trim(32179,40634).AssumeFPS(23.9760).ChangeFPS(119.88)
videoP5=source.Trim(40635,40696).AssumeFPS(26.5411).ChangeFPS(119.88)
videoQ6=source.Trim(40697,40824).AssumeFPS(23.9790).ChangeFPS(119.88)
videoR7=source.Trim(40825,43764).AssumeFPS(29.9700).ChangeFPS(119.88)
videoS8=source.Trim(43765,43936).AssumeFPS(23.9755).ChangeFPS(119.88)
videoT9=source.Trim(43937,44071).AssumeFPS(29.9667).ChangeFPS(119.88)
videoU1=source.Trim(44072,44209).AssumeFPS(23.9417).ChangeFPS(119.88)
video=VideoA+videoB+videoC+VideoD+videoE+videoF+VideoG+videoH+videoI+VideoJ+videoK+videoL+
VideoM+videoN+videoO+VideoP+videoQ+videoR+VideoS+videoT+videoU+VideoV+videoW+videoX+VideoY+
videoZ+videoA1+VideoB2+videoC3+videoD4+VideoE5+videoF6+videoG7+VideoH8+videoI9+videoL1+VideoM2+
videoN3+videoO4+VideoP5+videoQ6+videoR7+VideoS8+videoT9+videoU1
audiodub(video,audio)
FDecimate(23.976)

I've loaded the script in vdm e save the file in Xvid (full processing mode) 2-pass...


it seems that audio is sync....

It's ok for you?

:)

Many thanks to all!!!

loa-ash
4th May 2005, 10:52
argh.... not in sync....

:( :( :( :(


@edit: the problem is when I mux with audio in mp3... with audio.wav there isn't desync... why? I must use VBR for audio??

stephanV
4th May 2005, 11:06
might be, but than its strange that it gets longer in .avi, as normally vfr streams have less frames than their cfr counterparts and not the other way round

Not strange, if his AVI consists of 23.976 and 29.97 fps parts and the frame rate in the AVI is set to 23.976 it will obviously be longer.


the problem is when I mux with audio in mp3... with audio.wav there isn't desync... why? I must use VBR for audio??

with which program do you mux? and with what exact settings did you encode your mp3?

loa-ash
4th May 2005, 14:31
I've used vdm 1.5.10.. but now I've fix all the problems video/audio sync :D I've used codec Lame MP3... watch the image below:


http://img126.echo.cx/img126/8702/aduio4hh.jpg

I've used the codec Marked in red and no problems for sync....

The codecs marked in blue wasn't good for my muxing..'cause maybe they aren't CBR .... in fact if I choose MPEG Layer-3 I can't see in to the window format the tag CBR for every bitrate... watch the image:

http://img80.echo.cx/img80/8227/audio1vk.jpg


It's only my curiosity but I would like to know the difference about image1 and image2... How change from Lame MP3 to MPEG Layer-3 ???

Thanks all for the help!!!!

stephanV
4th May 2005, 15:17
fraunhofer codec is CBR too, but i believe the bitrate it uses is not exactly what it says there (128 kbps might be 128.33 kbps for example) With certain combinations of bitrate and sampling frequencies this can cause drift, causing the file to go gradually out of synch (actually it will always cause drift, but sometimes its just not noticable). You could correct this by matching up the video and audio durations in VirtualDub.

on a side note:

PLEASE uninstall Vorbis ACM! :rolleyes: (it can cause troubles with some games!)