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 > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd September 2013, 18:12   #1  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Virtualdub FPS error

Hi guys.

I use Matroska.vdplugin to open mkv files in vdub and convert them to uncompressed audio/video

I do get 5 extra green frames at the start of the video and i have to remove them and resync the audio but everything works fine.

By mistake i noticed that vdub uses a different FPS when opening the mkv ( on a small file it used 21 fps instead of 23.976, on a larger file only .2 fps less )

It looks ok but i'm wondering if i should let it use the fps it wants or override to the mkv FPS.

Is this normal ? If not what should i use for mp4 and mkv to uncompressed video ?

Cheers.
__________________
Quote:
Originally Posted by Dark Shikari View Post
If they can beat x264 in visual quality on ordinary test clips without postprocessing, I'll eat my hat.
juGGaKNot is offline   Reply With Quote
Old 23rd September 2013, 18:20   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Quote:
Originally Posted by juGGaKNot View Post
Hi'm wondering if i should let it use the fps it wants or override to the mkv FPS.
Yes, override it to the correct FPS.

Quote:
Is this normal ? If not what should i use for mp4 and mkv to uncompressed video ?
Obviously it is not normal. An option for you is DGDecNV which can decode MP4 and MKV and serve the frames via Avisynth. If you want to use VirtualDub for further encoding, you can open the Avisynth script in VirtualDub.
Guest is offline   Reply With Quote
Old 23rd September 2013, 19:13   #3  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by neuron2 View Post
An option for you is DGDecNV which can decode MP4 and MKV and serve the frames via Avisynth.
Ok, will look it up. I do this because sony vegas does not open the h264 files and i want to edit them.

Thnx.

LE : i used an avisynth script

Quote:
DirectShowSource("c:\a.mkv", audio=true)
Instead of the plugin and it reads the fps right now, also no 5 green frames at the start of the video/audio sync problems.

Is this also viable ?
__________________
Quote:
Originally Posted by Dark Shikari View Post
If they can beat x264 in visual quality on ordinary test clips without postprocessing, I'll eat my hat.

Last edited by juGGaKNot; 23rd September 2013 at 20:04.
juGGaKNot is offline   Reply With Quote
Old 23rd September 2013, 20:48   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Sure, it's fine for straight linear decode. If your script requires robust random access, however, you may find DirectShowSource() to be problematic.
Guest is offline   Reply With Quote
Old 24th September 2013, 01:22   #5  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 625
Quote:
Originally Posted by juGGaKNot View Post
Ok, will look it up. I do this because sony vegas does not open the h264 files and i want to edit them.

Thnx.

LE : i used an avisynth script



Instead of the plugin and it reads the fps right now, also no 5 green frames at the start of the video/audio sync problems.

Is this also viable ?
I think that you should use:

Look below. Edited for avoiding confusion.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Nvidia GTX750 2GB DDR5 + SSD Vertex 4 256 GB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite

Last edited by Overdrive80; 24th September 2013 at 14:57.
Overdrive80 is offline   Reply With Quote
Old 24th September 2013, 09:39   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,120
The splice operation is not suited for combining video and audio, AudioDub() is:
Code:
B=FFAudioSource("c:\a.mkv")
A=ffvideosource("c:\a.mkv").assumefps(24000,1001)
AudioDub(A, B)
sneaker_ger is offline   Reply With Quote
Old 24th September 2013, 09:54   #7  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Also, calling FFAudioSource after FFVideoSource causes the ffms2 index to be rebuilt, taking twice as long (see ffms2 docs), so call FFAudioSource first, as sneaker_ger does.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 24th September 2013, 14:35   #8  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
Try using fpsnum/fpsden if needed:
Code:
A=ffvideosource("c:\a.mkv", threads=1, fpsnum=24000, fpsden=1001).assumefps(24000,1001)
B=FFAudioSource("c:\a.mkv")
AudioDub(A, B)
raffriff42 is offline   Reply With Quote
Old 24th September 2013, 14:54   #9  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 625
Quote:
Originally Posted by sneaker_ger View Post
The splice operation is not suited for combining video and audio, AudioDub() is:
Code:
B=FFAudioSource("c:\a.mkv")
A=ffvideosource("c:\a.mkv").assumefps(24000,1001)
AudioDub(A, B)
Ups!! Is true. Im stupid.

I dont know in what I am thinking. Sorry.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Nvidia GTX750 2GB DDR5 + SSD Vertex 4 256 GB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 24th September 2013, 17:37   #10  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by sneaker_ger View Post
The splice operation is not suited for combining video and audio, AudioDub() is:
Code:
B=FFAudioSource("c:\a.mkv")
A=ffvideosource("c:\a.mkv").assumefps(24000,1001)
AudioDub(A, B)
So this script ( manually edit .assumefps first to match video), open in vdub and save as avi ? ( i cut the mkv before using mkvmerge so no aditional cutting in vdub, just save as avi )

Quote:
Originally Posted by raffriff42 View Post
Try using fpsnum/fpsden if needed
For interlaced videos ?
__________________
Quote:
Originally Posted by Dark Shikari View Post
If they can beat x264 in visual quality on ordinary test clips without postprocessing, I'll eat my hat.
juGGaKNot is offline   Reply With Quote
Old 24th September 2013, 18:13   #11  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
> For interlaced videos ?
It may help to give FFVideoSource the proper framerate if you happen to know it - whatever that frame (or field) rate may be.

This can be done either by spec'ing frame rate in FFVideoSource or in AssumeFPS, or both. According to the docs, FFVideoSource(fpsnum/fpsden) is only(?) used for VFR to CFR conversions, and may have no effect on CFR sources. If your source is CFR but FFVideoSource is reading the frame rate incorrectly, AssumeFPS should fix it.
raffriff42 is offline   Reply With Quote
Old 24th September 2013, 18:53   #12  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by raffriff42 View Post
AssumeFPS should fix it.
So mediainfo on the mkv, AssumeFPS in the avs with the right fps.

The other question remains : manually edit .assumefps first to match video, open the script in vdub and save as avi ?
__________________
Quote:
Originally Posted by Dark Shikari View Post
If they can beat x264 in visual quality on ordinary test clips without postprocessing, I'll eat my hat.
juGGaKNot is offline   Reply With Quote
Old 24th September 2013, 19:41   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Quote:
Originally Posted by juGGaKNot View Post
The other question remains : manually edit .assumefps first to match video, open the script in vdub and save as avi ?
Sure, if you are trying to make an AVI.
Guest is offline   Reply With Quote
Old 25th September 2013, 17:16   #14  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by neuron2 View Post
Sure, if you are trying to make an AVI.
Yep, uncompressed audio and video to edit in vegas.

Thnx to everyone.
__________________
Quote:
Originally Posted by Dark Shikari View Post
If they can beat x264 in visual quality on ordinary test clips without postprocessing, I'll eat my hat.
juGGaKNot is offline   Reply With Quote
Old 25th September 2013, 17:53   #15  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,120
You can probably open AviSynth scripts in Vegas without the intermediate file, either through a plug-in or a virtual file system.
sneaker_ger is offline   Reply With Quote
Old 25th September 2013, 17:58   #16  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by sneaker_ger View Post
You can probably open AviSynth scripts in Vegas without the intermediate file, either through a plug-in or a virtual file system.
Very interesting, will try.

LE :

Source
Quote:
Duration : 21s 443ms
Duration_FirstFrame : 4ms
Frame rate mode : Variable
Frame rate : 23.976 fps
Minimum frame rate : 23.833 fps
Maximum frame rate : 23.976 fps
With
Quote:
loadplugin("C:\ffms\FFMS2.dll")
B=FFAudioSource("c:\a.mp4")
A=ffvideosource("c:\a.mp4").assumefps(24000,1001)
AudioDub(A, B)
i get
Quote:
Duration : 21s 438ms
Frame rate : 23.976 fps
With
Quote:
loadplugin("C:\ffms\FFMS2.dll")
B=FFAudioSource("c:\a.mp4")
A=ffvideosource("c:\a.mp4", threads=1, fpsnum=24000, fpsden=1001).assumefps(24000,1001)
AudioDub(A, B)
I get
Quote:
Duration : 21s 563ms
Frame rate : 23.976 fps
So not the original duration on a vfr video.

LE2 : Also on cfr mkv file same thing.
__________________
Quote:
Originally Posted by Dark Shikari View Post
If they can beat x264 in visual quality on ordinary test clips without postprocessing, I'll eat my hat.

Last edited by juGGaKNot; 25th September 2013 at 19:33.
juGGaKNot is offline   Reply With Quote
Old 25th September 2013, 21:10   #17  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 625
If your source is VFR, when you use:

Code:
B=FFAudioSource("c:\a.mkv")
A=ffvideosource("c:\a.mkv").assumefps(24000,1001)
AudioDub(A, B)
I think that you is obtaining a CFR (Constant frame rate). If I am wrong that somebody correct me.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Nvidia GTX750 2GB DDR5 + SSD Vertex 4 256 GB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 25th September 2013, 21:45   #18  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,120
You are wrong. Any VFR->CFR conversion has to be done in the source filter because AviSynth does not know VFR and thus cannot pass on any timecodes following filters could work with. Using fpsnum and fpsden in ffvideosource is the easiest way out.
sneaker_ger is offline   Reply With Quote
Old 25th September 2013, 22:10   #19  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
That's what I would have thought, too, since fpsnum/fpsden was supposedly created to handle VFR.

Question is, how do we know the source duration you were given is correct? I'd like to see some test sources with published durations.

Last edited by raffriff42; 25th September 2013 at 22:13.
raffriff42 is offline   Reply With Quote
Old 25th September 2013, 23:53   #20  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Quote:
Originally Posted by Overdrive80 View Post
If your source is VFR, when you use:
Code:
B=FFAudioSource("c:\a.mkv")
A=ffvideosource("c:\a.mkv").assumefps(24000,1001)
AudioDub(A, B)
I think that you is obtaining a CFR (Constant frame rate). If I am wrong that somebody correct me.
It depends what you mean.
Yes, you will get a constant frame rate (here 24000/1001 fps), because Avisynth does not support anything else.
However, it will simply play all the original frames one after the other at that rate, which will alter the duration if the source is really VFR. By contrast, using fpsnum/fpsden will take the timecodes into account and repeat or delete frames to preserve (as far as possible) the original timings while giving a constant frame rate output.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino 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:46.


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