1

I have a program that receives raw image data of known width, height and format from USB camera. Then it outputs each frame to stdout. Format is BGR24.

I need to transfer it as h264 stream using gstreamer but unable to find how to encode the raw video stream.

For example, using ffmpeg this is done like this:

my_video_reader | ffmpeg -f rawvideo -pix_fmt bgr24 -s:v 752x480 -i - -f h264 - | <send data here>
Max
  • 16,679
  • 4
  • 44
  • 57

1 Answers1

0

Try below pipeline, This is used to convert raw YUV Frames into H264stream.

 gst-launch-1.0 videotestsrc ! "video/x-raw,format=I420,width=352,height=288,framerate=30/1" ! videoparse width=352 height=288 framerate=30/1 ! x264enc bitrate=1024 ref=4 key-int-max=20 ! video/x-h264,stream-format=byte-stream,profile=main ! filesink location=v1

If you want to convert a file, instead of videotestsrc, then simply replace the videotestsrc with filesrc location=filename

  • this is not going to work as he is dumping it to stdout not to a file.. Prasanth try modifying the pipe with fdsrc like [here](http://stackoverflow.com/questions/8416818/feeding-gstreamer-fdsrc-via-stdin-only-produces-fraction-of-expected-result) gl :) – nayana May 26 '16 at 09:42