Skip to main content

Topic: H.264 MOD 16 problem (Read 5146 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Matyas
  • [*][*][*]
H.264 MOD 16 problem
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.

  • Last Edit: 25 August, 2005, 12:04:48 PM by Matyas

  • MugFunky
  • [*][*][*][*]
H.264 MOD 16 problem
Reply #1
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
  • [*][*][*][*][*]
  • Developer
H.264 MOD 16 problem
Reply #2
I do not know about x264, but cropping can be signalled into the H264 bitstream.

  • smok3
  • [*][*][*][*][*]
  • Moderator
H.264 MOD 16 problem
Reply #3
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)
  • [/i]

    i have no idea how/where all this settings apply.
  • Last Edit: 14 November, 2005, 01:55:32 PM by smok3
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

  • i4004
  • [*][*][*]
H.264 MOD 16 problem
Reply #4
perhaps by now x264 should be good for mod4.
try it and see if you have any problems(on motion).

  • Matyas
  • [*][*][*]
H.264 MOD 16 problem
Reply #5
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
  • [*][*][*][*]
H.264 MOD 16 problem
Reply #6
You wont lose SAR by placing h264 in AVI. SAR is part of the video bit stream.
"We cannot win against obsession. They care, we don't. They win."