After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754353 - avidemux/qtdemux: Output raw video in unaligned buffers causing crashing in ORC video conversion code
avidemux/qtdemux: Output raw video in unaligned buffers causing crashing in O...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.4.1
Other Linux
: Normal critical
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-31 11:41 UTC by Sebastian Dröge (slomo)
Modified: 2018-11-03 15:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2015-08-31 11:41:26 UTC
+++ This bug was initially created as a clone of Bug #736965 +++

See discussions there
Comment 1 Nicolas Dufresne (ndufresne) 2017-12-06 03:53:59 UTC
I was thinking about that one, there's no way we can always guaranty an alignment. The video decoder should check the amount of unaligned bytes at the beginning and end of each row and special case it.
Comment 2 Tim-Philipp Müller 2017-12-06 09:44:45 UTC
There is no video decoder here.

I believe we have fixed other elements, e.g. matroskademux, to copy raw video frames to ensure sane alignment if needed.
Comment 3 Sebastian Dröge (slomo) 2017-12-06 10:22:09 UTC
And generally we assume that raw audio and video buffers are properly aligned, everywhere. Producers of such buffers have to ensure that, it's as simple as that.
Comment 4 Nicolas Dufresne (ndufresne) 2017-12-06 12:23:29 UTC
I meant the video converter should check, sorry for the confusion. All elements should check and adapt or copy (doing late copies / last resort). Otherwise the is no room for improvement.

I agree that in case we don't know (demuxer) and that we have to copy anyway, choosing a large alignment is probably best. But I don't agree that all elements should enforce 32bytes alignment.
Comment 5 Sebastian Dröge (slomo) 2017-12-06 12:35:56 UTC
The minimum alignment is always the "unit size" of the content (32 bit raw audio samples => 4 bytes), or the alignment requirement for any SIMD instructions on the target platform, whichever is bigger. 32 bytes covers that for now, except for 512 bit AVX :)
Comment 6 Nicolas Dufresne (ndufresne) 2017-12-06 12:44:33 UTC
For audio it's a good rationale, for video it is not. We can't define something that depends on the possible use of hardware specific SIMD and blindly say we fixed the issue.

Good examples, you have no control over what v4l devices will aligned to. It might be very high bitrate, and SIMD might never be used with it. Are we going to copy in the source, all the time ? That's basically what this tentative rule is suggesting.

We should fix our converters to special case the non aligned portions, we already do in many cases. This is the same thing inside memcpy.
Comment 7 Jan Alexander Steffens (heftig) 2017-12-06 12:51:10 UTC
Alignment requirements might be a case for caps negotiation?
Comment 8 Nicolas Dufresne (ndufresne) 2017-12-06 13:06:07 UTC
They are partially in the allocation query, which our current design cannot be performed by non-threaded demuxers.
Comment 9 Nicolas Dufresne (ndufresne) 2017-12-06 13:09:34 UTC
Also, they are not really meant to be authoritative. The reason is that it moves the copy upstream, in places where one will not intuitively think it's needed. There's is a benefit to handle it upstream when supported, because it could save an extra copy of upstream is already making a copy in some form.
Comment 10 GStreamer system administrator 2018-11-03 15:03:40 UTC
-- 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-good/issues/216.