View Full Version : Virtualdub & x264
Zerox20
1st May 2006, 07:08
I searched the forums and I am pretty sure I am doing everything right I grabbed FFDSHOW from http://x264.nl/, and I encoded my file into h264 in virtualdub.
I go to open it I get the cannot locate VFW codec. I turned it under DECODER settings, unless there was another setting I had to turn on ffdshow?
Also is there an easy way to control filesize in x264? I love the bitrate option, but I take it its just one of those educated guesses?
celtic_druid
1st May 2006, 07:45
You need to enable in under VfW decoder options, not dshow.
I tend to use more than just an educated guess for bitrate. You might want to ditch VfW and use a GUI that can calculate bitrates, etc. for you since VfW is a bad idea anyway.
Zerox20
1st May 2006, 07:47
Oh? Care to clarify what you mean by use a GUI? isn't graphedit one of those or something?
you mean there is something like XVID stats reader for it? I was more or less talking about how in xvid its nice to use CALC and put in your size with your audio and then analyze your stats file etc.
Blue_MiSfit
1st May 2006, 23:14
I too am having issues getting an x264/AC3 Matroska to open and decode in VDM. I went into the ffdshow vfw config, and set the h264 decoder to libavcodec, but still I get error messages about frame ordering, and no picture when the parsing finishes in VDM.
Any suggestions? Is there another handy way to edit Matroska files with x264 in them?
~MiSfit
Sharktooth
2nd May 2006, 00:04
@Zerox20: use MeGUI, StaxRip, RealAnime ...
celtic_druid
2nd May 2006, 02:39
VDubMod is no good for mkv's containing native AVC.
Blue_MiSfit
2nd May 2006, 20:00
hmm... how dreadful.
Is there something else that I can use to cut a piece out of my 1080p x264 file? does mkvtoolnix support remuxing only a certain duration?
:confused:
celtic_druid
3rd May 2006, 06:19
Yes mkvmerge/mmg support splitting.
mars0001
3rd May 2006, 16:16
AviDemux will do what you want to
hmm... how dreadful.
Is there something else that I can use to cut a piece out of my 1080p x264 file? does mkvtoolnix support remuxing only a certain duration?
:confused:
Don't use VDub with x264.
Vdub can't handle x262 VFR and so it outputs a corrupted matroska x264.
gameplaya15143
5th May 2006, 00:34
to open an h264 encoded avi with virtualdub:
set ffdshow's vfw decoder to use libavcodec to decode h264
open regedit, navigate to:
local machine, software, microsoft, windowsNT, current version, drivers32
(no complaints if I'm a little off on this, I'm writing this off the top of my head)
add new string:
vidc.h264 = ff_vfw.dll
enjoy :D
this trick also works for SNOW
thuongshoo
5th May 2006, 03:25
Don't use VDub with x264.
Vdub can't handle x262 VFR and so it outputs a corrupted matroska x264
So which program should I use ? Megui uses Avisynth. I am said that Avisynth will convert VFR into constant frame rate. Is it right ?
foxyshadis
5th May 2006, 03:42
http://www.avisynth.org/mediawiki/wiki/VFR
In some cases a simple mkv2vfr->avs->mux w/old timecode is more than sufficient.
thuongshoo
5th May 2006, 04:06
foxyshadis! Actually I don't know your words :D
"fps= ,convertfps=true" will change vfr into cfr. This have to be do if converting a vfr source.
http://www.avisynth.org/mediawiki/wiki/DirectShowSource
I dont' want to change fps and I also don't want to have video/audio which is in-synch. So must I do ?
thank you !
foxyshadis
5th May 2006, 04:36
I linked an entire guide I helped write to doing that. Look up mkv2vfr, read the section on it; if your video is a vfw-mode mkv it will solve all your problems. If not then yes, you have to play the DSS game (without convertfps), but you can still skim timecodes (with mkvextract) off the source file to use when you remux to a new mkv.
You would normally use convertfps if you need to change the framerate, for ivtc, deinterlacing, removing duplicates, standards conversion, 120->tv, or whatever. Not for simple processing.
I can't remember if I wrote about extracting timecodes manually, if not I'll put it into the next revision. Damn, that guide's long.
thoralf
5th May 2006, 21:47
Is there something else that I can use to cut a piece out of my 1080p x264 file? does mkvtoolnix support remuxing only a certain duration?
:confused:
you could try to open the x264 in vdubmod via an avs script (directshowsource ...) and open this one in vdubmod. works quite fine for me.
good luck,
thoralf.
berrinam
6th May 2006, 04:12
I think everyone's gone off track a bit. The discussion is about x264-in-MKV not working, and 3ngel said that VDubmod doesn't support x264's VFR.
x264 doesn't produce VFR output
So you *shouldn't* need to worry about VFR unless someone actually encoded with VFR.
Shinjite
6th May 2006, 09:25
If its in VFR, convert it to cfr instead, make things easier :)
@berriman
x264 produces VFR output if you use more than 1b frame.
Is for this reason, that if you use VDub to generate a VFW encoded x264 you'll get a "modulated out of sync" mkv.
Actually VFW x264 is not usable with any program (until Vdub mod or official will update to the latest matroska source).
Blue_MiSfit
6th May 2006, 11:23
Well, what I wanted to do was a bit different.. I already have an encoded MKV file, that I just want to cut without re-encoding (obviously).
I just used mkvtoolnix/mmg to cut the video into 10 minute clips... which works, but it would be AWESOEME if there was a way to specify an in and an out point, and have mmg output the result of that.
I NEVER use VFW for encoding x264. CLI all the way.
squid_80
6th May 2006, 14:51
@berriman
x264 produces VFR output if you use more than 1b frame.
Is for this reason, that if you use VDub to generate a VFW encoded x264 you'll get a "modulated out of sync" mkv.
Actually VFW x264 is not usable with any program (until Vdub mod or official will update to the latest matroska source).
Please explain how using more than one b-frame changes the length of time a frame is displayed, resulting in a variable frame rate stream.
b-frames don't imply VFR, packed b-frames would (but that is only required in AVI, where dummy frames are inserted to compensate)
ok the sentence above is *bulls*, but i leave it in for amusement/to keeps what godofagap refers to. What i was probably thinking there is that a certain "frame" in the VfW sense also contains data that doesn't belong to the timespan corresponding to the index of that frame. Of course that is not VFR as it can't be since such a concept simply is not present in a framerate-and-frameindex setting like VfW/AVI.
On the other hand, i guess skip frames can (could?) produce VFR in the sense that a VFR capable container could drop them entirely (as they can be easily reconstructed if required)
GodofaGap
7th May 2006, 02:20
Packed bitstream has nothing to do with the display time of a frame either... it just makes sure frames are decoded + displayed in the right order. It's not VFR.
It's seems the VFW myths are getting weirder and weirder... :D
Sharktooth
7th May 2006, 02:39
LOL, i should add this one to my list of myths... :D
Alizar
7th May 2006, 08:07
@berriman
x264 produces VFR output if you use more than 1b frame.
Is for this reason, that if you use VDub to generate a VFW encoded x264 you'll get a "modulated out of sync" mkv.
Actually VFW x264 is not usable with any program (until Vdub mod or official will update to the latest matroska source).
Actually, no. x264 will not produce a variable frame-rate file. The problem lies in the ordering of the frames within the stream. AVI (not being designed to actually hold h264) is not particulary compatible.
But as far as 'VFR' to get that out of h264 you have to use an MKV with a timecodes file.
Edit: Beaten like a baby seal -- forgot I had this window open for a while >_>
thuongshoo
8th May 2006, 08:31
foxyshadis! I try to send you a PM but not success.
I read your guide
http://www.avisynth.org/mediawiki/wiki/VariableFrameRateVideo
Can you give a sample AVIsynth script which can open vfr video ?
*First ,I try to write 09.avs
DirectShowSource("c:\09.wnmv", fps=30.25, convertfps=true)
TFM(mode=0,pp=0)
TDecimate(mode=4,input="stats.txt")
and open this file by Megui. Run. Messagebox says that "it can't open stats.txt"
and I correct this file
DirectShowSource("c:\09.wnmv", fps=30.25, convertfps=true)
TFM(mode=0,pp=0)
TDecimate(mode=4,output="stats.txt")
Ok !
*Sencond, I re-edit 09.avs as following :
DirectShowSource("c:\09.wnmv", fps=30.25, convertfps=true)
TFM(mode=0,pp=0)
TDecimate(mode=6,hybrid=2,input="stats.txt",mkvout="timecodes.txt")
Messagebox says that "... CRC .... "
I dont know AVIsynth at all. Can you give a scripts sample ?
I haven't understand TFM and TDecimate's arguments. I search at Doom but there are many result
Bye!
foxyshadis
8th May 2006, 09:54
Should be mode=5 in the second part, and you can get rid of the crc warning by opening up stats.txt and removing "crc=0xbbbbbb" or whatever from the top. It won't hurt it. Otherwise, it looks good.
Here's a sample of my own usage:
#x=x.tfm(mode=0,pp=0,slow=0,mchroma=false,mi=256,output="beboppin.tfm.txt")
#return x.tdecimate(mode=4,output="beboppin.tdec.txt").crop(0,0,4,4)
#return x.tdecimate(mode=5,hybrid=2,dupthresh=1.1,concycletp=3,input="beboppin.tdec.txt",mkvout="beboppin.mkvtmp.txt",ovr="beboppin.tdecovr.txt",display=true)
x=x.tdecimate(mode=5,hybrid=2,dupthresh=1.1,concycletp=3,input="beboppin.tdec.txt",ovr="beboppin.tdecovr.txt",mkvout="nul")
x=x.Dup(threshold=.4,chroma=false,maxcopies=20,copy=true,blend=true)
#return x.DupMC(log="beboppin.dup.txt").crop(0,0,4,4)
x=x.DeDup(threshold=.7,threshold2=1.0,range2=4,maxcopies=20,maxdrops=20,decwhich=1,dec=true,show=false,
\ log="beboppin.dup.txt",ovr="beboppin.dupovr.txt",times="beboppin.mkv.txt",timesin="beboppin.mkvtmp.txt",debug="dupdbg.txt")
Some of it's a bit dated - you don't need tfmin anymore (I'll just remove that) - and the dedup was just extra vfr icing on top. And it obviously required a lot of overrides... most stuff doesn't need to be this complicated.
Just to clarify a bit :
- x264, the encoding library, perfectly handles vfr.
- x264, the encoding application, assumes the input stream to be cfr ( since input timestamps are equal to frame index / frame rate ).
So x264 in mencoder handles vfr, but x264 cli doesn't.
squid_80
8th May 2006, 10:19
Friendly warning: there's a bug in dedup that stops maxdrops being overridden.
thuongshoo
9th May 2006, 05:07
Thank foxyshadis!
Just to clarify a bit :
- x264, the encoding library, perfectly handles vfr.
- x264, the encoding application, assumes the input stream to be cfr ( since input timestamps are equal to frame index / frame rate ).
So x264 in mencoder handles vfr, but x264 cli doesn't.
Really ? So If I uses Mencoder to convert video , will I have a better video ? because VFR is more optimizer than CFR ?
I'm not a programmer. I haven't read x264's source. There are so many claims about VFR. So who can I believe in ?
I downloaded Mencoder but it's difficult to use Mencoder, more difficult than x264 CLI. I have no guide which help convering video with h264. Mencoder's site only say about DivX. Can you help me? Do you know a such site ?
Thank you !
You'll find a documenation on http://mplayerhq.hu
foxyshadis
9th May 2006, 06:06
VFR's big thing is letting you have 24p, 30p, and 60p (or other framerates) in the same file, without telecining or judder, which is a lot more noticeable on progressive video, so it looks smoother. A surprising number of shows mix several base framerates. If you can cut out enough near-duplicate frames you might notice a small efficiency gain, but the codec is pretty good about that already, so it isn't terribly useful.
The lib doesn't have to care about cfr/vfr, all it sees is groups of frames. It's entirely up to the output module to deal with framing and timestamping of what the lib hands back, and since mencoder controls the entire operation I guess it can output vfr directly. I should ask akupenguin about adding a timecode file input to x264 though, purely for the output stamping (mainly for mp4, since I think mp4box will copy timecodes like mkvmerge, but has no way of inputting them).
A skipped frame takes ~7 bytes. If you blow the framerate up to 60 fps from a 24 fps, it means you raise the bitrate by roughly 36*7*8= 2kbits. That's not a lot.
thuongshoo
11th May 2006, 08:26
Thanks Manao and foxyshadis !
I can't still use Mencoder.
mencoder infile -o out.avi -nosound -ovc x264 -x264opts ....
mencoder infile -o out.avi -nosound -ovc x264enc -x264encopts .... it still says error , it says "Couldn't find video filter 'x264'...." ,or " .. x264opts isn't a vaild option" ,..etc
I don't seem to have x264's lib which Mencoder want
mencoder -ovc help
a list appear but there is no x264 in this list.What must I do ?
Thanks!
GodofaGap
11th May 2006, 08:37
Hmmm... people have not helped you if they made you believe it is possible to create a VFR AVI with Mencoder.
You will need an Mencoder build with x264lib compiled with it. Don't know where you can get one, but shouldn't be too hard to find, or even make yourself.
Although, I'm not so sure Mencoder handles VFR output. Will try though.
thuongshoo
11th May 2006, 08:55
my intention :
- mencoder ---> rawvideo. Mencoder uses AVI as default container and is designed for AVI. Yes ! There is still a opportunity to have a H264 file which is made by Mencoder :D
- mux rawvideo and AAC by YAMb or MKVmerge
:D
I have Mencoder from http://mplayerhq.hu/ . Guide which is on this site says that Mencoder can encode video with x264 http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-selecting-codec.html
Although, I'm not so sure Mencoder handles VFR output. Will try though. yes ! you're right! :D
Manao
11th May 2006, 09:12
Rawvideo doesn't have timestamps, so you mustn't output rawvideo. You have to output to a container that handles vfr ( i.e mkv or mp4. I don't know whether mencoder supports mkv as output ).
celtic_druid
11th May 2006, 10:40
All my mencoder builds have x264 enabled.
mencoder doesn't have mkv output and only has mp4 output via lavf which is still kinda broken.
thuongshoo
12th May 2006, 13:11
I'm sorry! there aren't many thread disscuss about Mencoder. Please help me!
C:\mencoder>mencoder "d:\ha ji won - oppa [live].mpeg" -of lavf -o d:\oppa.mp4 -nosound -ovc x264 -x264encopts:vcod
ec=mp4 subq=6:4x4mv:8x8dct:me=3:frameref=5:bframes=3:b_pyramid:weight
MEncoder dev-CVS-050928-16:38-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 9)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
-x264encopts:vcodec=mp4 is not an MEncoder option
Exiting... (error parsing cmdline)
C:\mencoder>mencoder "d:\ha ji won - oppa [live].mpeg" -of lavf -o d:\oppa.mp4 -nosound -ovc x264 -x264encopts: sub
q=6:4x4mv:8x8dct:me=3:frameref=5:bframes=3:b_pyramid:weight
MEncoder dev-CVS-050928-16:38-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 9)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
-x264encopts: is not an MEncoder option
Exiting... (error parsing cmdline)
C:\mencoder>mencoder "d:\ha ji won - oppa [live].mpeg" -of lavf -o d:\oppa.mp4 -nosound -ovc x264 -x264encopts subq
=6:4x4mv:8x8dct:me=3:frameref=5:bframes=3:b_pyramid:weight
MEncoder dev-CVS-050928-16:38-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 9)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
-x264encopts is not an MEncoder option
Exiting... (error parsing cmdline)
http://img55.imageshack.us/img55/6339/x264encopts7rw.th.png (http://img55.imageshack.us/my.php?image=x264encopts7rw.png)
GodofaGap
12th May 2006, 13:47
If you type mencoder -ovc help, x264 shows up as option?
thuongshoo
12th May 2006, 13:54
no ! a list will appear but there is no x264.I have many wmv, mpeg files need to convert to mp4/mkv with x264 codec. I hope VFR won't make any sync-problem.
You are still using an old build from last September, and it doesn't even have x264 support compiled in. Get one that does, like Celtic Druid's: http://ffdshow.faireal.net/mirror/mplayer/ (correct me if this is not a good mirror, I don't use these myself).
thuongshoo
12th May 2006, 14:04
Thank nm! I go to aziedien... , this site died :D
thuongshoo
14th May 2006, 06:57
It could work! Thanks! I try to use mp4 container but it alert that " ... your stream doesn't contain b-frame.." . x264 produces B-frame ? I regardless this and try .. Result : AVIcodec can't open my file :D
leila2
25th July 2006, 11:06
Thanx a lot gameplaya15143! I was getting med to try convert a h.264 encoded avi to run on my standalone player...
luv, leila
:rolleyes: :rolleyes: :rolleyes:
to open an h264 encoded avi with virtualdub:
set ffdshow's vfw decoder to use libavcodec to decode h264
open regedit, navigate to:
local machine, software, microsoft, windowsNT, current version, drivers32
(no complaints if I'm a little off on this, I'm writing this off the top of my head)
add new string:
vidc.h264 = ff_vfw.dll
enjoy :D
this trick also works for SNOW
celtic_druid
25th July 2006, 14:32
You shouldn't need to add vidc keys. Enabling AVC decoding should be all that is required.
gameplaya15143
28th July 2006, 17:51
You shouldn't need to add vidc keys. Enabling AVC decoding should be all that is required.
"should" is the key word here. It wasn't enough to do it for me though. :(
Prettz
11th August 2006, 18:57
What a strange thread. I'm using the old, old, old version of VirtualDubMod (I don't know why) and encoding to .mkv using VfW, and it works just fine.
I do use mkvmerge on the file as a last step to add tags and ensure I have a perfectly compliant .mkv file, however.
bond
15th August 2006, 18:43
thats an avc stream in vfw mode in mkv, not in native mode, which is recommended for storing avc in mkv
Prettz
18th August 2006, 20:09
thats an avc stream in vfw mode in mkv, not in native mode, which is recommended for storing avc in mkv
I don't understand what that means. Can you elaborate?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.