<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">> avenc_mjpeg does support GRAY16_BE/LE, but I don't know how to make it lossless.<br>
<br>
My mistake, avdec_mjpeg supports GRAY16_BE/LE, the encoder only supports I420,Y42B, and Y444.  The conversion from GRAY16_LE->I420 seems to be lossless, so that's good.  The trouble I'm running into now, though, is that avenc_ljpeg doesn't seem to want to accept
 YUV-colorspace buffers, even though its sink pad template says it can:<br>
<br>
Pad Templates:<br>
  SINK template: 'sink'<br>
    Availability: Always<br>
    Capabilities:<br>
      video/x-raw<br>
                 format: { BGR, BGRA, I420, Y444, Y42B }<br>
<br>
This pipeline works fine:<br>
gst-launch-1.0 -vvv filesrc location=source.g16 ! videoparse width=640 height=480 format=27 framerate=30/1 ! video/x-raw,format=GRAY16_LE,width=640,height=480,framerate=30/1 ! videoconvert ! video/x-raw,format=BGR ! avenc_ljpeg ! filesink location=losslessgr16.mjpg<br>
<br>
This does not:<br>
gst-launch-1.0 -vvv filesrc location=source.g16 ! videoparse width=640 height=480 format=27 framerate=30/1 ! video/x-raw,format=GRAY16_LE,width=640,height=480,framerate=30/1 ! videoconvert ! video/x-raw,format=I420 ! avenc_ljpeg ! filesink location=losslessgr16.mjpg<br>
Setting pipeline to PAUSED ...<br>
Pipeline is PREROLLING ...<br>
/GstPipeline:pipeline0/GstVideoParse:videoparse0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)GRAY16_LE\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)1:4:0:0\,\
 framerate\=\(fraction\)30/1"<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)GRAY16_LE\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)1:4:0:0\,\
 framerate\=\(fraction\)30/1"<br>
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = "video/x-raw\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ format\=\(string\)I420"<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = "video/x-raw\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ format\=\(string\)I420"<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = "video/x-raw\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ format\=\(string\)I420"<br>
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)GRAY16_LE\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)1:4:0:0\,\
 framerate\=\(fraction\)30/1"<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)GRAY16_LE\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ colorimetry\=\(string\)1:4:0:0\,\
 framerate\=\(fraction\)30/1"<br>
ERROR: from element /GstPipeline:pipeline0/GstVideoParse:videoparse0: Internal data stream error.<br>
Additional debug info:<br>
gstrawparse.c(487): gst_raw_parse_loop (): /GstPipeline:pipeline0/GstVideoParse:videoparse0:<br>
stream stopped, reason not-negotiated<br>
ERROR: pipeline doesn't want to preroll.<br>
Setting pipeline to NULL ...<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = "NULL"<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = "NULL"<br>
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = "NULL"<br>
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = "NULL"<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "NULL"<br>
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "NULL"<br>
/GstPipeline:pipeline0/GstVideoParse:videoparse0.GstPad:src: caps = "NULL"<br>
Freeing pipeline ...<br>
<br>
Is this a bug in avenc_ljpeg, or did I not constrain the caps correctly?<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF841047" style="direction: ltr;"><font size="2" color="#000000" face="Tahoma"><b>From:</b> gstreamer-devel [gstreamer-devel-bounces@lists.freedesktop.org] on behalf of Ryan Talbot [rtalbot@vtti.vt.edu]<br>
<b>Sent:</b> Friday, February 3, 2017 11:12 AM<br>
<b>To:</b> gstreamer-devel@lists.freedesktop.org<br>
<b>Subject:</b> Lossless end-to-end 16-bit grayscale compression?<br>
</font><br>
</div>
<div></div>
<div>
<table id="msexchangesafetytips;843a11a5-872f-4a5a-dec9-08d44c52131e;T:en-US" style="border:0; display:table; width:100%; table-layout:fixed; border-collapse:seperate" width="100%" cellspacing="0" cellpadding="0" border="0" align="left">
<tbody>
<tr>
<td cellpadding="7px 2px 7px 2px" style="padding:7px 2px 7px 2px; background-color:#910A19" width="1px" valign="middle" bgcolor="#910A19">
</td>
<td cellpadding="7px 5px 7px 15px" color="#212121" style="width:100%; background-color:#FDF2F4; padding:7px 5px 7px 15px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word" width="100%" valign="middle" bgcolor="#FDF2F4">
This sender failed our fraud detection checks and may not be who they appear to be. Learn about <a href="http://aka.ms/LearnAboutSpoofing" target="_blank">spoofing</a></td>
<td cellpadding="7px 5px 7px 5px" color="#212121" style="width:75px; background-color:#FDF2F4; padding:7px 5px 7px 5px; font-family:wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif; font-size:12px; font-weight:normal; color:#212121; text-align:left; word-wrap:break-word" width="75px" valign="middle" bgcolor="#FDF2F4" align="left">
<a href="http://aka.ms/SafetyTipsFeedback" target="_blank">Feedback</a></td>
</tr>
</tbody>
</table>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi list,<br>
<br>
I'm trying to losslessy compress the output of the disparity plugin.  Its source caps say it outputs RGB, but the algorithm itself is supposed to generate 16-bit grayscale.  After a lot of headache, I finally found a combo of avenc_ljpeg and avdec_mjpeg that
 would work to encode and then decode the RGB stream and get the exact same data on both ends.  Now, I would like to do the same for a 16-bit grayscale stream of images, but am having little luck.  avenc_mjpeg does support GRAY16_BE/LE, but I don't know how
 to make it lossless.<br>
<br>
Does such a solution exist, or do we need to roll our own/modify a codec?<br>
<br>
Thanks,<br>
Ryan Talbot<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>