Vladimir
Vladimir

Reputation: 31

Gstreamer 1.0 strange pipeline behavior

I'm have pipeline. It takes RTSP stream from camera, saves HLS segments and frames every minute:

gst-launch-1.0 rtspsrc latency=2000 location=rtsp://192.168.1.16/live2.sdp name=src ! queue ! rtpmp4vdepay ! decodebin ! videorate ! video/x-raw,framerate=15/1,format=I420 ! videoconvert ! tee name=tv 

tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=20 ! multifilesink location=/tmp/%06d-low.jpg 

tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=60 ! multifilesink location=/tmp/%06d-mid.jpg

tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! x264enc bframes=0 bitrate=240 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-low.ts next-file=2 

tv. ! queue ! videoparse width=640 height=480 framerate=15/1 ! x264enc bframes=0 key-int-max=15 bitrate=460 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-mid.ts next-file=2 

It's works. But if I try to change x264enc speed-preset to better than superfast, pipeline not works (no errors, but no files appear).

It starts to work if I'm delete JPG parts and leave only TS.

Maybe I'm doing something wrong? How do I make video quality better?

Upvotes: 0

Views: 2825

Answers (1)

Vladimir
Vladimir

Reputation: 31

I'm solved it. I added tee tv1 for images and tv2 for video.

         ---- queue leaky=1 ! tee name=tv1
        /
tee ----
        \
         ---- queue leaky=1 ! tee name=tv2


gst-launch-1.0 rtspsrc latency=2000 location=rtsp://192.168.1.16/live2.sdp name=src ! queue ! rtpmp4vdepay ! decodebin ! videorate ! video/x-raw,framerate=15/1,format=I420 ! videoconvert ! tee name=tv tv. ! queue leaky=1 ! videoparse width=640 height=480 framerate=15/1 ! tee name=tv1 tv. ! queue leaky=1 ! videoparse width=640 height=480 framerate=15/1 ! tee name=tv2

tv1. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=20 ! multifilesink location=/tmp/%06d-low.jpg 

tv1. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videorate ! video/x-raw,framerate=1/60,format=I420 ! jpegenc quality=60 ! multifilesink location=/tmp/%06d-mid.jpg

tv2. ! queue ! videoparse width=640 height=480 framerate=15/1 ! videoscale ! video/x-raw,width=320,height=240 ! x264enc bframes=0 bitrate=240 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-low.ts next-file=2 

tv2. ! queue ! videoparse width=640 height=480 framerate=15/1 ! x264enc bframes=0 key-int-max=15 bitrate=460 speed-preset=superfast ! mpegtsmux ! multifilesink location=/tmp/%06d-mid.ts next-file=2

Upvotes: 1

Related Questions