-1

I'm trying to input an array of JPG or PNG to stdin of gstreamer.

I studied there are fdsrc element in gstreamer to input data from file descriptor.

I think I can dump mp4 file using fdsrc with this following code.

gst-launch-1.0 -e -v fdsrc fd=0 ! autovideosink

But, I want to input an array of JPG or PNG that is exported from my own application.

How can I do that with fdsrc?

kyasbal
  • 1,132
  • 3
  • 12
  • 27

1 Answers1

0

I could solve this problem with just using gstreamer element jpegdec.

gst-launch-1.0 -e -v  fdsrc fd=0 ! jpegdec ! autovideosink

This sample code could work. However, if you want to use this code with filesink, rtmpsink or some element requires framerate, you may need to set framerate manually because jpegdec will set framerate=0.

gst-launch-1.0 -e -v  fdsrc fd=0 ! jpegdec ! videorate ! videoconvert ! \
                      video/x-raw,framerate=30/1,format=AYUV ! queue ! \
                      x264enc key-int-max=1 tune=zerolatency ! flvmux ! \ 
                      rtmpsink location=rtmp://foo.bar/streamKey
kyasbal
  • 1,132
  • 3
  • 12
  • 27