Issue with openh264enc

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

Issue with openh264enc

Andoni Galdos

I am trying to stream over TCP encoded video into a EC2 Instance. Using "x264enc" encoder, all works correctly. I get the frames and generate the video correctly.

The issue comes when I try to use the "openh264enc" encoder.

If I put in the server "nc -l -p 5555" I can check that data is arriving into the port but when I put the pipeline goes to PREROLLING state and nothing more happens. If I cut the process in the sender, this message appears in the server:

ubuntu@ip-172-31-87-56:~$ gst-launch-1.0 -e -v tcpserversrc host=ec2-52-29-128-23.eu-central-1.compute.amazonaws.com port=5555 ! h264parse ! mpegtsmux ! filesink location=file.ts

Setting pipeline to PAUSED ...

/GstPipeline:pipeline0/GstTCPServerSrc:tcpserversrc0: current-port = 5555

Pipeline is PREROLLING ...

ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: No valid frames found before end of stream

Additional debug info:

gstbaseparse.c(1281): gst_base_parse_sink_event_default (): /GstPipeline:pipeline0/GstH264Parse:h264parse0

ERROR: pipeline doesn't want to preroll.

Setting pipeline to NULL ...

/GstPipeline:pipeline0/GstTCPServerSrc:tcpserversrc0: current-port = 0

Freeing pipeline ...


Pipeline used in the EC2 Instance, the server:

    gst-launch-1.0 -e -v tcpserversrc host=ec2-52-29-128-23.eu-central-1.compute.amazonaws.com port=5555 ! h264parse ! mpegtsmux ! filesink location=file.ts

Sender pipeline with x264enc:

    gst-launch-1.0 -e videotestsrc horizontal-speed=5 ! x264enc ! tcpclientsink port=5555 host=52.29.128.23

Sender pipeline with openh264enc:

    gst-launch-1.0 -e videotestsrc horizontal-speed=5 ! openh264enc ! tcpclientsink port=5555 host=52.29.128.23


Why is this happening? how can I solve it?


Andoni Galdos.


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

Re: Issue with openh264enc

Sebastian Dröge-3
On Di, 2016-09-20 at 16:22 +0200, Andoni Galdos wrote:

>
> [...]
> Sender pipeline with x264enc:
>
>     gst-launch-1.0 -e videotestsrc horizontal-speed=5 ! x264enc !
> tcpclientsink port=5555 host=52.29.128.23
>
> Sender pipeline with openh264enc:
>
>     gst-launch-1.0 -e videotestsrc horizontal-speed=5 ! openh264enc !
> tcpclientsink port=5555 host=52.29.128.23
>
>
>
> Why is this happening? how can I solve it?
openh264enc (in 1.8 and before) creates h264 in the AVC stream-format,
which is not streamable without a container. You have to add a
h264parse element after the encoder, and then force it to byte-stream,
e.g.

... ! openh264enc ! h264parse ! video/x-h264,stream-format=byte-stream ! ...

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with openh264enc

Andoni Galdos
Thanks, with the pipeline you proposed it worked.


Andoni Galdos.

On Tue, Sep 20, 2016 at 4:32 PM, Sebastian Dröge <[hidden email]> wrote:
On Di, 2016-09-20 at 16:22 +0200, Andoni Galdos wrote:
>
> [...]
> Sender pipeline with x264enc:
>
>     gst-launch-1.0 -e videotestsrc horizontal-speed=5 ! x264enc !
> tcpclientsink port=5555 host=52.29.128.23
>
> Sender pipeline with openh264enc:
>
>     gst-launch-1.0 -e videotestsrc horizontal-speed=5 ! openh264enc !
> tcpclientsink port=5555 host=52.29.128.23
>
>
>
> Why is this happening? how can I solve it?

openh264enc (in 1.8 and before) creates h264 in the AVC stream-format,
which is not streamable without a container. You have to add a
h264parse element after the encoder, and then force it to byte-stream,
e.g.

... ! openh264enc ! h264parse ! video/x-h264,stream-format=byte-stream ! ...

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.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