KallDrexx
KallDrexx

Reputation: 27813

How do I get codec_data from gstreamer's x264enc plugin?

I have custom code for an RTMP server, and trying to add a gstreamer pipeline to transcode the incoming video and supply those to RTMP playback clients. I have the following pipeline so far:

appsrc name=input ! 
    decodebin ! 
    videoscale ! video/x-raw,width=800,height=600 ! 
    x264enc speed-preset=veryfast name=encoder ! 
    appsink name=output

In order for my appsink's h264 samples to be utilized I need to generate a sequence header packet with the codec data. However, I can't find the codec data.

The caps for the x264enc step is:

"video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, level=(string)3.2, profile=(string)high, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)4/3, framerate=(fraction)60/1, interlace-mode=(string)progressive, colorimetry=(string)bt709, chroma-site=(string)mpeg2"

There's no codec_data caps there, which is how I passed it to appsrc so my h264 packets could be read. How else do I get the codec data from gstream?

Upvotes: 0

Views: 779

Answers (1)

KallDrexx
KallDrexx

Reputation: 27813

I was able to extract the codec_data by passing the x264enc output into h264parse.

Upvotes: 0

Related Questions