Snec / gst-gz

GStreamer plugin for gzip and zlib compression and decompression.
GNU Lesser General Public License v2.1
3 stars 1 forks source link

Encode decode not working in H264 pipeline. #1

Open fyzegekmc57 opened 1 year ago

fyzegekmc57 commented 1 year ago

Hi, I am using a live webcam source to stream over UDP. I am sending/transmitting my stream via the following pipeline: "gst-launch-1.0 v4l2src ! jpegdec ! videoconvert ! x264enc tune=zerolatency ! gzenc ! udpsink host="127.0.0.1" port=5000". I am similarly attempting to receive with the following pipeline: "gst-launch-1.0 -vve udpsrc port=5000 ! gzdec ! h264parse ! queue ! avdec_h264 ! queue ! videoconvert ! queue ! autovideosink sync=false". However, I am not seeing any image on the FPS display sink/screen. Do you know any valid reason as to why this might happen? When I attempt to do the same operations within almost the same pipeline but via TCP, the pipelines work. I am assuming this is more or less a UDP issue, since the packets are not guaranteed to come reliably and in order. I am not quite an expert on H264 streaming or data compression. Thanks, Feyzi

ahresse commented 1 year ago

Hello Feyzi,

Did you start the receiver (rx) before the emitter (tx) side? But anyway, this code is an old and unmaintained plugin: You should go without the gz stuffs: h264 should be enough.

Did you manage to make it work?

fyzegekmc97 commented 1 year ago

Hello Feyzi,

Did you start the receiver (rx) before the emitter (tx) side? But anyway, this code is an old and unmaintained plugin: You should go without the gz stuffs: h264 should be enough.

Did you manage to make it work?

Hello,

I managed to make it work by using a combination of the "tcpclientsink" and the "tcpserversrc" at the tx and rx sides, respectively. As I said previously, it's more or less a UDP thing. I guess when the packets don't come in order, the decoding end messes up at understanding the initial dictionary of keywords, which is a common theme across compression schemes. I am not an information theory expert, nor do I have extensive knowledge on networking theory or message compression, thus I'll leave it to you and the further readers to decide and debug. It still is a good addition to any pipeline, especially when data rates are a bottleneck or when it's advantageous to use. I thus beg you to keep this repo alive. Thanks for the feedback and help.

Best, Feyzi