Log in

View Full Version : VFR MKV to CFR AVI


unknownsoldierX
13th January 2013, 13:26
I tried converting this file to xvid using MeGUI, but the audio was mostly out of sync, while being in sync in some spots.

Format : Matroska
Format version : Version 2
File size : 2.48 GiB
Duration : 2h 45mn
Overall bit rate : 2 148 Kbps
Writing application : HandBrake 0.9.8
Writing library : libmkv 0.6.5

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Nominal bit rate : 2 000 Kbps
Width : 720 pixels
Height : 354 pixels
Display aspect ratio : 2.40:1
Original display aspect ratio : 2.40:1
Frame rate mode : Variable
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Writing library : x264 core 120
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=abr / mbtree=1 / bitrate=2000 / ratetol=1.0 / qcomp=0.60 / qpmin=3 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English
Default : Yes
Forced : No
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC
Duration : 2h 45mn
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Language : English
Default : Yes
Forced : No

Avisynth script used:

LoadPlugin("D:\Programs\MeGUI\tools\ffms\ffms2.dll")
FFVideoSource("D:\t127.mkv", threads=1)
#deinterlace
#crop
LanczosResize(640,352) # Lanczos (Sharp)
#denoise


What do I need to do to convert VFR to CFR properly?

filler56789
13th January 2013, 14:54
From the documentation:

int fpsnum = -1, int fpsden = 1

Forces a given (constant) framerate, expressed as a rational number where fpsnum is the numerator and fpsden is the denominator. Used for VFR to CFR conversion, as it will make FFVideoSource drop or duplicate frames to convert VFR to CFR if fpsnum is greater than 0. Setting fpsnum to a number less than or equal to zero means no frames will be dropped or duplicated.

Hope this helps.

unknownsoldierX
13th January 2013, 16:06
Oh, man. I don't understand that. Or can I use that string as is?

Like this?

LoadPlugin("D:\Programs\MeGUI\tools\ffms\ffms2.dll", int fpsnum = -1, int fpsden = 1)
FFVideoSource("D:\t127.mkv", threads=1)
#deinterlace
#crop
LanczosResize(640,352) # Lanczos (Sharp)
#denoise

Overdrive80
13th January 2013, 16:45
Oh, man. I don't understand that. Or can I use that string as is?

Like this?


Try it.

LoadPlugin("D:\Programs\MeGUI\tools\ffms\ffms2.dll" )
FFVideoSource("D:\t127.mkv", threads=1, fpsnum = 24000, fpsden = 1001)
#deinterlace
#crop
LanczosResize(640,352) # Lanczos (Sharp)
#denoise

sneaker_ger
13th January 2013, 16:52
"fpsnum = -1" will not work according to the doc filler56789 has cited. You have to explicitly choose your target constant framerate with those parameters. It's not quite clear from the media info log what the optimal target would be.
To give an example:
target fps 23.976:
fpsnum=24000, fpsden=1001

target fps 29.97 fps:
fpsnum=30000, fpsden=1001

target fps 25:
fpsnum=25, fpsden=1

unknownsoldierX
14th January 2013, 01:11
fpsnum=24000, fpsden=1001

Worked perfectly. In the future, what is the easiest method for me, a layman, to find out what the target CFR should be?

Overdrive80
14th January 2013, 05:52
You may explore your source, but before you begin for here http://neuron2.net/faq.html