'How to stream motion (jpeg) images/data from folder in C++ using Gstream lib?

i am trying to play sequence of image(.jpeg) from my local folder to play as h264 video in VLC player through local host connection. I am using Gstreamer lib to stream support and i am using from test-launch.c from github samples

OS : Linux 18.04 Gstremer ver: 1.14.2 Building from source using Cerbero

Following command is used to set the parser

multifilesrc location=/home/user/Downloads/gen/img.%4d.jpeg loop=true caps=image/jpeg,framerate=10/1 ! jpegdec ! x264enc ! h264parse ! rtph264pay name=pay0 pt=96

but no streaming happening insted i can see a error like below

(Gstremer_img2vid2:21273): GStreamer-CRITICAL **: 15:57:21.547: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed

0:01:26.143446201 21273 0x55555592b850 ERROR rtspclient rtsp-client.c:3105:handle_setup_request: client 0x5555559d5260: no control in path '/test'

Any help will be appreciated thanks



Solution 1:[1]

You may have to provide size of the frames for jpeg decoding (here using 640x480):

test-launch "multifilesrc location=/home/user/Downloads/gen/img.%4d.jpeg loop=true ! image/jpeg,width=640,height=480,framerate=10/1 ! jpegdec ! x264enc insert-vui=1 ! h264parse config-interval=1 ! rtph264pay name=pay0"

Should be ok for receiving on localhost using vlc:

cvlc rtsp://127.0.0.1:8554/test

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SeB