Log in

View Full Version : how to extract this kind of MKV?


Pages : 1 [2]

Sakuya
9th June 2005, 01:29
So I just downloaded the latest AVISynth beta and installed it. I have this code in my script:

DirectshowSource("file.avi",fps=119.88,convertfps=true)
FDecimate(23.976)

I used TMPGEnc to convert that AVS. But the audio ends up ahead of the video. :( What's wrong? I take it that 119.88 is not correct. I have tried 120 and it's not right either. Help is appreciated. :(

Wilbert
9th June 2005, 09:49
I assume you meant

DirectshowSource("file.mkv",fps=119.88,convertfps=true)
FDecimate(23.976)

It should matter much which fps you choose (at least regarding to sync). fps=29.97 should also work fine.

If you still get desync could you upload the mkv somewhere?

Sakuya
9th June 2005, 21:28
Why would 29.97 work fine? :confused: The timecode file I extracted has variants of 23.976 and 29.97 and many more odd numbers such as 29.9734 and 23.9757.

Anyway, I did what you suggested but Virtualdub won't open and gives me this error, then it crashes:

Avisynth open failure:
FDecimate: input must be YUY2 or YV12

Wilbert
9th June 2005, 21:50
Why would 29.97 work fine?
All i said is that the fps you choose has no influence on the sync problem.

Apperently the video decodes to RGB. What kind of video is it? DivX3?

Try:

DirectshowSource("file.mkv", fps=119.88, convertfps=true)
ConvertToYUY2()
FDecimate(23.976)

Sakuya
9th June 2005, 21:57
Okay, what do I do after that? :confused: By the way, I also need to use these settings but they're for AVI files. :(

AVISource("file.avi",false)
LanczosResize(720,460)
Blur(1,1)

Wilbert
9th June 2005, 22:37
So you want to use the following script?

DirectshowSource("file.mkv", fps=119.88, convertfps=true)
ConvertToYUY2()
FDecimate(23.976)
LanczosResize(720,460)
Blur(1,1)


Ok, try that.

Okay, what do I do after that?
Check whether it is still in sync. If not upload the mkv somewhere.

Sakuya
9th June 2005, 22:46
Thanks, it appears to be in sync in Vdub. I'll have to load this into TMPGEnc and encode to see what happens later. Thanks again! :D

Sakuya
10th June 2005, 22:15
I have this other MKV that I want your opinion on how to extract the video and audio. This MKV is split into 2 segments with HE-AAC 5.1 sound. What I did was I used mkvtoolnix to join them together. I forgot what I used to extract but I did all the timecodes and things to create an AVI.

If my AVI filename and the audio filename is the same and in the same directory, then Vobsub can play them together. Well, I played my AVI with the AAC and everything was in sync. The length is 1:39:52.

But I've checked and my AAC is really 1:39:45. After I turned that AAC into AC3, it won't sync to the video no matter what I do because of this length. Why is this happening? Did I join wrong?

Wilbert
10th June 2005, 22:34
I forgot what I used to extract but I did all the timecodes and things to create an AVI.
Did you use mkv2vfr to extract the avi and aac, and remuxed the aac with avimux?

If that's the case the avi and aac should have different lengths, and should play out of sync. The reason is that the avi has duplicated frames.

Well, I played my AVI with the AAC and everything was in sync. The length is 1:39:52.
I don't know what to say, it should play out of sync.

Could you upload that mkv somewhere?

Sakuya
10th June 2005, 22:56
No, I've never used mkv2vfr. I think I used mp_rel to get the AVI and timecodes. And probably mkvextractGUI to get the AAC. But I leave them separately and don't mux them at all since I want to put this onto DVD.

About the MKV, it's a very large file so I don't believe a local place would have enough space or bandwidth to host it.

The AAC and AVI has different lengths. I converted the AVI to an M2V file using TMPGEnc. I then converted the AAC to AC3 but it is now out of sync due to the different lengths. How do I fix this sync?

Should I try mkv2vfr? Although I'm not familiar with what codes to use in that command line.

Wilbert
11th June 2005, 14:33
No, I've never used mkv2vfr. I think I used mp_rel to get the AVI and timecodes.
mkv2vfr is an update of mp_rel.

Can i ask you how you play avi+aac if they are not muxed. I didn't know that was possible.

I guess the aac and ac3 have the same length?

Sakuya
11th June 2005, 22:46
I merely have them with the same file name (file.avi, file.aac) in the same folder. Then I just play the AVI in Media Player Classic and the green arrow for Vobsub automatically appears and there is sound, the AAC, that plays along with it. I haven't watched it through. I just fast-forwarded to the middle to find that it's still in sync and I go to the end and it is still in sync.

I started all over with the appending and the extracting using mkv2vfr. The extracted AVI has a length of 1:40:31. I used MKVExtractGUI to get the AAC which is still 1:39:45. mkv2vfr does not extract the AAC.

Then I used the AVS script discussed a few posts ago because it had the same resolutions along with the convertFPS. I created a new AVI using that script and again I get length of 1:39:52. I'm very confused as to what to do here. It just doesn't make sense. I'm sure I did everything correctly so why don't they lengths match?

Wilbert
12th June 2005, 15:51
Then I used the AVS script discussed a few posts ago because it had the same resolutions along with the convertFPS. I created a new AVI using that script and again I get length of 1:39:52. I'm very confused as to what to do here. It just doesn't make sense. I'm sure I did everything correctly so why don't they lengths match?
I have no idea why the lengths don't match. The lengths of the avis should be the same as of mkv.

What is the length of the mkv? What is the length of the ac3?

Sakuya
13th June 2005, 03:55
The lengths of the individual segments and the joined MKV are:

Segment 1 MKV- 52:19
Segment 2 MKV- 47:32
Joined MKV- 1:39:52
Joined AAC- 1:39:45

Did I join them wrong? I used mkvtoolnix, opened the first MKV, clicked append, selected second MKV, then clicked start to start writing.

Sakuya
15th June 2005, 02:32
I've figured it out! It's very simple actually. The AAC audio covers only the animated portions of the movie. At the very end of the movie, it's just credits where there is no audio, so that's why the AAC ends early. I'm sure it would work now. :o Thanks.

HeadlessCow
15th June 2005, 05:51
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?

Well, you seem to be done now, but I made up a quick little app that converts from the timecode file into an avs script. You'll need the FDecimate plugin, or you can change the last line of the generated script to use ChangeFPS.

It's CLI-only.

Usage:
Timecode2AVS input-timecode-file output-avs-file target-fps(default 23.976) intermediate-fps(default 119.88)

The last two values are optional.

There's very little error checking and it will probably crash given any sort of incorrect input. It shouldn't cause any harm, but I certainly don't guarantee it :)

http://headlesscow.com/doom9/Timecode2AVS.exe

Sakuya
15th June 2005, 06:18
Interesting. I'll definitely give this a try. Thanks!