<div dir="ltr"><div><div><div><div><div>Hi<br><br></div>I have discovered some "features" of h.264 pipelines in Gstreamer 1.1.4, which I didn't see in earlier versions. I'll try to describe it below.<br><br>
</div>In the following we set the following environment variable<br><br></div>RAWVIDEO='video/x-raw, bpp=(int)32, depth=(int)32, endianness=(int)4321, format=(string)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false'<br>
<br></div>Now we run the following pipeline to see all works fine.<br><br>gst-launch-1.0 -v videotestsrc is-live=true !\<br></div>    $RAWVIDEO !\<br><div>    videoconvert !\<br>    x264enc tune=zerolatency !\<br>    fakesink<br>
<br></div><div>All though it works, the similar pipeline for gstreamer-0.10 would encode main profile level 3.1 H.264 stream based on I420 input. Now with 1.1.4 the pipeline will by default for this setup encode the profile high-4:4:4, which is quite different. This is quite unexpected, but technically it may not be considered an error, but rather an annoyance. However it is a complexity that for sure will generate some problems for many because high-4:4:4 will not be supported on many players. High-4:4:4 is a rather advanced and complex little used (in the past) format. Furthermore, it is a bit unclear which high-4:4:4 profile this actually is, but more on that later.<br>
<br>Anyway if we tell the pipeline that we want a main profile, we can do it like this:<br><br>gst-launch-1.0 -v videotestsrc is-live=true !\<br>    $RAWVIDEO !\<br>    videoconvert !\<br>    x264enc tune=zerolatency !\<br>
</div><div>    'video/x-h264, profile=(string)main' !\<br></div><div>    fakesink<br><br></div><div>However that result in the following error messages<br><br>x264 [error]: main profile doesn't support 4:4:4<br>
Redistribute latency...<br>/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = video/x-h264, codec_data=(buffer)01f4001fffe1001a67f4001f91964014016ec044000003000400000300ca3c60c92001000668ebcc448440, stream-format=(string)avc, alignment=(string)au, level=(string)3.1, profile=(string)high-4:4:4, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)25/1<br>
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.<br>Additional debug info:<br>gstbasesrc.c(2857): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:<br>
streaming task paused, reason not-negotiated (-4)<br><br></div><div>Funny. In the previous example it used 4:4:4 successfully. But I assume it insist on 4:4:4 and want to combine this with main profile. Main-4:4:4 is not a profile. Ok, I suspect that the encoder fails to tell videoconvert properly what it can use for input, so lets help it a bit by asking for a I420 input. It OUGHT not be necessary, but lets help it anyway.<br>
<br></div><div>gst-launch-1.0 -v videotestsrc is-live=true !\<br>    $RAWVIDEO !\<br>    videoconvert !\<br></div><div>    'video/x-raw, format=(string)I420' !\<br></div><div>    x264enc tune=zerolatency !\<br><div>
    'video/x-h264, profile=(string)main' !\<br></div>    fakesink<br><br></div><div>Now that actually works, and we get a nice H.264 main profile stream generated from input converted to I420 but I believe the x264enc should have reached that conclusion by it self. If GStreamer gets too many plugins, that can't figure out to request the right input, I fear it will over time grow too complex to use for most.<br>
</div><div><br></div><div>Furthermore, it appear that x264enc uses the word high profile at little bit to carelessly. High Profile and 4:4:4 is many things and for the future we need to be very precise in using these terms. To me at least, it was very unclear which high-4:4:4 profile it claimed it was using successfully and which high-4:4:4 it said it did not support. As such I think letting 'profile=high-4:4:4' cover both Hi444PP and Hi444IP and possibly more (if that is what it is doing) is asking for troubles.<br>
<br></div><div>Kind regards<br></div><div>Peter Maersk-Moller<br></div><div><br></div><div>For your convenience, I here reprint an extract from wikipedia:<br><dl><dt>High Profile (HiP)</dt><dd>The primary profile for broadcast and disc storage applications, 
particularly for high-definition television applications (for example, 
this is the profile adopted by the <a href="http://en.wikipedia.org/wiki/Blu-ray_Disc" title="Blu-ray Disc">Blu-ray Disc</a> storage format and the <a href="http://en.wikipedia.org/wiki/Digital_Video_Broadcasting" title="Digital Video Broadcasting">DVB</a> HDTV broadcast service).</dd>
<dt>Progressive High Profile (PHiP)</dt><dd>Similar to the High profile, but without support of field coding features.</dd><dt>Constrained High Profile</dt><dd>Similar to the Progressive High profile, but without support of B (bi-predictive) slices.</dd>
<dt>High 10 Profile (Hi10P)</dt><dd>Going beyond typical mainstream consumer product capabilities, this 
profile builds on top of the High Profile, adding support for up to 10 
bits per sample of decoded picture precision.</dd><dt>High 4:2:2 Profile (Hi422P)</dt><dd>Primarily targeting professional applications that use interlaced 
video, this profile builds on top of the High 10 Profile, adding support
 for the 4:2:2 <a href="http://en.wikipedia.org/wiki/Chroma_subsampling" title="Chroma subsampling">chroma subsampling</a> format while using up to 10 bits per sample of decoded picture precision.</dd><dt>High 4:4:4 Predictive Profile (Hi444PP)</dt>
<dd>This profile builds on top of the High 4:2:2 Profile, supporting up 
to 4:4:4 chroma sampling, up to 14 bits per sample, and additionally 
supporting efficient lossless region coding and the coding of each 
picture as three separate color planes.</dd></dl>
<p>For camcorders, editing, and professional applications, the standard contains four additional <a href="http://en.wikipedia.org/wiki/Intra-frame" title="Intra-frame">Intra-frame</a>-only
 profiles, which are defined as simple subsets of other corresponding 
profiles. These are mostly for professional (e.g., camera and editing 
system) applications:</p>
<dl><dt>High 10 Intra Profile</dt><dd>The High 10 Profile constrained to all-Intra use.</dd><dt>High 4:2:2 Intra Profile</dt><dd>The High 4:2:2 Profile constrained to all-Intra use.</dd><dt>High 4:4:4 Intra Profile</dt><dd>
The High 4:4:4 Profile constrained to all-Intra use.</dd><dt>CAVLC 4:4:4 Intra Profile</dt></dl></div></div>