Encoding H264 from appsrc example

I am trying to encode video

The input frame is from appsrc (format RGB) -> encoding h264 -> send over udp

I have working code that I can see on client on GSTREMAER BUT when I try to open it on VLC it doe not work

When I try to use videotestsrc as the src element I can see the video with VLC

  1. Is working code example how to push frames and send them as encoding video as udp?
  2. What can be the difference between videotestsrc and my appsrc?



Hi Eli,
h264 encoder only supports NV12 or I420 input.
A post for reference:


My pipeline include convert between the appsrc and the encoder
The pipeline that I use jave the following elements:


So I assume that even if my appsrc is RGB format, the videoconvert will change the format so it will be appropriate to the h264 encoder


Hi Eli,
Please refer to

and check if the saved video file can be played.