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 754504 - vtdec: invalid colorimetry and generating greenish output
vtdec: invalid colorimetry and generating greenish output
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.5.90
Other Mac OS
: Normal blocker
: 1.5.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-03 09:23 UTC by Nikolin Dmitriy
Modified: 2015-09-11 18:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vtdec outputting GL (40.93 KB, application/msword-template)
2015-09-07 14:24 UTC, Jan Schmidt
  Details
vtdec outputting NV12 (86.32 KB, application/msword-template)
2015-09-07 14:24 UTC, Jan Schmidt
  Details
Prefer openGL output if available (3.95 KB, patch)
2015-09-09 04:08 UTC, Jan Schmidt
committed Details | Review
Fix colour rendering for vtdec with GL output (3.13 KB, patch)
2015-09-11 18:10 UTC, Jan Schmidt
committed Details | Review

Description Nikolin Dmitriy 2015-09-03 09:23:25 UTC
sender raspberry pipeline: raspivid -t 0 -w 1024 -h 576 -fps 30 -b 3000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 mtu=1380 ! udpsink host=192.168.0.103 port=6000

receiver iphone pipeline : udpsrc port=6000 ! application/x-rtp, payload=96 ! rtph264depay ! h264parse ! vtdec ! glimagesink

get greenish image: https://dl.dropboxusercontent.com/u/3808405/IMG_2155.PNG 
here is the log: https://dl.dropboxusercontent.com/u/3808405/gstreamer-log.txt

get same result on simulator and real iPhone and iPad. and the sender is does not matter. i try with raspberry ant with rtsp link
Comment 1 Jan Schmidt 2015-09-07 14:05:36 UTC
For me, with a test H.264 file:

playbin uri=rtsp://IP:8554/test -> correct colours, using vtdec

rtspsrc location=rtsp://IP:8554/test ! rtph264depay ! h264parse ! vtdec ! glimagesink -> broken colours.

The broken colour case looks like Cb Cr reversal to me.
Comment 2 Jan Schmidt 2015-09-07 14:12:49 UTC
In the playbin case, vtdec is outputting NV12. Attaching pipeline dumps.
Comment 3 Jan Schmidt 2015-09-07 14:24:10 UTC
Created attachment 310826 [details]
vtdec outputting GL
Comment 4 Jan Schmidt 2015-09-07 14:24:37 UTC
Created attachment 310827 [details]
vtdec outputting NV12
Comment 5 Ilya Konstantinov 2015-09-09 03:58:47 UTC
I'm currently on a prolonged vacation, but I hope to look into this next week.

One thing to try is to test with a non-GL sink such as the avsamplevideosink, to determine whether it's the texture cache support that's misbehaving.
Comment 6 Jan Schmidt 2015-09-09 04:06:43 UTC
If it outputs NV12, it works with GLimagesink - it's only the RGBA/texture cache mode that's broken. I can't see any recent changes there though (not since January), so either it's been broken a while and nobody noticed because it tends to negotiate non-GL output, or something changed in iOS.
Comment 7 Jan Schmidt 2015-09-09 04:08:28 UTC
Created attachment 310944 [details] [review]
Prefer openGL output if available

Here's a patch to break things properly, by preferring opengl output if downstream supports it - avoids things sometimes working because it accidentally negotiates to NV12 even though downstream could take a GL texture directly.
Comment 8 Ilya Konstantinov 2015-09-09 04:09:53 UTC
(About being broken for a while, as a blanket statement, the 'applemedia' stuff doesn't get tested as much as most GStreamer code.)
Comment 9 Sebastian Dröge (slomo) 2015-09-09 06:57:03 UTC
Comment on attachment 310944 [details] [review]
Prefer openGL output if available

Looks good and makes things at least consistent and correct in the negotiation. We should get this in... and if we can't get the texture cache to work, just disable it from the pad template caps.
Comment 10 Jan Schmidt 2015-09-11 06:11:45 UTC
By the way, trying to use avsamplebufferlayersink crashes on iOS in gst_av_sample_video_sink_get_caps() inside CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes() at:

  formats =
      CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes
      (kCFAllocatorDefault);
 
I don't see any obvious reason why that should crash, unless there's some CoreVideo init call that's missing.
Comment 11 Jan Schmidt 2015-09-11 18:10:13 UTC
Created attachment 311171 [details] [review]
Fix colour rendering for vtdec with GL output