<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 26, 2016 at 8:39 PM, Mateusz Brzostek <span dir="ltr"><<a href="mailto:mateusz@msystem.waw.pl" target="_blank">mateusz@msystem.waw.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>I've based on FFmpeg -- if you execute wrong pixel format for
y4m, for example:<br>
ffmpeg -i 720p50_parkrun_ter.y4m -pix_fmt monow -f yuv4mpegpipe
w.y4m</p>
<p>you can see error message:<br>
ERROR: yuv4mpeg can only handle yuv444p, yuv422p, yuv420p, yuv411p
and gray8 pixel formats.<br>
And using 'strict -1' also yuv444p9, yuv422p9, yuv420p9,
yuv444p10, yuv422p10, yuv420p10, <br>
yuv444p12, yuv422p12, yuv420p12, yuv444p14, yuv422p14, yuv420p14,
yuv444p16, yuv422p16, <br>
yuv420p16 and gray16 pixel formats. Use -pix_fmt to select one.</p>
<p>For gray8 and gray16 the y4m header has mono and mono16 strings.</p>
<p>I found also mjpeg (yuv4mpeg creator?):<br>
<a class="m_-8821727779598355640moz-txt-link-freetext" href="http://mjpeg.cvs.sourceforge.net/viewvc/mjpeg/mjpeg_play/utils/yuv4mpeg.h?revision=1.28&view=markup" target="_blank">http://mjpeg.cvs.sourceforge.<wbr>net/viewvc/mjpeg/mjpeg_play/<wbr>utils/yuv4mpeg.h?revision=1.<wbr>28&view=markup</a><br>
-- see line 641.</p></div></blockquote><div>Thanks for the pointer. I will test and push this patch. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<p>Mateusz<br>
</p>
<br>
<div class="m_-8821727779598355640moz-cite-prefix">W dniu 2016-10-25 o 06:18, Pradeep
Ramachandran pisze:<br>
</div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Sun, Oct 16, 2016 at 11:17 PM,
Mateusz <span dir="ltr"><<a href="mailto:mateusz@msystem.waw.pl" target="_blank">mateusz@msystem.waw.pl</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">This patch fixes issue
#282.<br>
<br>
# HG changeset patch<br>
# User Ma0 <<a href="mailto:mateuszb@poczta.onet.pl" target="_blank">mateuszb@poczta.onet.pl</a>><br>
# Date 1476639059 -7200<br>
# Sun Oct 16 19:30:59 2016 +0200<br>
# Node ID f49487ee92a296a36938dfb92b7b51<wbr>c9fb7f2ff9<br>
# Parent c97805dad9148ad3cddba10a67ed55<wbr>96508e8f86<br>
CLI: allow 'mono' & 'mono16' color space for y4m input<br>
<br>
diff -r c97805dad914 -r f49487ee92a2 source/input/y4m.cpp<br>
--- a/source/input/y4m.cpp Thu Oct 13 17:53:48 2016
+0800<br>
+++ b/source/input/y4m.cpp Sun Oct 16 19:30:59 2016
+0200<br>
@@ -280,7 +280,7 @@<br>
{<br>
c = ifs->get();<br>
<br>
- if (c <= '9' && c >=
'0')<br>
+ if (c <= 'o' && c >=
'0')<br>
csp = csp * 10 + (c - '0');<br>
else if (c == 'p')<br>
{<br>
@@ -300,9 +300,23 @@<br>
break;<br>
}<br>
<br>
- if (d >= 8 && d <= 16)<br>
- depth = d;<br>
- colorSpace = (csp == 444) ? X265_CSP_I444
: (csp == 422) ? X265_CSP_I422 : X265_CSP_I420;<br>
+ switch (csp)<br>
+ {<br>
+ case ('m'-'0')*100000 + ('o'-'0')*10000 +
('n'-'0')*1000 + ('o'-'0')*100 + 16:<br>
+ colorSpace = X265_CSP_I400;<br>
+ depth = 16;<br>
+ break;<br>
+<br>
+ case ('m'-'0')*1000 + ('o'-'0')*100 +
('n'-'0')*10 + ('o'-'0'):<br>
+ colorSpace = X265_CSP_I400;<br>
+ depth = 8;<br>
+ break;<br>
+<br>
+ default:<br>
+ if (d >= 8 && d <= 16)<br>
+ depth = d;<br>
+ colorSpace = (csp == 444) ?
X265_CSP_I444 : (csp == 422) ? X265_CSP_I422 :
X265_CSP_I420;<br>
+ }<br>
</blockquote>
<div><br>
</div>
<div>Do you have a pointer to the definition of the Y4M
headers? From the description on wikipedia (<a href="https://wiki.multimedia.cx/index.php?title=YUV4MPEG2" target="_blank">https://wiki.multimedia.cx/<wbr>index.php?title=YUV4MPEG2</a>),
I don't see the mono or mono16 string additions for the
csp.</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">
break;<br>
<br>
default:<br>
@@ -324,7 +338,7 @@<br>
if (width < MIN_FRAME_WIDTH || width >
MAX_FRAME_WIDTH ||<br>
height < MIN_FRAME_HEIGHT || height >
MAX_FRAME_HEIGHT ||<br>
(rateNum / rateDenom) < 1 || (rateNum /
rateDenom) > MAX_FRAME_RATE ||<br>
- colorSpace <= X265_CSP_I400 || colorSpace
>= X265_CSP_COUNT)<br>
+ colorSpace < X265_CSP_I400 || colorSpace >=
X265_CSP_COUNT)<br>
return false;<br>
<br>
return true;<br>
<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/l<wbr>istinfo/x265-devel</a><br>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset class="m_-8821727779598355640mimeAttachmentHeader"></fieldset>
<br>
<pre>______________________________<wbr>_________________
x265-devel mailing list
<a class="m_-8821727779598355640moz-txt-link-abbreviated" href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a>
<a class="m_-8821727779598355640moz-txt-link-freetext" href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a>
</pre>
</blockquote>
<br>
</div></div></div>
<br>______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br></blockquote></div><br></div></div>