Log in

View Full Version : Whats the recommended way to encode h.264 these days?


Stigma
4th January 2011, 21:16
Sorrry for the silly question, but Ive been out of the loop for quite a while, since before h.264 became popular actually.

I used to use Vdub to encode my stuff back when I did a lot of that in the XviD days - but from what I have gathered the development of the kind of "plugin" codec that Vdub can use has now stopped and thus makes it a poor way to get good h.264 encodes?

So the question is simply - what is the recommended method now? I don't need step-by-step instructions, but just point me in the right direction of what software and such I should be looking at.

I have Adobe Premiere CS5, and its media encoder seems to do a good job of encoding h.264 - but I am having some big problems with it:

1) It seems to for some reason stall at 100% and take about 200% of the total estimated time before it actually finishes with the clip and jumps down to the next item on hte queue list.
2) The clips it produces for some reason seek REALLY slowly in Windows media player (other players work ok). This only seems to happen in long clips however. The users I am making this for are not advanced so I want to make it work for them as painlessly as possible - so thats why I either need a solution or an alternative method to use.

Important note: The stuff I am encoding is interlaced material from PAL VHS source (recorded in DV from a camera). I need it to deinterlace on playback - and playing back both the raw DV file and the h.264 from Adove media encoder seems to do this exellently - but I notice that not all encoders seem to presever whatever metadata or whatever that lets the media player deinterlace on playback - so this is important for me to be able to do.

I hope I can get some good suggestions. Thanks in advance :)
-Stigma

nurbs
5th January 2011, 01:25
There is a version of x264 you can use with Virtualdub called x264vfw. I haven't followed development, but I think it's relatively up to date although it's not really recommended.

The method people here seem to prefer is using the commandline x264.exe. If you just need to encode a source you can often do that directly with x264 as long as you have a build that is compiled with ffmpeg support. Example:

x264 --crf 20 --preset slow --tune film --output out.mkv input.avi
This basically selects a quality (CRF; lower number = higher quality), preset (speed/quality tradeoff) and tuning (adapts options to the source like film or animation).
You can also do 2 pass encodes and simple changes like cropping or resizing. You can get a list of all the available commands including presets and tunings by typing "x264 --fullhelp".
x264 can also take Avisynth scripts as input and there are tons of GUIs for it. You can find them in the other subforum.

I don't have experience with interlaced stuff, but I think you can figure that out with the help text. I saw you can signal BFF or TFF and so on.

I also don't know if you can somehow integrate x264 with Premiere.

smok3
5th January 2011, 09:23
it is possible to pipe-out from virtualdub to external encoders (like x.264). What you need is a beta of virtualdub (1.10.x series) and some config work, check this thread;

http://forums.virtualdub.org/index.php?act=ST&f=5&t=18789

my.vdprof (assumes you have x.264, neroaacenc and mp4box located in ./encoders) - this are just two examples + two copies for the mute clips.

{
"description": "VirtualDub external encoder profile collection",
"externalEncoders": {
"sets": {
"x264 crf 21": {
"videoEncoder": "x264",
"audioEncoder": "neroaac",
"multiplexer": "mp4box",
"description": "crf 21 tune film, aac lc audio, mp4box -hint",
"extension": "",
"processPartial": true
},
"x264 crf 23": {
"videoEncoder": "x264 crf 23",
"audioEncoder": "neroaac",
"multiplexer": "mp4box",
"description": "crf 23 tune film, aac lc audio, mp4box -hint",
"extension": "",
"processPartial": true
},
"x264 crf 21 no audio": {
"videoEncoder": "x264",
"audioEncoder": "",
"multiplexer": "mp4box noaudio",
"description": "crf 21 tune film, no audio, mp4box -hint",
"extension": "",
"processPartial": true
},
"x264 crf 23 no audio": {
"videoEncoder": "x264 crf 23",
"audioEncoder": "",
"multiplexer": "mp4box noaudio",
"description": "crf 23 tune film, no audio, mp4box -hint",
"extension": "",
"processPartial": true
}
},
"profiles": {
"x264": {
"name": "x264",
"program": "encoders\\x264.exe",
"commandArguments": "--preset medium --crf 21 --tune film --input-res %(width)x%(height) --fps %(fpsnum)/%(fpsden) --output \"video.264\" - ",
"outputFilename": "video.264",
"type": 0,
"inputFormat": 0,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": false
},
"neroaac": {
"name": "neroaac",
"program": "encoders\\neroAacEnc.exe",
"commandArguments": "-if - -of audio.mp4 -q 0.45",
"outputFilename": "audio.mp4",
"type": 1,
"inputFormat": 1,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": false
},
"mp4box": {
"name": "mp4box",
"program": "encoders\\MP4Box.exe",
"commandArguments": "-quiet -add \"video.264\" -add \"audio.mp4\" -fps %(fps) \"%(outputname).mp4\" -hint",
"outputFilename": "%(outputname).audio",
"type": 2,
"inputFormat": 0,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": false
},
"x264 crf 23": {
"name": "x264 crf 23",
"program": "encoders\\x264.exe",
"commandArguments": "--preset medium --crf 23 --tune film --input-res %(width)x%(height) --fps %(fpsnum)/%(fpsden) --output \"video.264\" - ",
"outputFilename": "video.264",
"type": 0,
"inputFormat": 0,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": false
},
"mp4box noaudio": {
"name": "mp4box noaudio",
"program": "encoders\\MP4Box.exe",
"commandArguments": "-quiet -add \"video.264\" -fps %(fps) \"%(outputname).mp4\" -hint",
"outputFilename": "%(outputname).audio",
"type": 2,
"inputFormat": 0,
"checkReturnCode": true,
"logStdout": true,
"logStderr": true,
"bypassCompression": false
}
}
}
}


what i'am saying is that you just came back the right time to use virtualdub as it was again.