Search code examples
ffmpeggstreamer

I need help converting a ffmpeg command to a gstreamer pipeline


I am trying to convert a rtsp input stream to a mpegts stream using the command below

ffmpeg -i rtsp://{{rtspUrl}} -f mpegts -codec:v mpeg1video -r 30 -

I need to convert this ffmpeg command to a gstreamer pipeline which will do the same thing as the ffmpeg command, I am a noob with both ffmpeg and gstreamer. Thanks in advance for your help.

I want to reduce the cpu consumption caused by ffmpeg and hence need to move onto gstreamer to be able to use hardware acceleration.


Solution

  • Well i have managed to get a pipeline running well and efficiently

    gst-launch-1.0 rtspsrc location=rtsp://url latency=0 ! queue ! rtph264depay ! h264parse ! v4l2h264dec ! imxvideoconvert_g2d ! videoconvert ! videorate max-rate=30 ! videoscale ! video/x-raw, width=800, height=600 ! avenc_mpeg1video ! mpegtsmux ! fdsink

    I am using IMX hardware decoders here, you may replace them with a suitable option for your case.

    I hope this is useful for someone else too.