<div dir="ltr"><div><div><div>Hi All<br><br></div>So figured it out...i used the GST_DEBUG_DUMP_DOT_DIR facility to debug the problem.<br></div>Here's how for anyone who may be interested (probably everyone knows this but i'm not overly familiar with gstreamer debug etc):<br>
<br>By accident i noticed that if i included a timeoverlay element in the pipeline then suddenly the image was perfect.<br></div>So ran this to generate the debug for the case that has the issue:<br><br>GST_DEBUG_DUMP_DOT_DIR=/tmp/ gst-launch -e v4l2src device=/dev/video1 norm=PAL ! ffmpegcolorspace ! pngenc snapshot=true ! filesink location="frame.png"<br>
<br><div>And this for the case that doesnt have the issue:<br><br>GST_DEBUG_DUMP_DOT_DIR=/tmp/ gst-launch -e v4l2src device=/dev/video1 norm=PAL ! ffmpegcolorspace ! timeoverlay halign=right valign=bottom ! ffmpegcolorspace ! pngenc snapshot=true ! filesink location="frame.png"<br>
<br></div><div>Each of these generates a series of .dot files.<br></div><div>I then chose the PLAYING_PAUSED dot file for each and converted it to an image using graphviz (on fedora this was by running yum install graphviz) as follows:<br>
<br>dot -Tpng 0.00.00.357054443-gst-launch.PLAYING_PAUSED.dot > not-working-pipeline.png <br>dot -Tpng 0.00.00.701629385-gst-launch.PLAYING_PAUSED.dot > working-pipeline.png<br><br></div><div>Then displayed the images and looked for differences in what pngenc was being given.<br>
</div><div>I noticed that the format being forwarded to the pngenc in each case was different.<br></div><div>So i began to force the format after the v4l2src element bit by bit until the image colors were fixed.<br>Turns out it was the bit depth (bpp) in my case that was the culprit so this was the fix:<br>
<br><b>v4l2src device=/dev/video1 norm=PAL ! ffmpegcolorspace ! valve 
name=video_capture_valve drop=true ! videoscale ! video/x-raw-rgb, 
bpp=24, width=720, height=576, pixel-aspect-ratio=1/1 ! pngenc snapshot=true 
compression-level=1 ! filesink location="myimage.png"</b><br><br></div><div>Hope this helps anyone else...<br><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 11, 2014 at 10:11 AM, anno domini <span dir="ltr"><<a href="mailto:genericgroupmail@gmail.com" target="_blank">genericgroupmail@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Hi All,<br><br></div>I am using gstreamer bindings within a python script to generate an individual snapshot of the display from various video capture devices.<br>
<br>
</div>I had been using pngenc to produce the snapshots with success with easycap cards and decklink/intensity pro cards.<br><br></div>However, when we tried it on a different video capture device (bt878 card) i noticed all the snapshots had strange colors.<br>

<br></div>This is the pipeline i was using:<br><br><b>v4l2src device=/dev/video1 norm=PAL ! ffmpegcolorspace ! valve name=video_capture_valve drop=true ! videoscale ! video/x-raw-rgb, width=720, height=576, pixel-aspect-ratio=1/1 ! pngenc snapshot=true compression-level=1 ! filesink location="myimage.png"</b><br>

<br></div>(In case you are wondering, the valve is used to delay capture for a few seconds because the intensity pro card seemed to produce several poor frames at the start).<br><br></div>I couldn't figure out what the problem was so i opted to use the jpegenc instead which appeared to work for all the cards i.e. no funny colors with the BT878 card. However, unfortunately this wasn't a valid solution because this was producing very poor quality snapshots.<br>

<br></div>Can anyone suggest what may be causing the funny colors with the pngenc and the BT878 video capture card??<br><br></div>Thanks!<br></div>
</blockquote></div><br></div>