Matyas
Aug 25 2005, 10:04
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
Nov 14 2005, 04:12
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

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
Nov 14 2005, 04:19
I do not know about x264, but cropping can be signalled into the H264 bitstream.
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.
perhaps by now x264 should be good for mod4.
try it and see if you have any problems(on motion).
Matyas
Nov 15 2005, 01:57
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
Nov 15 2005, 05:15
You wont lose SAR by placing h264 in AVI. SAR is part of the video bit stream.