<div dir="ltr"><div>Hi Sebastian.<br><br></div>Thanks for answering. Please see replies inline.<br><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 20, 2013 at 11:31 AM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">On Fr, 2013-12-20 at 02:08 +0100, Peter Maersk-Moller wrote:<br>
> Hi<br>
><br>
> I've come across a problem with alpha values where videoscale in some cases<br>
> seems to affect the alpha value in a not so good way for GStreamer 1.2.0<br>
> (and 1.2.1) in a way that was not the case for version 0.10.<br>
><br>
> When using the following pipeline, the alpha value of each pixels gets set<br>
> to 127, if the content decoded is not 1280x720 and set to 255, if the<br>
> content is 1280x720:<br>
><br>
> /usr/local/bin/gst-launch-1.0 -v filesrc location=../test/pmm2.mp4 !\<br>
>     decodebin !\<br>
>     videoscale !\<br>
>     videoconvert !\<br>
>     'video/x-raw, format=(string)BGRA, width=(int)1280, height=(int)720' !\<br>
>     shmsink socket-path=/tmp/feed1-control-pipe shm-size=50000000<br>
> wait-for-connection=0<br>
<br>
</div>What's the video format that is output by decodebin here?<br></blockquote><div><br></div><div>Ill post the full verbose information later in this email, but the output og decodebin is I420 at 640x360 with PAT 1/1 progressive colorimetry bt601 and rate 24/1<br>
<br>/GstPipeline:pipeline0/GstDecodeBin:decoder.GstDecodePad:src_0.GstProxyPad:proxypad2: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)24/1.<br>
<br></div><div>As a doublecheck I find this to be inline with what videoscale reports for input except that videoscale reports a framerate of 25/1 .... which is a bit odd we don't see any complaints about.<br><br>/GstPipeline:pipeline0/GstVideoScale:videoscale0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1<br>
<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Does it<br>
contain an alpha channel already, and what's the size of the input<br>
video?<br></blockquote><div><br></div><div>No it does not have an alpha channel when leaving decodebin. How could it? I haven't heard of an encoded video with an alpha track saved and to the best of my knowledge, decodebin can not output raw video with an alpha channel nor does it include videoconvert.<br>
<br></div><div>The size of the video is 640x360, but it appear that many, if not all encoded video (all is not checked) smaller than the required 1280x720 will trigger the alpha value to be set at 127 instead of 255 by assuming videoconvert, as videoconvert is adding the alpha channel.<br>
</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Please paste the complete output of gst-launch-1.0 -v in good<br>
(alpha=255) and bad (alpha=127) cases.<br></blockquote><div><br></div><div>Logs will be pasted last in email.<br><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

Can you produce a more simple test case that does not involve shmsink<br>
and a file, or can you make the file available?<br></blockquote><div><br></div><div>I can make the file available, but here is how to produce two samples your self. You can hit ctrl-c after 10 seconds of movie has been produced.<br>
<br>gst-launch-1.0 -e -v videotestsrc pattern=18 is-live=true ! 'video/x-raw, width=1280, height=720, format=I420' ! videoconvert ! x264enc ! 'video/x-h264, profile=main' ! avimux ! filesink location=video1280x720.mp4<br>
<br>gst-launch-1.0 -e -v videotestsrc pattern=18 is-live=true ! 
'video/x-raw, width=1024, height=576, format=I420' ! videoconvert ! 
x264enc ! 'video/x-h264, profile=main' ! avimux ! filesink 
location=video1024x576.mp4<br><br></div><div>Now you can try the following two pipelines:<br><br>gst-launch-1.0 -q filesrc location=video1280x720.mp4 ! decodebin name=decoder ! videoscale ! videoconvert ! 'video/x-raw, format=(string)BGRA, width=(int)1280, height=(int)720' ! fdsink fd=1 |hexdump -c |less<br>
<br>gst-launch-1.0 -q filesrc location=video1024x576.mp4 ! decodebin name=decoder ! videoscale ! videoconvert ! 'video/x-raw, format=(string)BGRA, width=(int)1280, height=(int)720' ! fdsink fd=1 |hexdump -c |less<br>
<br></div><div>From the output you should be able to see that the alpha value is set to 255 and 127 respectively.<br><br></div>Below is my extract from the verbose output of the original pipeline:<br><br>/usr/local/bin/gst-launch-1.0 -v filesrc location=../test/LES_TDS_launch.mp4 do-timestamp=true ! decodebin name=decoder ! videoconvert ! videorate ! videoscale ! videoconvert ! video/x-raw, format=(string)BGRA, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, width=(int)1280, height=(int)720, framerate=(fraction)25/1 ! identity silent=true ! queue ! shmsink socket-path=/tmp/feed1-control-pipe shm-size=77414400 wait-for-connection=0 sync=true decoder. ! queue ! audioconvert ! audioresample ! audio/x-raw, rate=(int)44100, channels=(int)1 ! fdsink fd=3 sync=true<br>
Setting pipeline to PAUSED ...<br>Pipeline is PREROLLING ...<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstTypeFindElement:typefind.GstPad:src: caps = video/quicktime, variant=(string)iso<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstTypeFindElement:typefind.GstPad:src: caps = NULL<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-buffers = 5<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-time = 0<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-bytes = 2097152<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0.GstPad:sink_0: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0.GstPad:src_0: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-buffers = 5<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-time = 0<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0.GstPad:src_0: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-bytes = 2097152<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstAacParse:aacparse0.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)12100000000000000000000000000000, rate=(int)44100, channels=(int)2<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstFaad:faad0.GstPad:sink: caps = audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)12100000000000000000000000000000, rate=(int)44100, channels=(int)2<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstAacParse:aacparse0.GstPad:sink: caps = audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)12100000000000000000000000000000, rate=(int)44100, channels=(int)2<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-buffers = 5<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-time = 0<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-bytes = 2097152<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-buffers = 5<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-time = 0<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-bytes = 2097152<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstFaad:faad0.GstPad:src: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstCapsFilter:capsfilter2.GstPad:src: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/avdec_h264:avdec_h264-0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstCapsFilter:capsfilter2.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, parsed=(boolean)true<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142c01effe100186742c01eda0280bfe584000003000400000300c03c58ba8001000468ce3c80, width=(int)640, height=(int)360, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1<br>
Redistribute latency...<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/avdec_h264:avdec_h264-0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)24/1<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-buffers = 5<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-time = 0<br>/GstPipeline:pipeline0/GstDecodeBin:decoder/GstMultiQueue:multiqueue0: max-size-bytes = 2097152<br>
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003<br>/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003<br>
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps = audio/x-raw, layout=(string)interleaved, rate=(int)44100, format=(string)S16LE, channels=(int)1<br>/GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:src: caps = audio/x-raw, layout=(string)interleaved, rate=(int)44100, format=(string)S16LE, channels=(int)1<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = audio/x-raw, layout=(string)interleaved, rate=(int)44100, format=(string)S16LE, channels=(int)1<br>/GstPipeline:pipeline0/GstFdSink:fdsink0.GstPad:sink: caps = audio/x-raw, layout=(string)interleaved, rate=(int)44100, format=(string)S16LE, channels=(int)1<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = audio/x-raw, layout=(string)interleaved, rate=(int)44100, format=(string)S16LE, channels=(int)1<br>/GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:sink: caps = audio/x-raw, layout=(string)interleaved, rate=(int)44100, format=(string)S16LE, channels=(int)1<br>
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003<br>/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)24/1<br>
/GstPipeline:pipeline0/GstVideoRate:videorate0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1<br>
/GstPipeline:pipeline0/GstVideoScale:videoscale0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1<br>
/GstPipeline:pipeline0/GstVideoConvert:videoconvert1.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstIdentity:identity0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstIdentity:identity0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)BGRA<br>
/GstPipeline:pipeline0/GstVideoConvert:videoconvert1.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1<br>
/GstPipeline:pipeline0/GstVideoScale:videoscale0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1<br>
/GstPipeline:pipeline0/GstVideoRate:videorate0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)24/1<br>
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)24/1<br>
/GstPipeline:pipeline0/GstDecodeBin:decoder.GstDecodePad:src_0.GstProxyPad:proxypad2: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)24/1<br>
Pipeline is PREROLLED ...<br>Setting pipeline to PLAYING ...<br>New clock: GstSystemClock<br><br></div></div></div></div></div>