Hi I’m trying to send multiple images (.jpeg) to RTSP. The images are written by a program in a directory named “images” and at the same time I want to stream them as they are written in the file. The images are saved as img.0000.jpeg and the number is increased when new images are created. I tried to do this using the test-readme example of GStreamer lib.
I set my factory like this : gst_rtsp_media_factory_set_launch(factory, "( multifilesrc location=\"images.img.%04d.jpeg\" start-index=0 stop-index=0 caps=\"image/jpeg,width=640,height=512,type=video,framerate=\(fraction\)1/1\" ! identity ! jpegdec ! videoconvert ! videoscale ! videorate ! x264enc ! rtph264pay name=pay0 pt=96)");
I’m trying to read this file using VLC at the address “rtsp://127.0.0.1:8554/test” and it failed.
I also tried to read using GStreamer with this command : gst-launch-1.0 rtspsrc location=rtsp://localhost:8554/test latency=100 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480 ! autovideosink
And i get this error :
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://localhost:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unhandled error
Additional debug info:
…/gst/rtsp/gstrtspsrc.c(6564): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Service Unavailable (503)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …
Does anyone know what I am doing wrong here ?
Thanks in advance if anyone can help out :)
Définition du pipeline à PAUSED…
Le pipeline est actif et n’a pas besoin de phase PREROLL…
Contexte de l’élément « autovideosink0-actual-sink-vaapi » : gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)“(GstVaapiDisplayGLX)\ vaapidisplayglx1”;
Progression : (open) Opening Stream
Progression : (connect) Connecting to rtsp://localhost:8554/test
Progression : (open) Retrieving server options
Progression : (open) Retrieving media info
ERREUR : de l’élément /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0 : Unhandled error
Information de débogage supplémentaire :
gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Service Unavailable (503)
ERREUR : le pipeline refuse de passer en phase de préparation.
Définition du pipeline à PAUSED…
Définition du pipeline à READY (prêt)…
Définition du pipeline à NULL…
Libération du pipeline…
I also get this error with the others launch commands.
Définition du pipeline à PAUSED…
Le pipeline a terminé la phase PREROLL…
Passage du pipeline à la phase PLAYING…
New clock: GstSystemClock
Redistribution de latence…
ERREUR : de l’élément /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0 : Internal data stream error.
Information de débogage supplémentaire :
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:00.084566129
Définition du pipeline à PAUSED…
Définition du pipeline à READY (prêt)…
Définition du pipeline à NULL…
Libération du pipeline…
I don’t know what is wrong with multifilesrc in this case. Also I tried with a single image just using multifilesrc location=img.jpg and it also failed.
Also just sending images would fit my needs as I see your proposition.
Is this :
For transcoding into H264, I would advise not using nvv4l2decoder mjpeg=1 in this case because it logs an error such as this one:
host1x 13e10000.host1x: nvhost_syncpt_wait_timeout: invalid syncpoint id 0
so it can quickly fill syslog. You would use nvjpegdec instead.
I see some artifacts each second with nvv4l2h264enc, so I’d suggest using omxh264enc not showing this.
So you would just try:
Also here the images are written to disk and if the stream lasts longs it can generates a lot of images. Do you know if there is a way to put a single image in a buffer img.jpg and program will overwrite a new image on it and stream this using gstreamer.
I know that is possible to pass an image to a pipe but then it receives EOS and stop playing, the solution to make it lasts longer is to add imagefreeze but then there is always the same image displayed. I dont know if there is a way to refresh the stream even using imagefreeze.