GNOME Bugzilla – Bug 637297
mpeg2enc: fails to encode exotic video sizes
Last modified: 2018-11-03 13:07:03 UTC
Steps to reproduce: gst-launch-0.10 videotestsrc num_buffers=100 ! "video/x-raw-yuv, width=570, height=322" ! mpeg2enc ! mplex ! filesink location=res.mpg Then play it with totem, vlc or mplayer. The video is not correct. It seems to be a stride or colorspace conversion problem. Other infos: It's ok with 320*240, 640*480 ...
As much as a copout it is, I'm tempted to say "not gstreamer". Using mjpegtools' mpeg2enc (which is what gstreamer's mpeg2enc element uses) also doesn't get it right, and it triggers lots of valgrind reports (somewhat less of them when using a nice size like 256x256, which lends credence to the theory that it doesn't like weird sizes). Also, luma seems correct, it's only chroma that's using a bad stride. I've tried various hardcoded strides to see if anyone of them actually worked, and none does. So the issue is more complicated that just bad stride calculation, though it seems closely related.
According to the Mpeg2 standard there is limited number of supported video sizes. See: http://en.wikipedia.org/wiki/MPEG-2 - Allowed Resolutions . ie. ATSC: 1920 × 1080 pixel (16:9, square pixels), at 30p, 29.97p, 24p, 23.976p, 60i, 59.94i. 1280 × 720 pixel (16:9, square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, or 23.976p 704 × 480 pixel (4:3 or 16:9, non-square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.976p, 60i, or 59.94i 640 × 480 pixel (4:3, square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.976p, 60i, or 59.94i I think a message from the encoder saying: video size not supported or invalid should be emitted in this case.
(In reply to comment #2) > According to the Mpeg2 standard there is limited number of supported video > sizes. > See: http://en.wikipedia.org/wiki/MPEG-2 - Allowed Resolutions . This is not correct. mpeg2enc doesn't encode all sizes because it is buggy. The correct behavior for the element is to call GST_ELEMENT_ERROR() when an unhandled size is requested.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/30.