Log in

View Full Version : Best way to handle VFR source?


Gew
25th April 2011, 22:58
Hi

I have this clip from a mobile phone. It's encoded in Variable Frame Rate, which I'm not much a personal fan of. I seem to have a difficult time editing it. In short, I just want to rotate it 90 degrees, and make a x264 re-encode. Here my MediaInfo output:

General
Complete name : 20110414006.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 11.7 MiB
Duration : 33s 600ms
Overall bit rate : 2 922 Kbps
Encoded date : UTC 2011-04-14 14:07:23
Tagged date : UTC 2011-04-14 14:07:23

Video
ID : 1
Format : MPEG-4 Visual
Format profile : Simple@L4a
Format settings, BVOP : No
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : 20
Duration : 33s 433ms
Bit rate mode : Variable
Bit rate : 2 700 Kbps
Maximum bit rate : 3 000 Kbps
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Variable
Frame rate : 30.000 fps
Minimum frame rate : 19.737 fps
Maximum frame rate : 61.224 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.293
Stream size : 11.3 MiB (96%)
Encoded date : UTC 2011-04-14 14:07:23
Tagged date : UTC 2011-04-14 14:07:23

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 33s 600ms
Bit rate mode : Constant
Bit rate : 96.0 Kbps
Channel(s) : 1 channel
Channel positions : Front: C
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 394 KiB (3%)
Encoded date : UTC 2011-04-14 14:07:23
Tagged date : UTC 2011-04-14 14:07:23

From what it seems, x264.exe manages to hold the timecodes correct in a reencode. I assume this by pulling "x264.exe -o test.mkv 20110414006.mp4", which yielded a correct re-encoded output, same VFR style. However, x264.exe doesn't have any rotate filter. I try Avidemux v2.4, which is my favorite editing tool. It fails, it messes up the frame rate whichever container or setting I choose.

I've heard rumors that ffmpeg.exe has VFR support, and also that there are -vfilters, but my pre-compiled Windows executables don't come with the rotate filter, so I'm all out of luck there.

I've also tried encapsulating the VFR .mp4 via DirectShowSource() in a .AVS script, and simply "re-capture" to a constant frame rate while re-encoding. This fails also, output is all gray. Running Windows 7 x86. Any ideas?

poisondeathray
26th April 2011, 03:18
you could do it with avisynth, then mux in timecodes later with mkvtoolnix

try ffms2 , turnleft() [or turnright()]

Gew
26th April 2011, 09:35
Thanks poisondeathray!

FFMS2() seems to decode my VFR/MP4 properly. However, this approach with post-remuxing with previous timecodes you mention. Erhm, correct me if I'm wrong, but this presumes that I don't do any further editing (beyond simply rotating) on my video, right? If I want to say trim (cut and paste) some, the task gets more difficult. Correct? Any ideas on how to do then? Rumor has it that Avidemux v2.6 will be able to handle VFR.

-TiLT-
26th April 2011, 09:43
tdecimate(hybrid=2) outputs vfr timecodes.

Decode with a specific framerate (missing frames become duplicates), trim, apply tdecimate to remove dupes.

poisondeathray
26th April 2011, 14:37
Rumor has it that Avidemux v2.6 will be able to handle VFR.

wow, where did you hear this ?

FYI , you can download nightly 2.6 builds here (experimental only)

http://avidemux.org/nightly/win32/


(I haven't tested VFR on these and beware some builds are very buggy)

ckmox
29th April 2011, 08:50
i heard about it too that Avidemux 2.6 will be able to handle VFR well in their forum but i have not bookmarked it, it was confirmed by mean and lord mulder as far as i remember