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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th November 2011, 20:03   #1  |  Link
osgZach
Registered User
 
Join Date: Feb 2009
Location: USA
Posts: 680
DirectShow - frame accurate for playback?

Sorry for dumping this in the Avisynth Forum, if there was a better section to have posted it in.

Simple question. I know that we have been cautioned the Directshowsource input filter is not frame-accurate..

But what about simply using DirectShow for playback purposes?
Working with the Win32 AVILFILE API is a pain in the ass I'd rather not deal with if I can avoid it, and although the display would be used in an editing program; the program itself won't be doing anything in real time.

I just need to display every frame within a video file, seek backwards/forwards, and frame step.

The idea would be to open an AVS file that uses DGIndex/Mpeg source. Add/preview some filter effects if needed, and some other miscellaneous stuff.

Will DShow itself work, and be frame accurate for simple playback/display purposes? I wasn't sure as I saw someone comment once that Dshow "by its nature isn't frame accurate" or something to that effect. But that was in one of the encoding forums, so I wasn't sure if they were speaking strictly in terms of the directshowsource filter.
osgZach is offline   Reply With Quote
Old 7th November 2011, 22:43   #2  |  Link
vampiredom
Registered User
 
Join Date: Aug 2008
Posts: 233
I don't necessarily know that DirectShow is inherently not frame accurate, but I will say that it depends a lot of the DirectShow filter being used. I think that the DGIndex method is a lot better and more reliable -- and that DGIndexNV is even more reliable. Check out my MpegAutoIndex, which aims to provide the convenience of DirectShow or FFMS with the reliability of DGIndex, etc.

http://forum.doom9.org/showthread.php?t=162930
vampiredom is offline   Reply With Quote
Old 7th November 2011, 22:56   #3  |  Link
osgZach
Registered User
 
Join Date: Feb 2009
Location: USA
Posts: 680
I saw your thread earlier. It's an interesting/nice project but I don't think I could really use it for what I have in mind. I've been tinkering on and off when I have time, with an idea I had a while ago to write a program similar to YATTA, for doing Inverse Telecining on Anime content and producing VFR MKV's with the results.

However many people (myself included) tend to find YATTA hard to understand and work with at first (or some never get the hang of it).. So I've been thinking about filling in the gap with a program that is a lot easier to use, but isn't as complex as YATTA.

The aim isn't to replace YATTA, or TIVTC, Telecide/Decomb etc.. just provide something that is halfway between TIVTC (easily automated) and YATTA (some automation but can do more complex fixing manually). Most of the work will be done via override files, I just need a quick and easy way to load a video and allow frame-by-frame stepping/playing that is accurate to give visual feedback in the GUI.

I suppose its worth noting, I am primarily interested in supporting MPEG2 DVD source files more so than other file types. Possibly only allowing those types of input files both to discourage and protect me from piracy/being associated with piracy. There is a popular program that I can't recall the name of which has the same policy, only taking source files directly from an (unencrypted) DVD.

So if its a question of the filter being used, can anyone speak to the "frame accuracy" of DirectShow's MPEG1/2 filters ?

Last edited by osgZach; 7th November 2011 at 23:03.
osgZach is offline   Reply With Quote
Old 7th November 2011, 22:56   #4  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,173
Quote:
... DirectShowSource input filter is not frame-accurate.. ...
It is not the filter that is not frame-accurate, it is some (popular) Direct Show components that are not frame-accurate.

Direct Show can actually be frame accurate, but some splitters and codecs take a lax view about timing. When playing a stream from the beginning each frame will appear in order each with a sequential time code that make some level of apparent sense. This allows good performance simple media playback to be easily and successfully implemented.

However if you try to re-seek to one of the frames using the timecode observed or calculated you take pot luck.

A graph with all good conscientious components will work a treat. DV based video is a fine example of how well it can work, DirectShowSource() works very frame-accurately for this case.

Some worst case implementations apparently just seek to a nearby keyframe (earlier or later) and just resume from there as the timecode requested, i.e. they lie! To be fair if you analyse the media they are presenting they may not have a choice. The required information is just not available.

And for media players this is acceptable, for a frame server it is not. It is called Direct Show not Direct Serve.
IanB is offline   Reply With Quote
Old 7th November 2011, 23:15   #5  |  Link
osgZach
Registered User
 
Join Date: Feb 2009
Location: USA
Posts: 680
Thanks for your insight on this Ian.

Is there any kind of list on the web that might address the issue of which components should be avoided, and which are considered accurate and safe for my intended use?

Although, perhaps I shouldn't rule out the AVIFILE Library just yet...
osgZach is offline   Reply With Quote
Old 7th November 2011, 23:28   #6  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,173
If you just want to read Avisynth scripts why not use the Avisynth API directly. But *.avs through AVIFILE will get the same result.

For general purpose media reading ffmpeg is pretty solid.
IanB is offline   Reply With Quote
Old 7th November 2011, 23:42   #7  |  Link
osgZach
Registered User
 
Join Date: Feb 2009
Location: USA
Posts: 680
I'm using the PureBasic language. I'm not using C or C++ and I don't know them in a basic enough level to rewrite the headers and such for a wrapper in PB. There is a PB wrapper for Directshow, though, as well as an AVIFILE API wrapper for an older version of PB, and I think even a PB wrapper for AVIsynth but its for a much older version of PB, and I don't wish to downgrade.

I'm not a professional by any means, just a hobbyist learning as he goes with his language of choice
I did have some success with AVIFILE in previous attempts mucking around, so I guess I'll just go that route for now.
osgZach is offline   Reply With Quote
Old 8th November 2011, 14:22   #8  |  Link
JonE
Registered User
 
JonE's Avatar
 
Join Date: Sep 2008
Location: Birmingham (UK)
Posts: 69
As a general rule, assume DirectShow (or at least the demuxers/decoders it uses) is not frame accurate. DV, MJPEG, they are exceptions and indeed there are other exceptions, but more often than not it is a royal PITA but its not an inherent DirectShow problem.

However, if you use file source methods that are frame accurate in AviSynth (via DgIndex, and also probably FfmpegSource), then you can play that script using DirectShow and it will also be frame accurate since DirectShow itself won't need to include any demuxes/decoders.

One word of warning though - if you are going to use DirectShow from within a debugger (Visual Studio for example), make absolutely sure you do NOT have Nero installed. Symptoms of Nero problems are
1) Your program blows up when running in a debugger (this is a deliberate thing done by Nero).
2) Usually uber-dependable formats such as DV are no longer seekable (Nero replace the perfectly fine standard avi demuxer with their own which wont seek in DV files).

TTFN,
Jon
JonE is offline   Reply With Quote
Old 8th November 2011, 14:30   #9  |  Link
osgZach
Registered User
 
Join Date: Feb 2009
Location: USA
Posts: 680
Interesting, thanks for that info
osgZach 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 05:10.


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