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 747225 - video-converter: doesn't work properly with GRAY16/ARGB64/16bpp formats
video-converter: doesn't work properly with GRAY16/ARGB64/16bpp formats
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other Linux
: Normal normal
: 1.8.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-02 08:07 UTC by RaviKiran
Modified: 2016-09-22 14:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use stride for memcpy (1.22 KB, patch)
2015-04-02 08:09 UTC, RaviKiran
rejected Details | Review
use slow path for both GRAY16_LE and _BE (1.16 KB, patch)
2015-04-02 08:19 UTC, RaviKiran
none Details | Review
other possible patch (1013 bytes, patch)
2016-09-22 11:29 UTC, Vincent Penquerc'h
none Details | Review

Description RaviKiran 2015-04-02 08:07:08 UTC
Using video-converter when input and output frames are GRAY16_LE (or _BE) and no scaling required, only half of the each row data is copied to destination frame.
Comment 1 RaviKiran 2015-04-02 08:09:46 UTC
Created attachment 300794 [details] [review]
use stride for memcpy

Patch attached. Please review.
Comment 2 RaviKiran 2015-04-02 08:19:50 UTC
Created attachment 300796 [details] [review]
use slow path for both GRAY16_LE and _BE

Another patch attached for slow path for gray16. Please review (also let me know if I should squash both)
Comment 3 Tim-Philipp Müller 2015-04-03 11:29:28 UTC
Comment on attachment 300794 [details] [review]
use stride for memcpy

This does not seem right to me. Do you have a gst-launch pipeline or unit test that demonstrates the issue?
Comment 4 RaviKiran 2015-04-04 14:02:29 UTC
Perhaps I should mention non-passthrough mode. I tried with videobox (with patch attached in bug 737401) with border (any side).
But, if you explicitly disable passthrough in videoconvert element's set_info, you can reproduce with following pipeline too:
 gst-launch-1.0 videotestsrc ! "video/x-raw,format={GRAY16_LE}" ! videoconvert ! "video/x-raw,format={GRAY16_LE}" ! videoconvert ! ximagesink

In gst_video_scaler_2d, n_elems and width multiplier will be 1 for GRAY16 formats. So, for no-scaling case, bytes to memcpy will be 320 instead of 640. I'm not sure about changing the width multiplier ex: 2 for GRAY16, as it causes problems while scaling (like crash in video_scale_h_ntap_u16). 

In gst_video_scaler_2d no-scaling case, since src_stride = dest_stride, I used stride for memcpy. For other cases, vscale or hscale will not be NULL.

Let me know if I got something wrong. Thanks.
Comment 5 Tim-Philipp Müller 2016-01-19 17:17:35 UTC
> you can reproduce with following pipeline too:
>  gst-launch-1.0 videotestsrc ! "video/x-raw,format={GRAY16_LE}" !
> videoconvert ! "video/x-raw,format={GRAY16_LE}" ! videoconvert ! ximagesink

I can't reproduce this with this pipeline. Do you still get the issue, with current git master?
Comment 6 Tim-Philipp Müller 2016-05-22 19:49:31 UTC
Ravi?
Comment 7 RaviKiran 2016-05-23 16:08:13 UTC
If you explicitly disable passthrough mode in videoconvert element as mentioned above, you can still reproduce with that pipeline. (Or with videobox patch )
Comment 8 Tim-Philipp Müller 2016-05-24 19:25:59 UTC
I can reproduce this after setting passthrough_on_same_caps=FALSE in class_init.

The same happens with ARGB64 fwiw. Basically it doesn't take into account the bits per element or pstride.
Comment 9 Tim-Philipp Müller 2016-05-24 19:27:25 UTC
Comment on attachment 300794 [details] [review]
use stride for memcpy

Using the stride does not seem right to me. It's possible that the padding is much larger than the row pixel data, we only want to copy actual pixels.
Comment 10 Vincent Penquerc'h 2016-09-22 11:29:48 UTC
Created attachment 336075 [details] [review]
other possible patch

The semantics of all the parameters get_functions returns isn't very clear, but I think that's a possible patch for this. It certainly fixes this case.
Comment 11 Tim-Philipp Müller 2016-09-22 14:21:14 UTC
I had a similar patch locally, but I think ideally the internal API should be fixed and/or documented, otherwise we just pile weird on top of what-the :)
Comment 12 Wim Taymans 2016-09-22 14:22:14 UTC
commit 7a02e9676f8ff61e912c8a4c09b1b89d1edfc082
Author: Wim Taymans <wtaymans@redhat.com>
Date:   Thu Sep 22 16:15:54 2016 +0200

    video-scaler: take number of bits into account when copying
    
    Copy twice the amount of pixels for 16 bits formats.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=747225