View Full Version : how to extract this kind of MKV?
ferrero35
1st February 2005, 12:58
VFR MKV, I could not extract this¡¡kind of MKV.
It seems to me that I need some tools I have not used .
Who can help me?
buzzqw
1st February 2005, 13:42
MkvExtract and MkvGuiExtract ?
try a little search
or http://www.64k.it/andres/MKVextractGUI152.zip
and mkvextract in http://www.64k.it/andres/mkvtoolnix-1.0.1.rar and needed http://www.64k.it/andres/mkvtoolnix-runtime-1.7.rar
BHH
ferrero35
1st February 2005, 13:46
Originally posted by buzzqw
MkvExtract and MkvGuiExtract ?
try a little search
or http://www.64k.it/andres/MKVextractGUI152.zip
and mkvextract in http://www.64k.it/andres/mkvtoolnix-1.0.1.rar and needed http://www.64k.it/andres/mkvtoolnix-runtime-1.7.rar
BHH The way you said is not useful for this kind of MKV,because the framerate is variable
bond
1st February 2005, 13:53
you will have to extract to a container that handles vfr
if your videostream is in the realvideo format mkvextract might be able to extract to a correct vfr .rm file
if your stream is in mpeg-4 format you would have to extract to .mp4, which mkvextract afaik doesnt handle (.avi will for sure not work correctly, meaning you will loose sync with audio)
ferrero35
1st February 2005, 13:58
Originally posted by bond
you will have to extract to a container that handles vfr
if your videostream is in the realvideo format mkvextract might be able to extract to a correct vfr .rm file
if your stream is in mpeg-4 format you would have to extract to .mp4, which mkvextract afaik doesnt handle (.avi will for sure not work correctly, meaning you will loose sync with audio) Yes,My stream is in mpeg-4 format.So when I extract the video, I find that I lost sync with audio.
Do you know how to solve this problem?
bond
1st February 2005, 14:02
Originally posted by ferrero35
Yes,My stream is in mpeg-4 format.So when I extract the video, I find that I lost sync with audio.
Do you know how to solve this problem? i think the main question is: whats your goal you aim at with the extraction in the end?
ferrero35
1st February 2005, 14:07
Originally posted by bond
i think the main question is: whats your goal you aim at with the extraction in the end? Good question!
Because I found I could not extract this MKV file,I want to know the correct way
multicone
2nd February 2005, 00:47
There is a reason why the MKV project was started. If you could extract the content of an advanced MKV into good old AVI, and without problems, what would be the point of starting a new container project ?
Sakuya
24th February 2005, 03:12
I'm having the same problem with the MKV file. My video is in AVI. When I play the MKV itself, the length was 25:01. When I extract the video using MKVExtract, the video length was 30:39 while the audio length was 25:01. This causes the audio to go out of sync. Someone said that I might have VFR MKV. I'm not familiar with that but here's their tip:
It's probably VFR video (variable frame rate.)
I think I read somewhere that TMPEGENC can transcode VFR MKV to eg. 120 fps, which can then be decimated by 5 to obtain 24 fps material.
You could also use a tool to extract the VFR timecodes from the MKV, and then pull the 29.97 fps sections down... don't ask me where to get such a tool either.
I'm at a lost what to do here. I downloaded MKV2VFR but I don't understand how it works. A weird thing is when I open the MKV in VdubMOD, I don't get any errors. I'm only speculating that this is a VFR MKV because someone said so. I don't know of any ways to check. GSpot does not show any MKV information. Hopefully somebody can help me. :( By the way, I'm trying to put this AVI onto DVD.
HeadlessCow
24th February 2005, 04:10
Here's my sketchy technique for moving from vfr mkv with ogg audio to cfr avi. There's probably a better way...but...eh.
You'll need mkvtoolnix from matroska.org and the ogg command line tools from vorbis.com. I'm still using mp_rel because Haali's replacement seems to give me weirdness. http://haali.cs.msu.ru/mkv/
In mkv2streams.bat
mp_rel %1 video.avi timecodes.txt
mkvextract tracks %1 2:audio.ogg
oggdec audio.ogg
del audio.ogg
Now run it
mkv2streams Video.mkv
This rips out the video as video.avi, audio as audio.wav and the vfr timecodes file as timecodes.txt
For reference, let's use this timecodes.txt
Assume 23.976
0,31165,23.9760
31166,36563,59.9401
36564,37760,23.9760
Next create an avs file like so:
source=AviSource("video.avi",audio=false)
audio=WavSource("audio.wav")
videoA=source.Trim( ).AssumeFPS( ).ChangeFPS(119.88)
videoB=source.Trim( ).AssumeFPS( ).ChangeFPS(119.88)
videoC=source.Trim( ).AssumeFPS( ).ChangeFPS(119.88)
video=VideoA+videoB+videoC
audiodub(video,audio)
FDecimate(23.976)
One line for each line in the timecodes file (not counting the first).
Copy/paste the first two numbers form each line into the trim command, and the third number into the assumefps command.
I used 119.88 as the target for ChangeFPS because I knew it was close to being an exact multiple of the framerates in the file, but you can adjust it to match your source.
Sakuya
24th February 2005, 04:23
Now, my MKV has HE-AAC 5.1 audio. I ripped that using MKVExtractGUI fine and I managed to convert that to AC3 5.1. Because the audio is so complex and is not supported by many programs including TMPGEnc, I'm putting it aside. So for the video, I used mkv2fvr (no download links available for mp_rel) and now I have an AVI and a timecode.txt file. The timecode is as follows and I don't understand one bit:
Assume 23.976
0,2159,23.9760
2160,2624,29.9691
2625,2676,23.9852
2677,2956,29.9690
2957,2964,23.9521
2965,3039,29.9760
3040,3191,23.9748
3192,3211,29.9850
3212,3263,23.9742
3264,3428,29.9673
3429,3432,24.0964
3433,3672,29.9700
3673,3776,23.9742
3777,4436,29.9700
4437,4440,23.9521
4441,5325,29.9695
5326,5813,23.9768
5814,5913,29.9670
5914,5925,24.0000
5926,15480,29.9700
15481,15656,23.9749
15657,15801,29.9711
15802,15965,23.9766
15966,16105,29.9658
16106,16153,23.9760
16154,17698,29.9703
17699,17886,23.9765
17887,27711,29.9700
27712,27791,23.9736
27792,44094,29.9700
I opened Notepad and saved the file as file.AVS. Since I have AAC audio which I'm ignoring, what do I put for all the audio fields in that script? I don't understand where you got your 119.88 fps, where does it say that in your timecode? Since each line in your sample AVS script starts with VideoA, VideoB, and VideoC, etc. Since I have more than 3 lines, do I continue on from D? What if it goes after Z? :o Sorry for asking such seemingly stupid questions. And what is this:
video=VideoA+videoB+videoC
What do all the numbers in the timecode mean? Why do I have so much and you have so little? I downloaded AviSynth 2.5. When I tried to open the AVS in VdubMOD, it told me that there is no FDecimate function. So I downloaded the filter and extracted all the files into the plugins folder. Then I went to register via Run but it told me:
FDecimate.dll was loaded, but the DllRegisterServer entry point was not found. DllRegisterServer may not be exported, or a corrupt version of FDecimate.dll may be in memory. Consider using PView to detect and remove it. :confused:
celtic_druid
24th February 2005, 09:44
0,2159,23.9760 means that for frames 0->2159 the source is 23.976fps. So with AVISynth that would be videoA=source.Trim(0,2159).AssumeFPS(23.976)
VideoA+videoB+videoC is joining each part so.
videoA=source.Trim(0,2159).AssumeFPS(23.976).ChangeFPS(119.88)
videoB=source.Trim(2160,2624).AssumeFPS(29.9691).ChangeFPS(119.88)
videoC=source.Trim(2625,2676).AssumeFPS(23.9852).ChangeFPS(119.88)
video=VideoA+videoB+videoC
You don't need/aren't meant to regserv the plugin. If in the plugin dir it should autoload otherwise just load it at the start of the script.
Sakuya
24th February 2005, 18:59
So for each line in the AVS script, I need to put videoA, videoB, videoC, and then after that videoD and so on? What do I put after videoZ because there's 3 more lines after that.
As for ChangeFPS, why is it 119.88? Isn't it supposed to be 23.976 because when I open the extracted AVI in GSpot, it says it is 23.976.
I have the FDecimate.dll (as well as other weird files that came with the FDecimate ZIP file) in the plugins folder. I used Vdubmod to open the AVS script but it said there is not function called FDecimate. What's wrong with it? :(
celtic_druid
24th February 2005, 20:00
You only need the dll, the rest if I recall are source files. Probably also a readme that would be usefull, maybe in a subfolder. Which brings me to the next point. The dll can't be in a sub folder.
HeadlessCow's explained why 119.88fps.
They don't have to be videoA, etc. these are just variable names. After Z just go videoA2 or whatever, as long as you use the same name when you join them so videoZ+videoA2+videoA3.
Sakuya
24th February 2005, 20:16
I used 119.88 as the target for ChangeFPS because I knew it was close to being an exact multiple of the framerates in the file, but you can adjust it to match your source.
I know HeadlessCow explained it but I still don't understand. :o Can you please explain it in great detail? Since there are different frame rates in the timecodes file, how do you know what the ChangeFPS comes out to be? :confused:
HeadlessCow
25th February 2005, 01:14
Make it some reasonable multiple of the framerates you find in your timecodes file. 119.88 should be good for you since you have segments of ~23.976 and segments of ~29.97.
If all you had was 30 and 60, you could just use 60 as the target for ChangeFPS since it's a common multiple.
Your file just has a lot more segments of different framerates than my example has. Just keep making up names for the segments in whatever fashion you choose as long as you append them all together in the right order at the end.
Put FDecimate.dll into your Avisynth 2.5\plugins folder, or add a LoadPlugin("path\to\FDecimate.dll") at the start of your script.
If you're using AC3 audio, just mux it back into the video using VDub or whatever you're using for the encoding/muxing process instead of doing it in Avisynth. Remove the "audio = ..." and "audiodub(video,audio)" lines from my example and remove the "video =" from the start of the line where you append all the segments together. That should give you just a video stream to encode from.
Sakuya
25th February 2005, 03:34
Okay, I removed all the audio fields like you said and for the append line, I removed the "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+video1+video2+video3
FDecimate(23.976)
I also added the LoadPlugin at the very start of the script. When I opened the AVS file in VdubMOD, I get this error:
Couldn't locate decompressor for format 'YV12' (unknown). Virtualdub requires a Video for Windows (VFW) compatible codec to decompress videos. DirectShow codecs, such as those used by Windows Media Player, are not suitable. Only 'direct stream copy' is available for this video.
I am using FFDSHOW version Aug.28,2004. It has a VFW configuration also. That's all I'm using for video codecs. :( What do I do with the opened AVS script after this? Can I just go direct stream copy to get a new AVI or must I need to make an MKV? My goal is to create an AVI with the correct FPS. I tried to make an AVI using direct stream copy but the file came out to be 15GB and I cannot play it. I get the error "Cannot render any streams." :(
HeadlessCow
25th February 2005, 05:17
I think if you install xvid it will give you the YV12 stuff you need. AVS serves up uncompressed video, so if you direct stream copy you're just gonna be outputting compressed video which is relatively unhelpful.
Switch vdub to fast recompress and choose a video codec for compression, either xvid or ffdshow would work. But if you're getting stuck here you should probably look into the guides on this site to learn how video encoding works before you continue.
Sakuya
25th February 2005, 08:13
The video length is now 25:02, 1 second more but that's okay right? :p However, in the very first frame, there's a black screen with white text saying:
warning: nothing to output
bframe decoder lag
Plus, the audio is out of sync, little at first but then it gets more and more out of sync. I merely used Media Player Classic's dub function where you select a video and then an audio and it helps you play them together at the same time. Also, in my timecodes, there are 2 lines where the assumed FPS is 24.0964 and 24.0000. For FDecimate (the last line of the AVS), do I put 23.976 or do I put 119.88? :confused:
multicone
25th February 2005, 20:32
Read what i wrote above. You CAN NOT convert this MKV into an AVI. MP4 is your only alternative choice to store VFR MPEG4 video, AVI CAN NOT handle that.
celtic_druid
25th February 2005, 20:51
They aren't trying to create a VFR avi though.
Sakuya
26th February 2005, 03:02
Yes, I am trying to turn the VFR MKV into an AVI so that I can convert the AVI to MPEG-2 for DVD. I now have a working AVI file created with the timecodes but however the audio is still out of sync.
Do you think it would work if I replaced the ChangeFPS 119.88 in the AVS script to 120? I saw another thread that said something about 120 fps and VFR MKV and they're also dealing with anime so maybe I should try that.
Edit:
I did that and it was much better than before but in the very fast conversations, it is still a bit out of sync. Any other ideas? Should I up 120 fps even more? When I converted it to MPEG-2 in TMPGEnc, the M2V file was once again out of sync (at the pace of the AVI I created using 119.88 fps). I converted using the rate of 23.976 (internally 29.97) and an encode mode of 3:2 pulldown when playback.
I also noticed that Vdub's recompressed AVIs are much smaller than the source AVI. The source is 313MB while my recompressed AVIs are 90MB. That's so weird. :eek: I recompressed using Xvid. Is there any quality loss in this recompressing process? If so, by how much?
celtic_druid
26th February 2005, 06:51
Just out of interest what happens if you convert the mkv directly with TMPGEnc?
Sakuya
26th February 2005, 07:19
TMPGEnc does not accept MKV input. :(
multicone
26th February 2005, 08:12
Originally posted by Sakuya
TMPGEnc does not accept MKV input. :(
I converted many MKVs to MPEG2 with TMPGencoder, so this is plain and simple not true. TMPG does have a DirectShow reader module, so if you can play the MKV in Windows Mediaplayer, TMPG can accept them. Just increase the priority of the DirectShow reader module in 'Environmental settings' 'VFAPI plugin', and set the file open dialogue window to 'All files' instead of 'supported audio/video files'.
HeadlessCow
26th February 2005, 17:52
Are you sure the HE-AAC -> AC3 conversion didn't create the audio sync issue? When I've done this VFR->CFR conversion I haven't had any sync issues.
THe quality loss converting to xvid is a function of the settings you used in xvid. Try doing single pass and set a target quantizer of 2. That should be the easiest way to avoid appreciable loss since you don't care about the size of this intermediate file.
120 fps is just a more convenient way of referring to 119.88 fps video...same as people use 24 instead of 23.976 and 30 instead of 29.97.
darkavatar1470
27th February 2005, 07:01
Originally posted by multicone
I converted many MKVs to MPEG2 with TMPGencoder, so this is plain and simple not true. TMPG does have a DirectShow reader module, so if you can play the MKV in Windows Mediaplayer, TMPG can accept them. Just increase the priority of the DirectShow reader module in 'Environmental settings' 'VFAPI plugin', and set the file open dialogue window to 'All files' instead of 'supported audio/video files'.
hmm...I'll try that with a VFR-MKV I made and see what happens...
the timecode file is in V2 format so it can't be done the way headless cow did...
--------
and it didn't work, error reporting "cannot be opened or unsupported"
WMP can't open it either, but Media Player Classic playbacks well ;)
ver used:
TMPGenc 2.521.58.169
Matroska pack full 1.0.3
Mkvmerge v0.9.5
Sakuya
27th February 2005, 07:37
I raised my DirectShow priority to 3 and it still didn't work.
As for the audio sync issue, the sync is very little so it no longer bothers me. However, the He-AAC > AC3 quality is bothering me so if you can help me with that in this thread. :D
http://forum.doom9.org/showthread.php?s=&threadid=89722
The only thing bothering me is the error frame that Vdub has since it filters into the AVI as well. I had to replace it with the first real frame using MPEG-VCR. But if I can get rid of the error frame from the start, that would be good. :(
Thanks for all the help guys! :D
darkavatar1470
27th February 2005, 08:08
you must mean the famous "Error: Xvid B-Frame decoding lag"
enable Packed bitstream in the Xvid Encoder and you'll get rid of it in your next encode....
It's not needed when you output to MKV or MP4 by the way...
Sakuya
27th February 2005, 08:35
I cannot find any Pack Bit-stream option. :( I have the XviD-1.0.3-20122004.exe.
darkavatar1470
27th February 2005, 13:07
oops,made a typo,
it should be Packed bitstream,
press the "more.." button of Profile @ Level
and you can see it at the bottom
Sakuya
1st March 2005, 04:59
Is there a way for FFDSHOW to accept YV12 using VFW then? I have checked the VFW Config. and YV12 is checked. But it still does not accept it. Oh well, if not then I will just use XVID and try your Packed Bit-stream method.
Sakuya
13th March 2005, 21:39
I tried your Packed Bitstream, it is already enabled. I tried disabling it but the error message is still there. :(
])r. Mario
16th March 2005, 15:42
ive been reading the thread, has anyone said how to extract the video?
i know u cant extract it to avi, so how do you extract it into something else? :confused:
sorry if its in the thread, ive read it twice and cant find it
any help would be great :)
if its possible to extract it to .mp4 than that would be preferable
Sakuya
16th March 2005, 18:59
Download a program called MKVExtract GUI. Open your MKV file in there and then select the streams you want to extract. Usually I think MKV uses the AVI format.
])r. Mario
17th March 2005, 04:58
ohh, sorry for not being specific, i have mkv toolnix and the extract portion, ive got an mkv similar to yours.
when extracted it loses about 5 minutes of video form the original
and is all outa whack when remuxed with the audio
i figure from reading the thread that its a vfr mkv
sorry again for not being specific :)
multicone
19th March 2005, 17:57
Where did you get the file from ? Have you ever considered that it's authors have chosen VFR MKV because they dont want you to create a freakin DVD from it !!!
gizmotech
19th March 2005, 18:46
**Applause**
])r. Mario
23rd March 2005, 03:21
Originally posted by multicone
Where did you get the file from ? Have you ever considered that it's authors have chosen VFR MKV because they dont want you to create a freakin DVD from it !!!
well excuse me for not having 300 dollars to buy a new dvd player every time a new codec container format comes out. making them into compatible dvds for a stand alone player is way better than watching it on the computer. unless of course u can afford 3000 for a decent size lcd tv. and i know what your thinking, but using tv out from the computer is not the same
why are u so against dvds anyway?
lamer_de
23rd March 2005, 09:34
why are u so against dvds anyway?
says the person that tries to convert DVD rips back to DVD instead of buying the DVD...
CU,
lamer_de
])r. Mario
24th March 2005, 10:02
Originally posted by lamer_de
says the person that tries to convert DVD rips back to DVD instead of buying the DVD...
CU,
lamer_de
if i had money, i would buy the dvd, but since i dont i make the best outa the free stuff i find online. vfr to cfr conversion is possible, im just trying to figure out how
])r. Mario
24th March 2005, 11:02
Originally posted by multicone
Read what i wrote above. You CAN NOT convert this MKV into an AVI. MP4 is your only alternative choice to store VFR MPEG4 video, AVI CAN NOT handle that.
i had a question for you, since avi cannot handle the vfr, is it possible to extract the video into mp4? is there such a tool?
Mosu
30th March 2005, 08:39
Originally posted by ])r. Mario
i had a question for you, since avi cannot handle the vfr, is it possible to extract the video into mp4? is there such a tool?
No.
Sakuya
8th June 2005, 06:36
Here's my sketchy technique for moving from vfr mkv with ogg audio to cfr avi. There's probably a better way...but...eh
Is there a better/quicker way? I have to deal with over 70 of those timecode ranges. :angry: Whoever came up with VFR is out of his mind. What's it for anyway?
multicone
8th June 2005, 07:18
Whoever came up with VFR is out of his mind. What's it for anyway? .... trying to prevent people creating DVDs from the content ?
.... trying to prevent people creating DVDs from the content ?
LOL. No. The DVDs are the ones that contain mixed-fps content in the first place! We just provide a way to keep that contact intact without having frame drops/duplications. That AVI cannot handle this is just too bad (meaning I don't care for conversion into AVI).
Sakuya
8th June 2005, 09:08
Well, I did it all. I'm so proud of myself. So now I have a working AVS script. However, the video has a sharpness problem. I've tried out the Blur More filter in Vdubmod and it looks better. How do I put that Blur-More code into the AVS? I don't want to waste time by saving a new AVI from the AVS script because I can just input the AVS script in TMPGEnc as video. :confused:
multicone
8th June 2005, 12:50
LOL. No. The DVDs are the ones that contain mixed-fps content in the first place! We just provide a way to keep that contact intact without having frame drops/duplications. That AVI cannot handle this is just too bad (meaning I don't care for conversion into AVI).
Sure, but it seems there is no proper way to reconvert these VFR MKVs to DVD .... though i hate to admit i havent tested to convert a VFR MKV to MPEG2 by using TMPGencoder, as for some strange reason my version of TMPG doesnt open any files using DirectShow source filter anymore, be it AVI or MKV ( this worked fine before ), and also i dont have any VFR MKVs myself :) !
Sakuya
8th June 2005, 21:18
What I did in the past works pretty well but I gave up on it because there's too much work involved. :p
Edit:
It seems TMPGEnc won't accept the AVS script with all the ChangeFPS commands. :angry: So I'm forced to do a fast recompress to get a new AVI and it's taking 4 hours. Is there a faster way? Would frameserving work? Although I don't trust Vdub's frameserving... :confused:
tritical
9th June 2005, 01:14
Have a look at this thread: http://forum.doom9.org/showthread.php?t=90938&highlight=directshowsource+convertfps. DirectshowSource() in the latest beta's (v2.5.6) of avisynth has a new option called convertfps (behaves like avisynth's internal changefps) that will do vfr->cfr for you. For example, if you have a vfr file that is a mix of 23.976 and 29.970 and you want to create a 119.88 cfr file just use: DirectshowSource("file",fps=119.88,convertfps=true). It will give you four dups in 29.970 sections and 5 dups in 23.976 sections. You can then decimate that down to your final desired framerate.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.