Log in

View Full Version : uncompressed video to x264


ch3
20th April 2009, 22:17
Hello,

I've edited my animation showreel in HD and I'd like to encode it using x264 into an .mp4
At the moment I have it as a huge uncompressed .avi
I've spend about a day going through many different applications and methods without any luck.
MeGui and aviSynth is a little too complicated/advanced for me.
I tried handBrake which works fine for DVD encoding, but can't handle uncompressed avi or image sequences.
I am now trying ani-x264 without any success.
I've also downloaded x264.exe which is only the command line encoder.

I came across with tutorial :
http://teek.info/guides/video/x264encode.html
which shows that x264 appears in the vDub compression list. But I can't find the installer (lite or standard) it is talking about in this link:
http://forum.doom9.org/showthread.php?t=89979

After installing ffdshow, it seems I can encode with x264 in virtualDub, but only as an avi. Is there a way to change the container without re-encoding the video?


Any suggestions for a straight forward solution would be highly appreciated.

poisondeathray
20th April 2009, 22:41
1) don't use the ffdshow to encode x264 (it's an old version, use [search] and you will find many threads that say this)

2) if you have to use vdub, use the x264vfw version, which is fairly current, but not officially supported by the developers
http://sourceforge.net/projects/x264vfw/

3) yes you can swap containers, e.g. use mkvmergegui , or yamb (mp4box) on your avi

4) another option would be to use avidemux, which uses the regular x264 version, not the x264vfw version and functions similar like vdub, but is not limited to avi (ie. supports other container formats). There are other easy to use gui's for x264cli as well eg. ripbot264, xvid4psp. Avidemux will handle most image sequences directly, but you could also use avisynth and ImageSource() to input sequences into many encoding apps

J_Darnley
20th April 2009, 23:17
If you have an avi then what is so hard? Use Avisynth and a one (maybe two) line script to open it with x264. The whole process is:
Download Avisynth
Install Avisynth
Write the avs file: AVISource("X:\path\to\file.avi")
Download x264
Run x264

Chengbin
20th April 2009, 23:18
I believe mp4 has a 4GB limit.

ch3
20th April 2009, 23:28
first of all thank you all for your quick replies.

poisondeathray: I am trying out avidemux at the moment and it seems it does the job. I just need to figure out the correct settings. In a way I need the highest possible quality, even if the file is a little big, as long as it plays without skipping frames. Any suggestions or a link to a good starting point?


J_Darnley: What is that magic line then and how would you use it? I have never used avisynth in practice and I don't really want to spend several afternoons to learn yet another scripting language.

Chengbin: It's only 2 minutes clip, so I don't think it will ever go above 4gb.

J_Darnley
20th April 2009, 23:52
J_Darnley: What is that magic line then and how would you use it? I have never used avisynth in practice and I don't really want to spend several afternoons to learn yet another scripting language.

Perhaps you missed my edit. This is the simplest use of Avisynth and it is covered in the "Your first script" of the wiki and in the "Getting started" section of the local docs.

Conquerist
21st April 2009, 00:12
In a way I need the highest possible quality, even if the file is a little big, as long as it plays without skipping frames. Any suggestions or a link to a good starting point?
The avidemux wiki (and megui wiki too) has a good run down of the x264 encoder settings here (http://avidemux.org/admWiki/index.php?title=H264#Partition_Macroblocks).
If you're going for highest quality and you're only encoding a 2 minute clip, you can pretty much max out all of the settings. In Avidemux, the settings you'll wanna change are all on the Motion & Misc and Partitions & Frames tabs. These settings do not affect the decoding complexity/requirements, only the encoding time and efficiency.

Skipping frames (decoding requirements) and file size (bitrate) are proportional, i.e. a larger file is more likely to drop frames when decoding on a slow computer. Try using different bitrates until you find a good tradeoff. If you don't know what bitrate to start at, try "Single Pass - Quality Quantizer (Average)". The quantizer value should be in the ballpark between 18 and 23, since you're aiming for transparency (highest possible quality) while having a file small enough for web distribution.

[edit]
Don't max out Noise Reduction or the Deblocking Filter though ;-).

Mug Funky
21st April 2009, 05:40
these days i just use the x264 quicktime plugin plus compressor on the scumbag mac in my suite. hate mac, but it's 8-core, 16gb ram and on dual-fibre channel, so makes short work of uncompressed HD stuff :) afterward you can re-cast the mov as mp4 using mp4box (on a windows machine) if you need it as an mp4.

ugh, i feel dirty recommending an apple based workflow.

ch3
21st April 2009, 22:10
I am trying out different setting in avidemux to see which one works. I realize that some players will perform better than others. GOM struggles when even I am setting quatizer at 26, where VLC plays fine at 23, but not so good below that. Which player does the best decoding then?
I've also noticed that when converting to x264, blacks are no longer pure blacks. Do I apply a filter to fix this, or is there a better solution?
thanks again.

Mr VacBob
21st April 2009, 23:39
these days i just use the x264 quicktime plugin plus compressor on the scumbag mac in my suite. hate mac, but it's 8-core, 16gb ram and on dual-fibre channel, so makes short work of uncompressed HD stuff :) afterward you can re-cast the mov as mp4 using mp4box (on a windows machine) if you need it as an mp4.

ugh, i feel dirty recommending an apple based workflow.

If you've got Compressor don't you have QT Pro? Export -> to MPEG-4 -> Video/Audio Passthrough works better than mp4box for me (gpac and mpeg4ip have always been really buggy, it seems).

poisondeathray
22nd April 2009, 14:51
I am trying out different setting in avidemux to see which one works. I realize that some players will perform better than others. GOM struggles when even I am setting quatizer at 26, where VLC plays fine at 23, but not so good below that. Which player does the best decoding then?
I've also noticed that when converting to x264, blacks are no longer pure blacks. Do I apply a filter to fix this, or is there a better solution?
thanks again.

What hardware are you using?

What are the specs of your video? frame size and fps?

If you have multicore cpu, use a multithreaded decoder like MPC-HC (enable in the internal configuration) or MPC + ffdshow-MT / coreAVC / Divx h.264 .
http://forum.doom9.org/showthread.php?t=145735

Maybe your pc specs are too old, if that's the case then you might not be able to use h.264 with those video specs

For the color issue, it could be a renderer issue (e.g. overlay vs vrm9) , a levels issue or something else. You would have to give more info e.g. post a sample of before & after, and describe your workflow & settings used

ch3
22nd April 2009, 21:47
Happy Days!!!
Finally most of the problems are shorted.

poisondeathray>
You were right. It was a decoder issue. The video is 1080p at 25fps and I am running a quad core 2.4mz with 4gb ram.
I installed the divX h.264 and indeed I see a huge difference in the performance and I can now play the test clips I did with the quantizer at 18. I am a little bit concerned, that if I now go for such a high bitrate, most of the internet users won't be able to playback it correctly. So I may stick to q:22 hoping that's a typical one for a web download.


Now about the colour issue, check the uncompressed avi on the left, versus the x264 on the right. I've expanded vertically the player's window, so you can compare the videos' black to the true black of the player's background. It's not a major difference, but enough to annoy me. At the latest conversions I did, I set a contrast filter to 1.1 and it kind of sorted the problem.

http://ch3.gr/net/x264_blacksProblem.jpg

Dark Shikari
22nd April 2009, 21:54
Now about the colour issue, check the uncompressed avi on the left, versus the x264 on the right. I've expanded vertically the player's window, so you can compare the videos' black to the true black of the player's background. It's not a major difference, but enough to annoy me. At the latest conversions I did, I set a contrast filter to 1.1 and it kind of sorted the problem.If you open two videos at once, your computer can only hardware-accelerate the overlay of one of them. This often leads to the other one not getting the proper luma level conversion, thus appearing "washed out."

A contrast filter is not the way to fix this; it won't even correct it properly anyways, as the PC/TV luma level mapping is not the same as a contrast conversion.

poisondeathray
22nd April 2009, 22:04
If those screenshots were taken apart (not 2 video applications as D.S. stated above), it looks very suspicious for renderer issues. If I were to guess, you were using VMR9 (renderless), not overlay mixer

Have a read regarding luminance levels and software playback
http://forum.doom9.org/showthread.php?t=143689

If this isn't the case, post a real video sample (screenshots are unreliable, because they may change depending on how you took them).

Make sure you rule out a playback issue before you destroy your video by encoding using filters

ch3
22nd April 2009, 22:28
These are two different screenshots put together in photoshop.

that's a small sample of the showreel.
http://ch3.gr/net/x264_blacksProblem.mp4

I am not sure I know what the VMR9 is.

I am going through the extra homework about luminance levels now.

poisondeathray
22nd April 2009, 23:24
^video looks fine to me in terms of black color, it's likely a playback issue (likely the choice of renderer) on your end.

ch3
22nd April 2009, 23:39
but if it is a playback issue, how come the problem is solved when I apply a little bit of contrast as a filter? If that was the case, however much I was crushing the colours, black would still appear washed out during playback.
If I set the filter contrast to 1.1, the video's black bars completely disappear to the player's background black. I know it may not be the exact colour transformation, but contrast still expands the range and takes 16-235 roughly back to 0-255

Another minor problem is with mplayer. Either on windows, or at work under linux. The first second of the clip appears extremely washed out, almost white, with loads of artifacts. Unfortunately I can't screen-grab the content of mplayer to show you. Any idea why? I even tried to add a couple of pure black frames in the beginning without any success.

ch3
22nd April 2009, 23:45
^video looks fine to me in terms of black color, it's likely a playback issue (likely the choice of renderer) on your end.

oohh
so how do I change the renderer?
At the moment I am using GOM with the latest divX h264 decoder. The same problem appears with VLC, which I believe uses its own codecs right?

By the way, did you watch it in a neutral calibrated monitor? There may be a possibility that your monitor is darker than what it should be.

poisondeathray
22nd April 2009, 23:54
This what your uploaded sample should look like using overlay (actually taken through avisynth and avsp, because you can't take screenshots in overlay mode), and the 2nd using vmr9 renderless through mpc. If you were to apply a filter, you would destroy it.

normal
http://i41.tinypic.com/14ctfz4.png

vmr9
http://i42.tinypic.com/2yvnj8h.png

I'm talking about the renderer now (i.e. overlay vs. vmr9), not decoder. I don't know how to do it in GOM.

And are you talking about the first few frames of the uploaded clip being distorted? because they look fine to me.

ch3
23rd April 2009, 17:59
^
so how do I set the renderer to overlay rather than vmr9? Is vmr a vista feature by the way, cause I am running XP.

The other problem is on the full 2 minutes video clip. I will upload the whole thing tonight and post a link.

poisondeathray
23rd April 2009, 18:59
I don't use GOM.

In all other media players, the renderer settings are in the options. The renderer option is present on all OS's, not exclusive to one.

Try a different player e.g. MPC-HC, MPC, or KMplayer.