[FFmpeg-user] Loss of anamorphic aspect ration in conversion from MKV/H264 to MpegTS/H264

Mike Scheutzow mike.scheutzow at alcatel-lucent.com
Wed May 16 14:42:19 CEST 2012

Ulrik Mikaelsson wrote:
> Hi,
> I have got a bunch of MKV/H264 files that I would like to
> format-convert to MpegTS, but I'm failing to maintain the anamorphic
> aspect ratio.
> ...
> Now I wonder, are there some limitations to h264 in MpegTS that
> prevents anamorphic resolutions? I've tried reading the H264 specs,
> including Annex B, and while I did find some references, it's a lot to
> take in at once, so I reached no definite conclusion.
> Or am I doing something wrong?
> Best Regards
> / Ulrik

At the container level, mpegts does not support specifying a video 
aspect ratio. It's assumed that the video elementary stream takes care 
of that.

In h.264 elementary stream, aspect ratio is optional. If you have the 
standard, see appendix E.1.1, "aspect_ratio_idc".

It seems your original streams don't contain this field. If you want 
this to work in mpegts, you'll need a tool that inserts this information 
in the elementary stream itself.

I'm not aware of such a tool. You could re-encode, of course.

Mike Scheutzow

More information about the ffmpeg-user mailing list