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 24th May 2015, 23:31   #1  |  Link
zerowalker
Registered User
 
Join Date: Jul 2011
Posts: 1,116
AVI vs MKV

Okay i have been wondering, which container is to be preferred for the use with Avisynth if both can be used (Format wise)?

I myself have always used AVI for many reasons.
First off, Avisource, very simple and works with both audio and video.
Secondly it just seems to be the most efficient made container when it comes to reading it as it's extremely simply made, some interleaving here and there etc.

But as i have no idea how MKV rly works, and have no clue if what AVI is actually has a real world benefit i just decided to ask here.

Thanks!
zerowalker is offline   Reply With Quote
Old 25th May 2015, 00:28   #2  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 359
As an intermediary format while editing it doesn't really matter - unless you use e.g. x264vfw in VirtualDub(Mod) to put an h.264 video stream into an AVI file. IIRC, when using AVISource to open that file the first frame will be black.

AFAIK, AVI can't store a VBR MP3 stream either.
creaothceann is offline   Reply With Quote
Old 25th May 2015, 00:39   #3  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,534
I (almost) always convert to AVI first because it avoids all kinds of issues that can happen with various videos.

MKV, however is a container, not a video format. MKV is useful because it has no restriction as to which video formats it contain.

So, I'm processing MPEG videos from old VCDs, converting them to AVI, opening with AviSource, re-encoding with x264, then I merge the MP4 output with the original MP2 audio into a MKV container. If I try to use a MP4 container for a x264 video format and a MP2 audio, some media players don't read it properly. With MKV, since there are no restrictions, I can keep the original audio untouched.

Last edited by MysteryX; 24th June 2015 at 06:08.
MysteryX is offline   Reply With Quote
Old 25th May 2015, 03:08   #4  |  Link
zerowalker
Registered User
 
Join Date: Jul 2011
Posts: 1,116
I know AVI and MKV are containers, wrote that. Just mentioned Formats in the way that x264 in AVI isn't that great (as creaothceann said).

But hows the difference performance wise, i mean there must be something right?

One uses Avisource, which i guess uses some internal Splitter?
The other is Directshow or LAV/FFMPEG, DDS2 and audiodub stuff.

MKV seems to have so much "roundabout" ways to do what Avisource does.
I am not even sure if Avisource or Directhow etc follows Audio Delay things correctly (like some Audio/Video don't always start at the same time and needs a Delay to be in sync).
zerowalker is offline   Reply With Quote
Old 25th May 2015, 04:31   #5  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,534
Converting to AVI takes time, and AVI format has much more data to process, so it for sure is slower. But with AviSynth, the time to read the video file compared to running the operations is usually less than 1% (depending what script you run).

With AVI, utvideo provides better performance but requires this additional codec
http://www.digital-digest.com/softwa...dec_Suite.html

I convert videos like this
ffmpeg -i "source" -vcodec utvideo -an "destination"

Last edited by MysteryX; 24th June 2015 at 06:08.
MysteryX is offline   Reply With Quote
Old 25th May 2015, 14:53   #6  |  Link
zerowalker
Registered User
 
Join Date: Jul 2011
Posts: 1,116
So you are saying, if i had AVI and MKV with, let's say PCM / UTVideo.
The difference reading the containers and the file will be pretty much identical, even though one has to use DSS2 with AudioDub or something?;O

(I am not talking about converting from AVI to MKV here, just wondering the performance of reading and decoding from both containers (decoding should be identical as it's the same format though)).
zerowalker is offline   Reply With Quote
Old 25th May 2015, 16:26   #7  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 359
The performance difference is probably the same as moving the mouse cursor rapidly over the screen...
creaothceann is offline   Reply With Quote
Old 25th May 2015, 19:57   #8  |  Link
zerowalker
Registered User
 
Join Date: Jul 2011
Posts: 1,116
Interesting and good news a guess.
How is the accuracy for A/V syncing.
the things i stated before, like at times A/V don't start at the same time, so audio perhaps has like +127ms delay.
I am guessing Avisource take that into account at AVI has that built in.
MKV also has it of course, but i don't know if DSS2 with AudioDub DS will use that, as you use to separate methods for Video and Audio.
zerowalker is offline   Reply With Quote
Old 25th May 2015, 21:14   #9  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 359
Just try it with files like that.
creaothceann is offline   Reply With Quote
Old 25th May 2015, 22:11   #10  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,565
For sync, it depends on which of the many bodged-in AVI extensions you've used, but generally AVI has no delay (you can zero-fill with padding frames to simulate it) and no sync (you drop a frame and you're just out of luck). If anything, DirectShowSource is significantly worse! But native ffms2 and LSMASH are much better for mkv, barring the occasional small bug.

If you want to more easily keep delay or detect corruption, using MKV is a better option. AVI is nice when it just works with everything out there, but if you use nothing but AviSynth then that doesn't matter. For lossless, the overhead difference is minuscule.
foxyshadis is offline   Reply With Quote
Old 25th May 2015, 22:51   #11  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 942
The only input I've found that works for me is that for AVC/MPEG2/VC1, I use MKV and index with DGdecNV.
Otherwise, for somethign like UtVC (or any lossless intermediate), I use Avi (via VirtualDub; mostly likely indexed from MKV with DGdecNV).
I don't really use any other formats.

Tbh, the only formats I initially work with are from bluray/dvd sources.
I don't do much in the way of video recording (cell phone, digital camera, etc).
And I don't really do any screencaptures, either (Fraps, etc).

My workflow is also different.
The only time I use AudioDub() is when I want to watch a movie downscaled to 720p in MPC-HC & SVP (ffdshow).
For instance, DGdecNV + AudioDub:
Code:
SetMemoryMax(512)
LoadPlugin("C:\AVS\dgdecnv2049\DGDecodeNV.dll")
v=DGSource("E:\MakeMKV\Dracula.dgi", crop_t=20, crop_b=28, crop_l=24, crop_r=24)
a=DirectShowSource("E:\MakeMKV\Bram Stoker's Dracula.mkv", audio=true, video=false)
v=v.Spline36Resize(1280, 720)
a=a.Dmix6Stereo()
AudioDub(v, a)
That plays fine in MPC-HC and when I turn on SVP to interpolate to 60fps while watching.

That aside, I do everything separately. Video first and then audio once I'm satisfied, I'll work on the audio last and then mux them altogether.

For indexing, DGdecNV, it's recently implemented indexing from MKV's.
If I ever want to use FFMS2, I remux to MKV and index with that.

I think I only ever use AVI for lossless intermediates.
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Sparktank is offline   Reply With Quote
Old 25th May 2015, 23:37   #12  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 359
Why index when you can just use DSS2?
creaothceann is offline   Reply With Quote
Old 26th May 2015, 04:20   #13  |  Link
zerowalker
Registered User
 
Join Date: Jul 2011
Posts: 1,116
Quote:
Originally Posted by foxyshadis View Post
For sync, it depends on which of the many bodged-in AVI extensions you've used, but generally AVI has no delay (you can zero-fill with padding frames to simulate it) and no sync (you drop a frame and you're just out of luck). If anything, DirectShowSource is significantly worse! But native ffms2 and LSMASH are much better for mkv, barring the occasional small bug.

If you want to more easily keep delay or detect corruption, using MKV is a better option. AVI is nice when it just works with everything out there, but if you use nothing but AviSynth then that doesn't matter. For lossless, the overhead difference is minuscule.
Ah well then AVI is in my favor then just for the simplicity with Audio/Video (No dubbing and keeping track of stuff).

Great to have this cleared up, was pretty much as i assumed though, but it's always better to get a more technical explanation from ppl instead of grasping at straws
zerowalker 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 07:50.


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