x264enc appears to not set byte-stream correctly

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

x264enc appears to not set byte-stream correctly

Andres Gonzalez
Hi,

Using a pipeline with x264enc like this:       ......   ! x264enc byte-stream=true !   .....

apparently does not set the format correctly. This is the gst-launch -vv output:

/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = "video/x-raw\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ framerate\=\(fraction\)30/1\,\ format\=\(string\)Y42B\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
Redistribute latency...
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = "video/x-h264\,\ codec_data\=\(buffer\)017a0028ffe1001b677a0028bcd940780227e270110000030001000003003c8f18319601000568ebecb22c\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)4\,\ profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"

Am I interpreting this correctly?   I would think the stream-format should be byte-stream and not avc.

Thanks,

-Andres
Reply | Threaded
Open this post in threaded view
|

Re: x264enc appears to not set byte-stream correctly

Carlos Rafael Giani
I have observed this as well. Try adding a caps filter just after
x264enc, like this:

... ! x264enc byte-stream=true ! "video/x-h264,
stream-format=byte-stream" ! ...

This produces byte-stream output.


On 2016-08-04 17:07, Andres Gonzalez wrote:

> Hi,
>
> Using a pipeline with x264enc like this:       ......   ! x264enc
> byte-stream=true !   .....
>
> apparently does not set the format correctly. This is the gst-launch -vv
> output:
>
> /GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps =
> "video/x-raw\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\
> framerate\=\(fraction\)30/1\,\ format\=\(string\)Y42B\,\
> pixel-aspect-ratio\=\(fraction\)1/1\,\
> interlace-mode\=\(string\)progressive"
> Redistribute latency...
> /GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps =
> "video/x-h264\,\
> codec_data\=\(buffer\)017a0028ffe1001b677a0028bcd940780227e270110000030001000003003c8f18319601000568ebecb22c\,\
> *stream-format\=\(string\)avc\,*\ alignment\=\(string\)au\,\
> level\=\(string\)4\,\ profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\
> height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\
> framerate\=\(fraction\)30/1"
>
> Am I interpreting this correctly?   I would think the stream-format should
> be byte-stream and not avc.
>
> Thanks,
>
> -Andres
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/x264enc-appears-to-not-set-byte-stream-correctly-tp4678963.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: x264enc appears to not set byte-stream correctly

Andres Gonzalez
Carlos, thank you for your reply and suggestion...it worked....sort of....

I added the capsfilters and indeed the src pad on x264enc is now correct:

/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ level\=\(string\)4\,\ profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"

However, the next element in my pipeline is an h264parse, and it changes it back to avc:

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)au\,\ level\=\(string\)4\,\ profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)4\,\ profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\ codec_data\=\(buffer\)017a0028ffe1001b677a0028bcd940780227e270110000030001000003003c8f18319601000568ebecb22c"

So it appears that the h264parse element has a mind of its own and for some reason wants/requires avc.

I also tried adding an additional queue element before the h264parse element but it still changed back to avc.

-Andres
Reply | Threaded
Open this post in threaded view
|

Re: x264enc appears to not set byte-stream correctly

Carlos Rafael Giani
Try the same trick with the capsfiler. Perhaps h264parse does not try to
retain the same caps as much as possible, and just picks the first
stream format that is available.


On 2016-08-04 19:03, Andres Gonzalez wrote:

> Carlos, thank you for your reply and suggestion...it worked....sort of....
>
> I added the capsfilters and indeed the src pad on x264enc is now correct:
>
> /GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps =
> "video/x-h264\,\ *stream-format\=\(string\)byte-stream*\,\
> alignment\=\(string\)au\,\ level\=\(string\)4\,\
> profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\
> height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\
> framerate\=\(fraction\)30/1"
>
> However, the next element in my pipeline is an h264parse, and it changes it
> back to avc:
>
> /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
> "video/x-h264\,\ *stream-format\=\(string\)byte-stream*\,\
> alignment\=\(string\)au\,\ level\=\(string\)4\,\
> profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\
> height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\
> framerate\=\(fraction\)30/1"
> /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps =
> "video/x-h264\,\ *stream-format\=\(string\)avc*\,\
> alignment\=\(string\)au\,\ level\=\(string\)4\,\
> profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\
> height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\
> framerate\=\(fraction\)30/1\,\ parsed\=\(boolean\)true\,\
> codec_data\=\(buffer\)017a0028ffe1001b677a0028bcd940780227e270110000030001000003003c8f18319601000568ebecb22c"
>
> So it appears that the h264parse element has a mind of its own and for some
> reason wants/requires avc.
>
> I also tried adding an additional queue element before the h264parse element
> but it still changed back to avc.
>
> -Andres
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/x264enc-appears-to-not-set-byte-stream-correctly-tp4678963p4678966.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: x264enc appears to not set byte-stream correctly

Andres Gonzalez
the pipeline looks like this:           .... h264parse ! queue ! matroskamux  .....

when I put the capsfilter after the h264parse element, the pipeline won't link:

WARNING: erroneous pipeline: could not link queue1 to matroskamux0

this is the caps I used:    video/x-h264,stream-format=byte-stream

BTW, I am using release 1.8.0

-Andres
Reply | Threaded
Open this post in threaded view
|

Re: x264enc appears to not set byte-stream correctly

Nicolas Dufresne-4
In reply to this post by Andres Gonzalez


Le 2016-08-04 12:02, "Andres Gonzalez" <[hidden email]> a écrit :
>
> Hi,
>
> Using a pipeline with x264enc like this:       ......   ! x264enc
> byte-stream=true !   .....
>
> apparently does not set the format correctly. This is the gst-launch -vv
> output:
>
> /GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps =
> "video/x-raw\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\
> framerate\=\(fraction\)30/1\,\ format\=\(string\)Y42B\,\
> pixel-aspect-ratio\=\(fraction\)1/1\,\
> interlace-mode\=\(string\)progressive"
> Redistribute latency...
> /GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps =
> "video/x-h264\,\
> codec_data\=\(buffer\)017a0028ffe1001b677a0028bcd940780227e270110000030001000003003c8f18319601000568ebecb22c\,\
> *stream-format\=\(string\)avc\,*\ alignment\=\(string\)au\,\
> level\=\(string\)4\,\ profile\=\(string\)high-4:2:2\,\ width\=\(int\)1920\,\
> height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\
> framerate\=\(fraction\)30/1"
>
> Am I interpreting this correctly?   I would think the stream-format should
> be byte-stream and not avc.

Use caps filter downstream to select the stream-format. This property is deprecated and may not work as expected.

>
> Thanks,
>
> -Andres
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/x264enc-appears-to-not-set-byte-stream-correctly-tp4678963.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: x264enc appears to not set byte-stream correctly

Mailing List SVR
In reply to this post by Andres Gonzalez
Il 04/08/2016 21:03, Andres Gonzalez ha scritto:
> the pipeline looks like this:           .... h264parse ! queue ! matroskamux

matroskamux requires avc, gst-inspect-1.0 matroskamux for details,

Nicola

> .....
>
> when I put the capsfilter after the h264parse element, the pipeline won't
> link:
>
> WARNING: erroneous pipeline: could not link queue1 to matroskamux0
>
> this is the caps I used:    video/x-h264,stream-format=byte-stream
>
> BTW, I am using release 1.8.0
>
> -Andres
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/x264enc-appears-to-not-set-byte-stream-correctly-tp4678963p4678970.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: x264enc appears to not set byte-stream correctly

Andres Gonzalez
Nicola,
Thanks for pointing that out to me.  This is another case of very old and out-dated example code found online thru google.  When I started using matroskamux I searched for example code and found SEVERAL code example where someone had commented that "matroskamux requires byte-stream not avc."   So I took that as gospel truth.

The lesson learned is again, I should not believe every thing google tells me.

-Andres