Help - Search - Members - Calendar
Full Version: H.264 MOD 16 problem
Hydrogenaudio Forums > Digital Audio/Video > General A/V
Matyas
I am not sure, if this has been already answered before, but I could not find a relevant topic here, so here it goes:

Provided I have an avi where either its height or width is not dividable by 16. I want to encode this avi into MPEg4-AVC format using x264. By now i figured out, that I have to add - as I don't want to crop it - (probably black) borders in order to be able to encode the file. The question is how do I get rid of this black border at the end? I could not find a workaround in VirtualDub.
Any help appreciated.

Matyas
MugFunky
there's cropping options in playback settings for a few decoders and things... but unless you're playing in a windowed app there shouldn't be a problem with black borders.

you could add mirrored borders or repeated-edge borders if you like smile.gif

but it's best to just resize to a mod16 res and add a pixel-aspect ratio into x264 that corresponds to the real ratio of the video. remember you can encode anamorphic and it'll be stretched back on playing.
Gabriel
I do not know about x264, but cropping can be signalled into the H264 bitstream.
smok3
from x264 help:

Video Usability Info (Annex E):
The VUI settings are not used by the encoder but are merely suggestions to
the playback equipment. See doc/vui.txt for details. Use at your own risk.

--sar width:height Specify Sample Aspect Ratio
--overscan <string> Specify crop overscan setting ["undef"]
- undef, show, crop
--videoformat <string> Specify video format ["undef"]
- component, pal, ntsc, secam, mac, undef
--fullrange <string> Specify full range samples setting ["off"]
- off, on
--colorprim <string> Specify color primaries ["undef"]
- undef, bt709, bt470m, bt470bg
smpte170m, smpte240m, film
--transfer <string> Specify transfer characteristics ["undef"]
- undef, bt709, bt470m, bt470bg, linear,
log100, log316, smpte170m, smpte240m
--colormatrix <string> Specify color matrix setting ["undef"]
- undef, bt709, fcc, bt470bg
smpte170m, smpte240m, GBR, YCgCo
--chromaloc <integer> Specify chroma sample location (0 to 5) [0]


i have no idea how/where all this settings apply.
i4004
perhaps by now x264 should be good for mod4.
try it and see if you have any problems(on motion).
Matyas
Interesting that such an old topic found its answer. Thanks!
By accident, yesterday I read something about the differences between avi and mpg. It said something like x264 stream can be placed also into a generic container like avi, but then I loose the "sar" information.
If this is correct then the above suggestion only applies to containers like m4v or 3gp, etc.

If I want to place the resulting stream into avi, I will have to waint until mod4 will be allowed, speaking of which, I am going to have a look for a newer version.
stephanV
You wont lose SAR by placing h264 in AVI. SAR is part of the video bit stream.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.