Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: H.264 MOD 16 problem (Read 6169 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

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.

Matyas

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.

H.264 MOD 16 problem

Reply #2
I do not know about x264, but cropping can be signalled into the H264 bitstream.

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) [0]


i have no idea how/where all this settings apply.
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

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).

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.

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."