Kemsa
Kemsa

Reputation: 53

gstreamer: use d3d11h264dec after h264depay not negociated

I'm trying to setup a pipeline on gstreamer to decode a RTP stream with h264 encoding using GPU decode d3d11h264dec.

So far, I've made it work using avdec_h264 along with rtp pay/depay:

gst-launch-1.0 dx9screencapsrc width=1920 height=1080 monitor=1 ! "video/x-raw, framerate=30/1" ! videoconvert ! x264enc speed-preset=ultrafast threads=4 sliced-threads=true ! rtph264pay config-interval=1 pt=96 ! "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! avdec_h264 max-threads=12 ! d3d11videosink

I can also make it work using d3d11h264dec without RTP pay/depay:

gst-launch-1.0 dx9screencapsrc width=1920 height=1080 monitor=1 ! "video/x-raw, framerate=30/1" ! videoconvert ! x264enc speed-preset=medium threads=12 ! d3d11h264dec ! d3d11videosink

But not using both RTP pay/depay and d3d11h264dec:

gst-launch-1.0 dx9screencapsrc width=1920 height=1080 monitor=1 ! "video/x-raw, framerate=30/1" ! videoconvert ! x264enc speed-preset=medium threads=12 ! rtph264pay config-interval=1 pt=96 ! "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! d3d11h264dec ! d3d11videosink

The last one gives me an error not negociated (-4).

I've tried adding a h264parse between depay and decoder as seen on some other issues, to no avail (same error).

I have to work on windows OS and the d3d11videosink is compulsory.

Upvotes: 0

Views: 453

Answers (1)

Kemsa
Kemsa

Reputation: 53

The problem came from the default profile used by x264enc which is profile=(string)high-4:4:4 , whereas d3d11h264dec can't handle it. One must force caps after x264enc. I also had to add h264parse after depay, I d'ont know why...The final pipe is:

gst-launch-1.0 dx9screencapsrc width=1920 height=1080 monitor=1 ! "gst-launch-1.0 dx9screencapsrc width=1920 height=1080 monitor=1 ! "video/x-raw, framerate=30/1" ! videoconvert ! x264enc ! "video/x-h264, profile=(string)high" ! rtph264pay config-interval=1 pt=96 ! "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! h264parse ! d3d11h264dec ! d3d11videosink

Upvotes: 1

Related Questions