Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th January 2004, 19:23   #1  |  Link
P0l1m0rph1c
h4x0r5 0n teh yu0r pC?
 
Join Date: Nov 2003
Posts: 156
MkvSource (?)

Hi guys. I was wondering if it was possible to import directly video files in the container matroska to avisynth.

Is a plugin of that kind too hard to make? It would be very useful for the ppl that use matroska.

Yes, i know that DirectShowSource works. But even so, it persists in giving errors and strange crashes with the apps using avisynth.

If it wouldn't be asking too much, we'd like a plugin (or even a built-in function, in next ver of avisynth), just to import mkv files for editing.

Best Regards
P0l1m0rph1c is offline   Reply With Quote
Old 20th January 2004, 14:43   #2  |  Link
bill_baroud
Registered User
 
Join Date: Feb 2002
Posts: 407
it's not existing yet (afaik), and you would have some problems with matroska VFR files.... Avisynth is based on VFW, so only mkv file created in vfw-compatibility mode will be processed.

imho, as the name says, Avisynth has been created to process avi file, and only that. if your mkv can be processed in avisynth then just transcode it, else, you have to create a "mkvsynth" anyway.
bill_baroud is offline   Reply With Quote
Old 20th January 2004, 15:13   #3  |  Link
Tuesday
Registered User
 
Tuesday's Avatar
 
Join Date: Mar 2003
Location: The Corridor of Despair
Posts: 84
I agress, a mkvsource() would be very useful for editing .mkv files without using directshow, which in my experience can often create a whole host of seeking and sync problems (although these have been worked on recently afaik)

Although there is the possibilty that .mkv can contain variable frame rate i still have yet to come across one that does, and im sure it could be detected and a warning thrown up "Frame timing imformation has been discarded due to vfw restrictions" of similar.

It'd also need switches to select which streams etc to call from the .mkv file but im sure they wouldn't be too hard to implement for some of the talented coders here (Mosu, Sh0dan et al).

As for AVIsynth being only for avi, it can already handle several other formats, not least MPEG 1/2 and RealVideo via plugins, theres even been interest in a quicktime source plugin.

Plus from what i know both Matroska and AVIsynth developeers use this forum as a base for alot of their discussions so surely this filter would only be appropriate?
Tuesday is offline   Reply With Quote
Old 20th January 2004, 17:08   #4  |  Link
BlindWanderer
Brain Dead
 
BlindWanderer's Avatar
 
Join Date: Nov 2003
Posts: 87
mkvSynth for VFR the only real way of doing it would be a) undo the VFR or b) add timebased editing to the scripting engine or c) associate timecodes with each frame.

b & c are good options (and basicly the same), probably would be good to have both of them. Having time based would let you cut video half way through a frames time.

Having not taken the time to read and understand the AviSynth core but i think it would require a major rewrite. Maybe this would be good to beg the Devs, into adding to AviSynth 3.


for MKVSource looks like the only way is to undo VFR by adding frames. Here is a list of funtions that would be good to have in a MKVSource plugin.
MKVSource(filename, audiotrack, videotrack, forcedframerate)
MKVVFR(clip)
MKVInfo(filename)
if forcedframerate is not set i think it should auto-detect what this is by reading the timecodes. Also MKVInfo should return the auto-detected framerate along with available streams in the mkv.
__________________
I'll sell my soul for a cabbit.
BlindWanderer is offline   Reply With Quote
Old 20th January 2004, 18:14   #5  |  Link
Bidoche
Avisynth 3.0 Developer
 
Join Date: Jan 2002
Location: France
Posts: 639
Quote:
Having not taken the time to read and understand the AviSynth core but i think it would require a major rewrite. Maybe this would be good to beg the Devs, into adding to AviSynth 3.
That's true, it's require a major rewrite and IMHO an unreasonable one, since it will break the logic of all temporal filters (who assume CFR).
So b) is refused, but c) is still possible.

As for functions i'd see:

MKVSource(filename, videotrack = 0, audiotrack = 0)
no forcedframerate, it just uses the average (users can AssumeFPS after if they want)

MKVUndoVFR(filename, videotrack = 0, audiotrack = 0, threshold)
scan for an acceptable common framerate and add dupes to fill in the gaps
the threshold param controls how close the predicted timecode must be from the real one to be an acceptable match

MKVEmuleVFR(filename, videotrack = 0, audiotrack = 0)
same as MKVSource, but mark frames with a timecode properties, so filters who want to consider them could.

MKVInfo...
Bidoche is offline   Reply With Quote
Old 20th January 2004, 19:38   #6  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Beside the VFR-problem, it has been discovered that there is no way to do sample-accurate seeking in MKV. This will make it behave very much like DSS is now, so there isn't much to be gained from an MKVsource.

If anything, I consider MKV as a "final" format - not an intermediate one. Don't use it for files you'd like to edit.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 22nd January 2004, 07:03   #7  |  Link
timecop
Senior Hater
 
Join Date: Aug 2002
Location: japan
Posts: 118
all these posts, all these good(?) suggestions, but you are all forgetting the easiest one:

.oO ( don't use mkv )

it's that simple, considering how this format was created mainly to "stick the man" and "provide a high-quality media format for BEOS" (i'm not shitting you, thats written right on their homepage).

writing directshow filters is on the very bottom of their "todo list".
timecop is offline   Reply With Quote
Old 22nd January 2004, 09:40   #8  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
timecop: Get your facts straight, before you put out flamebait.

This is your LAST warning - if you try to start flamewars once more, you WILL get strikes!

Stick to the topic!
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 22nd January 2004, 12:10   #9  |  Link
bill_baroud
Registered User
 
Join Date: Feb 2002
Posts: 407
Quote:
it has been discovered that there is no way to do sample-accurate seeking in MKV
hmmm robux4 stated :

Quote:
Well, I've heard about the problem and tried to find the right solution. And finally we came to the conclusion that nothing needs to be added in the format for sample-accurate seeking. So the discussion ended there... Then it's only a matter of code to handle the Matroska data correctly.
and i repeat myself, why spend a lot of hours coding something which do not take the "advantages" of matroska ? when transcoding to avi is so easy (not like quicktime, real, nor mpeg), i really don't see where is the problem.
bill_baroud is offline   Reply With Quote
Old 22nd January 2004, 12:33   #10  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
The main problem is, that it isn't reliable. Due to the flexibility of the format it cannot guarantee sampleaccurate seeking, and constant framerate.

In the end, using the DirectShow interface is the best way. I doubt a dedicated mkvsource would ever be better than DSS. So my (personal) conclusion is that it would be time wasted, and result much more code to maintain.

But anyone is free to make a plugin, and I'd be happy to include in the standard package.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 22nd January 2004, 12:39   #11  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Pah. Just write the average framerate of the file to the FPS value, and tag frames with an additional "mkfps" tag in the same way as Decomb hints, describing the framerate of every particular frame. Most filters will ignore it, but special MKV-enabled ones could use the fps hints to their advantage. Problem solved! You could also write a filter that passes the fps tags over to VirtualDubMod through a custom interface (COM?) right before the script return.
mf is offline   Reply With Quote
Old 26th January 2004, 11:11   #12  |  Link
BlindWanderer
Brain Dead
 
BlindWanderer's Avatar
 
Join Date: Nov 2003
Posts: 87
MkvSource would also have to be able to read avs files with vfr. Just for achedemic reasons of course (and for the people who can't find Import() ).
__________________
I'll sell my soul for a cabbit.
BlindWanderer is offline   Reply With Quote
Old 29th January 2004, 16:56   #13  |  Link
gizmotech
Captain CommonSense!
 
gizmotech's Avatar
 
Join Date: Jan 2003
Posts: 183
@mf.

I've dicussed a similar idea with vdm author concerning modification of exiting vfr files via vdm alone, and he has no way to attach a time code into the muxing of the file from vdm. So it's irrelevent if avisynth can do it, vdm cannot.

Gizmo.
gizmotech is offline   Reply With Quote
Old 29th January 2004, 19:26   #14  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by gizmotech
I've dicussed a similar idea with vdm author concerning modification of exiting vfr files via vdm alone, and he has no way to attach a time code into the muxing of the file from vdm. So it's irrelevent if avisynth can do it
Not irrelevant, cause you can always export a mkvmerge zone file using AVISynth. Just because VDM can't do it it's not useless if AVISynth can do it.
mf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.