RidgeRun / gst-interpipe

GStreamer plug-in for interpipeline communication
Other
143 stars 64 forks source link

Video buffers blocked by h264 and h265 trancoding #90

Open mleivaf opened 3 years ago

mleivaf commented 3 years ago

I am using this pipeline for trans-coding and it works correctly:

gst-launch-1.0 rtspsrc location="rtsp://192.168.1.124:8554/test" name=src protocols="tcp" \
src. ! queue leaky=2 ! rtph264depay ! \
h264parse ! avdec_h264 ! queue ! \
x265enc speed-preset=ultrafast tune=zerolatency bitrate=6000 ! \
filesink location=video.h265 qos=false async=true 

But I have added an interpipe elements after depay the stream:

gst-launch-1.0 rtspsrc location="rtsp://192.168.1.124:8554/test" name=src protocols="tcp" \
src. ! queue leaky=2 ! rtph264depay ! \
interpipesink async=false forward-eos=true forward-events=true name=video qos=false sync=false \
interpipesrc listen-to=video format=time stream-sync=1 accept-eos-event=true caps=video/x-h264,stream-format=byte-stream,alignment=nal ! \
h264parse ! avdec_h264 ! queue ! \
x265enc speed-preset=ultrafast tune=zerolatency bitrate=6000 ! \
filesink location=video.h265 qos=false async=true 

But here, I get and empty video.h265 file. Filesink is not receiving buffers.

if x265enc is removed the filesink received the Raw buffers from the decoder.

gst-launch-1.0 rtspsrc location="rtsp://192.168.1.124:8554/test" name=src protocols="tcp" \
src. ! queue leaky=2 ! rtph264depay ! \
interpipesink async=false forward-eos=true forward-events=true name=video qos=false sync=false \
interpipesrc listen-to=video format=time stream-sync=1 accept-eos-event=true caps=video/x-h264,stream-format=byte-stream,alignment=nal ! \
h264parse ! avdec_h264 ! queue ! \
filesink location=video.raw qos=false async=true

Seems video buffers are blocked by x265enc.

if is added an identity after the interpipesrc the identity reports no buffers.

gst-launch-1.0 rtspsrc location="rtsp://192.168.1.124:8554/test" name=src protocols="tcp" \
src. ! queue leaky=2 ! identity name=src_v silent=false ! rtph264depay ! \
interpipesink async=false forward-eos=true forward-events=true name=video qos=false sync=false \
interpipesrc listen-to=video format=time stream-sync=1 accept-eos-event=true caps=video/x-h264,stream-format=byte-stream,alignment=nal ! identity name=ip_src_v silent=false ! \
h264parse ! avdec_h264 ! queue ! \
x265enc speed-preset=ultrafast tune=zerolatency bitrate=6000 ! \
filesink location=video.h265 qos=false async=true -v 2>&1 | grep -e ip_src_v 
mleivaf commented 3 years ago

This is the video stream source:

gst-launch-1.0 filesrc location=video.ts ! 'video/mpegts' ! queue ! tsdemux name=demux \
demux. ! queue ! h264parse ! avdec_h264 ! x264enc  speed-preset=ultrafast tune=zerolatency bitrate=6000 key-int-max=30 ! \
    h264parse config-interval=1 ! 'video/x-h264,mapping=/test' ! sink. \
demux. ! queue ! aacparse  ! avdec_aac  ! avenc_aac ! aacparse ! 'audio/mpeg,mapping=/test' ! sink. \
rtspsink name=sink service=8554 appsink0::sync=true appsink1::sync=true
pradeephyd commented 2 years ago

the same issue with rtpsrc and interpipesink, seems caps are not negotiated when we use any decoder after interpipesrc