MKV extract
- Faltzer
- Joined: Mon May 26, 2008 11:28 am
- Status: There's no such thing as no such thing.
- Location: In your underpants!! PANTSU PANTSU!!!
- Contact:
MKV extract
Ok so I 've always had problems with the mkv container in terms of extracting footage from them.
Let's say as an example I have an anime episode that I want to use (take a scene from there for a AMV), the episode is mkv format. Now I'd have to use mkvextract to extract the raw file from the container, this raw file is a raw h.264 file that nothing supports. So then because of this problem I use an application called avc2avi to convert the raw file to h.264 avi which gives me 'problems'. If I try to extract a scene from this now converted avi file (using lets say, VirtualDub/VirtualDub MOD) the application always complains about the file (bframe reference problems, etc.) If I try to extract a scene with VDub, the output file contains either nothing(black all the way) or just the first frame. The only application that seem to work with the converted avi is Total Video Converter, but as you know (if you didn't already know), TVC gives absolutly crap video quality.
Now is there a way to '"properly" extract a scene from a mkv file? I've tried using VDub MOD directly on the mkv file, but it always complains about the file having a frame it dosen't like,etc (dosen't make a difference what video it is, as long as it's mkv, it gives the problem).
I've also tried using the program Avidemux to capture directly from the mkv file but it also gives problems like "bframe problem" and "h264 detected - can lead to crashes" and it's almost impossible to get a scene from the mkv file...
Any help???
Let's say as an example I have an anime episode that I want to use (take a scene from there for a AMV), the episode is mkv format. Now I'd have to use mkvextract to extract the raw file from the container, this raw file is a raw h.264 file that nothing supports. So then because of this problem I use an application called avc2avi to convert the raw file to h.264 avi which gives me 'problems'. If I try to extract a scene from this now converted avi file (using lets say, VirtualDub/VirtualDub MOD) the application always complains about the file (bframe reference problems, etc.) If I try to extract a scene with VDub, the output file contains either nothing(black all the way) or just the first frame. The only application that seem to work with the converted avi is Total Video Converter, but as you know (if you didn't already know), TVC gives absolutly crap video quality.
Now is there a way to '"properly" extract a scene from a mkv file? I've tried using VDub MOD directly on the mkv file, but it always complains about the file having a frame it dosen't like,etc (dosen't make a difference what video it is, as long as it's mkv, it gives the problem).
I've also tried using the program Avidemux to capture directly from the mkv file but it also gives problems like "bframe problem" and "h264 detected - can lead to crashes" and it's almost impossible to get a scene from the mkv file...
Any help???
- Kariudo
- Twilight prince
- Joined: Fri Jul 15, 2005 11:08 pm
- Status: 1924 bots banned and counting!
- Location: Los taquitos unidos
- Contact:
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
As one of the local MKV supporters, I feel somewhat obligated to respond.
There are two big reasons why these steps are giving you trouble:
A) Matroska can handle two main types of video - Native video, and VFW. Yes, this is a gross simplification, but it helps explain this. VFW is the same type of video (the only type) that AVI supports. Native video is the type that you'd find in MPEG-1, MPEG-2, or MP4 files. Historically, MKVs that house XviD-encoded video streams use VFW. Because of the inherent problems with using H.264 in AVI, however, most H.264 MKVs use Native - which, by the way, is the proper way to store such streams in MKV.
B) VirtualDubMod can handle MKVs just fine, as long as the video streams use VFW. The H.264 AVI files produced by avc2avi will only work if you have a VFW decoder that is capable of decoding H.264 (ffdshow's VFW interface can do this, for example). The kinds of warnings that can occur in the event of trying to open one of these files without the proper decoder can be as long as my arm. In short, it's generally a bad idea.
Now, there is a proper way to open any MKV file in VDubMod (or VDub itself). It requires a very simple AviSynth script. First, make sure that AviSynth is installed. Second, make sure you have the FFmpegSource plugin and put that plugin in AviSynth's plugins directory (usually C:\Program Files\AviSynth 2.5\plugins). Then use a script like this:
It'll take a little bit to open the first time because the plugin indexes the MKV, much like DGIndex does for MPEG-2 files. The ,atrack=-1 parameter is optional, but necessary if you want audio as well - by default, the plugin doesn't load audio.
If you don't want to necessarily remember to write scripts and all, you can make a template for VDubMod to use that will generate one for you. Just copy and paste this into Notepad and then save as ffmpegsource.avst in VDubMod's template directory:
After that, you can access FFmpegSource with the drop-down menu in the Open via AviSynth* dialog (for VDubMod 1.5.10.1), or again in the drop-down menu for AviSynth templates in the standard Open video dialog (for VDubMod 1.5.10.2 and 1.5.10.3).
*Open via AviSynth, despite it's name, is not for opening .avs files. You select a real video file and AviSynth will generate an .avs and then open it based on which source filter you've chosen. Thankfully later versions of VDubMod merged this with the main Open dialog so there's less confusion about it.
There are two big reasons why these steps are giving you trouble:
A) Matroska can handle two main types of video - Native video, and VFW. Yes, this is a gross simplification, but it helps explain this. VFW is the same type of video (the only type) that AVI supports. Native video is the type that you'd find in MPEG-1, MPEG-2, or MP4 files. Historically, MKVs that house XviD-encoded video streams use VFW. Because of the inherent problems with using H.264 in AVI, however, most H.264 MKVs use Native - which, by the way, is the proper way to store such streams in MKV.
B) VirtualDubMod can handle MKVs just fine, as long as the video streams use VFW. The H.264 AVI files produced by avc2avi will only work if you have a VFW decoder that is capable of decoding H.264 (ffdshow's VFW interface can do this, for example). The kinds of warnings that can occur in the event of trying to open one of these files without the proper decoder can be as long as my arm. In short, it's generally a bad idea.
Now, there is a proper way to open any MKV file in VDubMod (or VDub itself). It requires a very simple AviSynth script. First, make sure that AviSynth is installed. Second, make sure you have the FFmpegSource plugin and put that plugin in AviSynth's plugins directory (usually C:\Program Files\AviSynth 2.5\plugins). Then use a script like this:
Code: Select all
FFmpegSource("video.mkv",atrack=-1)
If you don't want to necessarily remember to write scripts and all, you can make a template for VDubMod to use that will generate one for you. Just copy and paste this into Notepad and then save as ffmpegsource.avst in VDubMod's template directory:
Code: Select all
#ASYNTHER FFmpegSource
[FFmpegSource("%f",atrack=-1)]
*Open via AviSynth, despite it's name, is not for opening .avs files. You select a real video file and AviSynth will generate an .avs and then open it based on which source filter you've chosen. Thankfully later versions of VDubMod merged this with the main Open dialog so there's less confusion about it.
- Faltzer
- Joined: Mon May 26, 2008 11:28 am
- Status: There's no such thing as no such thing.
- Location: In your underpants!! PANTSU PANTSU!!!
- Contact:
Dosen't seem to work, it says there's no function called FFmpegSource, etc. BTw, I just want to know, the downloaded plugin is a zip file, do you place the zip file itself in the avisynth plugin folder or the contents of the zip file (FFmpegSource.dll) ???
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination!
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination!
- Kariudo
- Twilight prince
- Joined: Fri Jul 15, 2005 11:08 pm
- Status: 1924 bots banned and counting!
- Location: Los taquitos unidos
- Contact:
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
You put the .dll in there. If it still doesn't load (which it should, but maybe there's something wrong elsewhere), then usingFaltzer wrote:Dosen't seem to work, it says there's no function called FFmpegSource, etc. BTw, I just want to know, the downloaded plugin is a zip file, do you place the zip file itself in the avisynth plugin folder or the contents of the zip file (FFmpegSource.dll) ???
Code: Select all
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFmpegSource.dll")
- Vivaldi
- Polemic Apologist
- Joined: Sat Sep 29, 2007 9:39 am
- Location: Petting mah cat..
- Faltzer
- Joined: Mon May 26, 2008 11:28 am
- Status: There's no such thing as no such thing.
- Location: In your underpants!! PANTSU PANTSU!!!
- Contact:
Still doesn't seem to work
Ok this is what I do:
- Install Avisynth 2.57
- Copy the plugin (FFMpegSource.dll) to the plugin dir. of Avisynth
- Open up Notepad and enter the code:
- Save as a .avs file
- Open then .avs file with VDub MOD 1.5.10 (Am I meant to do this?)
- Complains: '"cannot open mkv file"
I think it has something to do with the second last line up there? I never used AviSynth before so I'm not too sure.
Ok this is what I do:
- Install Avisynth 2.57
- Copy the plugin (FFMpegSource.dll) to the plugin dir. of Avisynth
- Open up Notepad and enter the code:
Code: Select all
FFmpegSource("video.mkv",atrack=-1)
- Open then .avs file with VDub MOD 1.5.10 (Am I meant to do this?)
- Complains: '"cannot open mkv file"
I think it has something to do with the second last line up there? I never used AviSynth before so I'm not too sure.
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination!
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination!
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
You need to replace "video.mkv" with the actual filename of the MKV - but remember to keep the quotes around it. Also, make sure the script is in the same directory as the MKV - if it's not, you need to specify the full path.Faltzer wrote:Still doesn't seem to work
Ok this is what I do:
- Install Avisynth 2.57
- Copy the plugin (FFMpegSource.dll) to the plugin dir. of Avisynth
- Open up Notepad and enter the code:- Save as a .avs fileCode: Select all
FFmpegSource("video.mkv",atrack=-1)
- Open then .avs file with VDub MOD 1.5.10 (Am I meant to do this?)
- Complains: '"cannot open mkv file"
I think it has something to do with the second last line up there? I never used AviSynth before so I'm not too sure.
- Faltzer
- Joined: Mon May 26, 2008 11:28 am
- Status: There's no such thing as no such thing.
- Location: In your underpants!! PANTSU PANTSU!!!
- Contact: